TestProject Forum
Powered by leading experts in the test automation community

None of the code blocks in the provided JAR are CoddedAddon

What does this mean? I used the addon in the sample and tried to expand it a litte to do some experiments with it. But s.th. seems to be missing, has to be changed.

Tried to start with AddOns. So please do not mind the simplicity of the code :slight_smile:

import io.testproject.java.annotations.v2.Action;
import io.testproject.java.annotations.v2.Parameter;
import io.testproject.java.enums.ParameterDirection;
import io.testproject.java.sdk.v2.addons.GenericAction;
import io.testproject.java.sdk.v2.addons.helpers.AddonHelper;
import io.testproject.java.sdk.v2.enums.ExecutionResult;
import io.testproject.java.sdk.v2.exceptions.FailureException;

@Action(name = “MySelector”,
description = “Get Selector of {{type}} for {{element}} on {{page}}”,
summary = “Gives back a Selector for an Element on a Page”)
public class MySelector implements GenericAction {

@Parameter(description = "Page")
public String page;

@Parameter(description = "Element")
public String element;

@Parameter(description = "Type")
public String type;

@Parameter(description = "Selector", direction = ParameterDirection.OUTPUT)
public String result;

@Override
public ExecutionResult execute(AddonHelper addonHelper) throws FailureException {
    result = "XX";

    addonHelper.getReporter().result("Selector is: " + result);

    return ExecutionResult.PASSED;
}

}

Hello and thanks for reaching out.

I have tried uploading your code as an addon and it has worked for me.
Please make sure you are building the .jar correctly and to not include the TestProject SDK in the final uploaded .jar itself.

If you are using Gradle for your project, please consider using the build.gradle file located here as it will handle removing the SDK .jar file for you:


You will need to update the path of the SDK to the correct one for your system in the above file template.
Then after clean and and build your project again, and upload the file created in your build/libs folder as the addon.

Thank you for the fast response. Funny thing is, I did all of this - I thought.
Now I’ve taken the complete SDK sample anew, copied my code into it,
did the changes in the gradle file and taddaa … it worked. So I think I’ve
destroyed s.th. in the deep of the code/config…etc during playing around with it.
Regards

Sure, don’t mention it. Happens to everyone.

I am getting this error when I try upload my gradle projects .jar file to testproject.
“None of the code blocks in the provided JAR are CodedTest”
Can u help me with this?

Hello @suranga1201.

Are you by any chance using the new SDK? Tests created with the new SDK no longer need to be uploaded to the platform as JAR files.

Reports are generated and updated on the platform automatically.

2 Likes

oh.I did not know about it.Its really great.
BTW,if i am using old sdk Can I upload it into Platform.

The older SDK will be used for addon development, once made, addons can then be uploaded to the platform and used in your recorded tests.

1 Like

Hi David,

My apology but I don’t quite get your idea.
If I don’t import any jar into the platform, how it would recognize my test and add report to my project?

And if so what kind of code should I implement in my test to let the system know?

I am very new with testproject as well as automation, so please excuse my silly question.

Hi @ttran97, no worries.

After adding the SDK to your project, you can initialize and use the TestProject automation driver.
When initializing the driver with your developer token, you can set the project name where the reports will be stored.
The SDK’s can easily be integrated into any existing automation project by simply changing the driver initialization.

The TestProject SDK reports all driver commands to the TestProject cloud and the report is generated automatically when a test ends or when the driver quits. You can override this behavior by disabling automatic reports and you can in addition create your own manually reported steps.

You can generate a developer token and find links to each SDK’s GitHub repositories containing much more detailed explanations and examples through here:
https://app.testproject.io/#/integrations/sdk