Skip to content
  • Documentation
  • Tutorials
  • Blogs
  • Product

What's on this Page

  • Adding a new Keyword by manual registration
    • Generic fields
    • Type fields
    • Composite Keywords
  • Adding Keywords via package file
  • How to manage versions of a Keyword
  • Find usage of Keywords
    • How to
  1. Step
  2. User guide
  3. Keywords
  4. Deployment of Keywords
This article references one of our previous releases, click here to go to our latest version instead.

Deployment of Keywords

What's on this Page

  • Adding a new Keyword by manual registration
    • Generic fields
    • Type fields
    • Composite Keywords
  • Adding Keywords via package file
  • How to manage versions of a Keyword
  • Find usage of Keywords
    • How to

You can add and manage Keywords by manual registration or automatically using Automation Packages.

Adding a new Keyword by manual registration

In order to use your Keywords with Step, you need to register them. This can be done through the web interface or the Java API.

Generic fields

    From the Keyword collection window, use the + button to open the following New keyword dialog. The dialog is a visial editor that lets you fill in generic and type specific information for your Keyword.

    The following fields are generic to all Keyword types:

    • Name: The name of the Keyword let’s you reference the Keyword. For Java (resp. C#), this field must match the name given in the annotation (resp. the attribute).

    • Description: The description filed of the Keyword lets you put more details / explanation about the Keyword in a free text field.

    • Schema: JSON schema used to defined keywords’input in the plan editor and for validation at execution time. With this field you can specify the name of your Keyword inputs, their types, whether they are mandatory and their default values. The schema editor let you construct you schema seamlessly (4).

    • Type: The type of the Keyword. The type specific fields (indicated in the screenshot in red) vary for each type.

    • Keyword type’s fields : each keyword type has its specific configuration fields

    • Advanced configuration:

      • Call timeout (ms): The maximum duration (in milliseconds) of a Keyword execution. If the Keyword execution last for more than this timeout, the controller will report an error and the agent will try to interrupt the Keyword.
      • For Execute on controller and Agent token selection criteria: See Routing Keyword.

    Registering a Keyword is not possible using the natural language interface. Keywords have to be registered using the web interface or the Java remote client.

    The following code snippet shows how to register a Java Keyword using the remote client. Please note that in the following example,:

    • the client object is a step.client.StepClient connected to your controller.
    • a Keyword is called a Function internally.
    • we use the step.plugins.java.GeneralScriptFunction Keyword type. You will find the list of available types in the next section, or you can also find this list by checking in your IDE for all the classes extending the base class step.functions.Function:
    try (RemoteFunctionManagerImpl functionClient = (RemoteFunctionManagerImpl) client.getFunctionManager()) {
      // We use here a GeneralScriptFunction for creating a Keyword of type "script":
      GeneralScriptFunction keyword = new GeneralScriptFunction();
      keyword.setId(new ObjectId());
      // We define some attributes:
      Map<String, String> attributes = new HashMap<>();
      attributes.put(Function.NAME, "Demo_Keyword_Java");
      attributes.put("app", "AppName");
      keyword.setAttributes(attributes);
      // We set it as a Java keyword and indicate the path to the jar file
      // The script language can also be "javascript" or "groovy":
      keyword.setScriptLanguage(new DynamicValue<String>("java"));
      keyword.setScriptFile(new DynamicValue<String>("/.../demo-java-keyword.jar"));
      // finally, we save the keyword on the controller:
      functionClient.saveFunction(keyword);
    }

    Type fields

    This section lists the set of attributes for each Keyword type.

    Language-based Keyword types

      For Script (Java, JS, Groovy, etc), the following fields are needed:

      • Script language: The language used (Java, JavaScript or Groovy)
      • Libraries: An optional library, containing the Keyword dependencies.
      • JAR file: The script/JAR file containing the Keyword.

      Note: The file selector lets you directly drop files via the GUI, lookup and update existing resources, and download your files.

      For .NET, and similar to Java, a zip of all required dependencies (that is, other DLL files as well as PDB files) can be provided in the Libraries field, and you can drag the Keyword’s own DLL file into its own field (or via absolute path if you wish to reference a local file on the controller).

      For Node.js, a folder containing a NodeJS project is needed. The folder must contain a sub-folder named keywords, containing a keywords.js file. If your Keywords require external modules, the folder must also contain a package.json declaring them: the agent installs the declared dependencies before running the Keyword (with npm ci if the folder contains a package-lock.json or npm-shrinkwrap.json, with npm install otherwise, see Execution on the Node.js agent), and no other modules are available to it. Keywords using only Node.js built-in modules need no package.json. You can specify the folder as a path accessible from the controller or as a zip file that you can drop on the GUI. Take a look at the github of the agent for an example of such a project.

      Registering a keyword is not possible using the natural language interface. Keywords have to be registered using the web interface or the Java Remote Client

      The following classes have to be used when registering a script keyword via the API:

      • step.plugins.java.GeneralScriptFunction for Java or script keywords. The following setters exist:
      GeneralScriptFunction keyword = new GeneralScriptFunction();
      keyword.setId(new ObjectId());
      Map<String, String> attributes = new HashMap<>();
      attributes.put(Function.NAME, "Demo_Keyword_Java");
      keyword.setAttributes(attributes);
      //
      keyword.setScriptLanguage(new DynamicValue<String>("java"));
      keyword.setScriptFile(new DynamicValue<String>("/.../demo-java-keyword.jar"));
      keyword.setLibrariesFile(new DynamicValue<String>("/.../dependencies.jar"));
      • step.plugins.dotnet.DotNetFunction for C# based keywords. The following setters exist:
      DotNetFunction keyword = new DotNetFunction();
      keyword.setId(new ObjectId());
      Map<String, String> attributes = new HashMap<>();
      attributes.put(Function.NAME, "Demo_Keyword_Net");
      keyword.setAttributes(attributes);
      //
      keyword.setDllFile(new DynamicValue<String>("/.../demo-net-keyword.dll"));
      • step.plugins.node.NodeFunction for NodeJS based keywords. The following setters exist:
      NodeFunction keyword = new NodeFunction();
      keyword.setId(new ObjectId());
      Map<String, String> attributes = new HashMap<>();
      attributes.put(Function.NAME, "Demo_Keyword_JS");
      keyword.setAttributes(attributes);
      //
      keyword.setJsFile(new DynamicValue<String>("/.../demo-js-keyword.js"));

      Composite Keywords

        For a Composite Keyword, the required fields are Name and Type.

        Registering a keyword is not possible using the natural language interface. Keywords have to be registered using the web interface or the Java Remote Client

        The following classes have to be used when registering a composite keyword via the API:

        • step.plugins.functions.types.CompositeFunction for composite keywords. The following setters exist:
        CompositeFunction keyword = new CompositeFunction();
        keyword.setId(new ObjectId());
        Map<String, String> attributes = new HashMap<>();
        attributes.put(Function.NAME, "Demo_Keyword_Composite");
        keyword.setAttributes(attributes);
        //
        keyword.setArtefactId(new DynamicValue<String>("5bc73a2b23a34f000e4a6fb0"));

        Plugin-based Keywords

        The following is a list of the needed fields and links to the Keyword API for the major plugins:

          • PDF Test: Needs a scenario file (leave empty for creating a new scenario)
          • SoapUI: Needs a SoapUI project file and the name of the Testsuite/Testcase
          • JMeter: Needs a JMeter Testplan
          • QF-Test: Needs a QF-Test testsuite, the procedure and a boolean indicating if the suite should be send to the agent
          • Oryon: Needs the script language and the script file

          Registering a keyword is not possible using the natural language interface. Keywords have to be registered using the web interface or the Java Remote Client

          • PDF Test: See step.plugins.pdftest.PdfTestFunction
          • SoapUI: See step.plugins.soapui.SoapUIFunction
          • JMeter: See step.plugins.jmeter.JMeterFunction
          • QF-Test: See step.plugins.qftest.QFTestFunction
          • Oryon: Needs the script language and the script file. See step.plugins.oryon.OryonFunction

          Adding Keywords via package file

          Keyword Packages were removed in Step 31. To deploy the Keywords of a JAR or DLL in bulk, deploy it as an Automation Package: Step discovers the annotated Keywords it contains in the same way. Existing Keyword Packages are migrated automatically when upgrading, see the migration guide.

          How to manage versions of a Keyword

          If multiple versions of the same keywords exist, and you run your plan using plain text plans or plugins based on such plan like the ALM plugin, you will need a mechanism to select the proper version of your Keyword. This can be done with the configuration property step.repositories.parser.attributes.mapping defined in step.properties.

          The parameter takes a semicolon-separated list of coma-separated tuples (i.e., …=param1.1,param1.2;param2.1,param2.2;…), where the first value of the tuple is a functionTable parameter, and the second value is any parameter that can be evaluated by Step.

          Example: Suppose your functionTables contains the parameter attributes.version.

          • If you define the following global parameters:

          • Then configure the Step property as below:

            step.repositories.parser.attributes.mapping=version,version_selector;

          Then Step will select the version 2.0.0 of your Keyword if you execute your test with the execution parameter env==TEST, and the version 1.0.0 if you execute it with env==PROD.

          Find usage of Keywords

          This feature is not limited to Keywords and can be used similarly for plans and resources. The functionality allows searching for references from plans and composite Keywords to the selected element, facilitating efficient usage across your automation project.

          How to

          Note: only the Plans and composite Keywords which are directly accessible in the current project are displayed as link.

          Topics: Keywords Automation Packages Browse all topics

          Related tutorials

          • Basic Keyword Development
          • Keyword-driven Automation with Playwright and TypeScript
          • Load Testing with Selenium using the Step UI
          • Android Testing using Step and Appium

          Related documentation

          • Keyword Configuration
          • Step Studio
          • JavaScript Keywords
          • C# Keywords
          • TypeScript Keywords
          • Home
          • Whats new?
          • Release Strategy
          • Set up
          • Administration
          • SaaS guide
          • User guide
            • Keywords
              • Deployment of Keywords
              • Keyword Configuration
              • Prebuilt Keyword Libraries
            • Plans
            • Executions
            • Automation Packages View
            • Agent provisioning
            • Alerting and notifications
            • Incidents
            • Monitoring
            • Parameters
            • Schedules
            • Analytics
            • Event Broker Monitor
            • Import/Export entities
            • User account
            • Versioning
            • Live Reporting
            • Bookmarks
          • Developer guide
          • DevOps
          • AI
          • Plugins
          • Libraries
          Step Logo
            • Documentation
            • Tutorials
            • Blogs
            • Product
            • Home
            • Whats new?
            • Release Strategy
            • Set up
            • Administration
            • SaaS guide
            • User guide
              • Keywords
                • Deployment of Keywords
                • Keyword Configuration
                • Prebuilt Keyword Libraries
              • Plans
              • Executions
              • Automation Packages View
              • Agent provisioning
              • Alerting and notifications
              • Incidents
              • Monitoring
              • Parameters
              • Schedules
              • Analytics
              • Event Broker Monitor
              • Import/Export entities
              • User account
              • Versioning
              • Live Reporting
              • Bookmarks
            • Developer guide
            • DevOps
            • AI
            • Plugins
            • Libraries