cancel
Showing results for 
Search instead for 
Did you mean: 

Vanilla TestStep Plugin fails with error

erikskogl
Occasional Visitor

Vanilla TestStep Plugin fails with error

Hello,

 

Just trying to test making plugins and created a new project with TestStep defined when generating. Code looks exactly like the example found here .

 

Loading plugin works fine, I can create a teststep with my custom TestStep class. But when selecting it in the treeview for the tests i get the following exception;

 

   java.lang.NullPointerException
   	at com.smartbear.ready.functional.view.FunctionalModuleMenu.toggleStepMenu(FunctionalModuleMenu.java:159)
   	at com.smartbear.ready.functional.view.FunctionalModuleMenu.setToggleDisable(FunctionalModuleMenu.java:80)
   	at com.smartbear.ready.functional.view.FunctionalModuleMenu.enableMenuItemsForCurrentModelItem(FunctionalModuleMenu.java:53)
...
..

It works when just adding the step, but when selecting it again it just fails like this, and no gui window pops up either.

 

Here's my pom file if that helps.

 

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <name>Ready! API TestStep Plugin</name>
    <artifactId>test</artifactId>
    <groupId>com.centiro</groupId>

    <repositories>
        <repository>
            <id>eviware</id>
            <name>Eviware Maven2 Repository</name>
            <url>http://www.eviware.com/repository/maven2</url>
        </repository>
        <repository>
            <id>central</id>
            <name>Central Maven2 Repository</name>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
    </repositories>

    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.codehaus.gmaven.runtime</groupId>
            <artifactId>gmaven-runtime-1.8</artifactId>
            <version>1.5</version>
        </dependency>
        <dependency>
            <groupId>com.smartbear</groupId>
            <artifactId>ready-api-soapui-pro</artifactId>
            <version>1.4.0</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>2.8.0-01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>2.1.8-01</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>


</project>
1 REPLY 1
Vyacheslav
Staff

Re: Vanilla TestStep Plugin fails with error

Hi.

 

You get the error because Ready! API expects mandatory Enable\Disable actions for the TestStep node.

I have reported about issue to the devlopment team so checking on existence of the required actions will be added as soon as possible.

 

At now you need to define your own ActionsGroup for your TestStep to solve the issue. There are 2 step:

1. Implement SoapUIActionGroup interface with declaration of the Enable\Disable action. Simplest way to do this is to extend existing class from the Ready! API that already do it:

public class MyTestStepActionGroup extends WsdlTestStepSoapUIActionGroup {
    public MyTestStepActionGroup() {
        super("ActionGroup ID", "ActionGroup description");
    }
}

  First argument of the base constructor ("ActionGroup ID") must be replaced with the string: your TestStep class name +      "Actions" suffix.

2. Register your ActionGroup:

SoapUI.getActionRegistry().addActionGroup(new MyTestStepActionGroup());

  Best place for this is PluginConfig constructor

 

Vyacheslav, software developer in the Ready! API team

New Here?
Join us and watch the welcome video:
Building with the Collaborator API

Help Documenation
The Collaborator API is a JSON-RPC API that lets you integrate with Collaborator 9.0 and above. For more information about how the API works, check out the API description here:


Sample Plugins
For an example of an add-in that uses the API, take a look at the Microsoft Word Add-in for Collaborator:


We list all the great plugins our network has already built on this page on the SmartBear website.