Building a Keyword-Driven Library Using Java

Build an external keyword-driven library with Java to upload it to Silk Central. This enables you to easily integrate your existing test framework into Silk Central, for example if you already have existing Selenium tests.
  1. Select Help > Tools and download the Java Keyword Library Tool.
  2. Add the downloaded to the classpath of your Java project.
  3. Create a Java class that will contain your Keywords.
  4. Annotate the Java methods that you want to use as keywords. The following sample outlines a class that contains one keyword:
    public class Keywords {
      @Keyword("My Keyword")
      public void myKeyword(@Argument("Username") String name) {
  5. Compile your sources and create a Java archive (jar). If you are using Java 9 or later, ensure that the Created-By property in the MANIFEST.MF file contains the Java version that the library was built with.
  6. Call the command line tool that is contained in the downloaded jar file with the following arguments:
    • java
    • -jar
    • -build
    • Library name to be generated.
    • Library type, only Java is currently supported.
    • Binaries path where your keyword library jar file resides and if applicable, any other required libraries.
    • Name of the output library package (zip archive) to be generated.
    The following example outlines the command line to build a keyword library:
    java -jar -build 
    MyLibrary Java ./output "./output/"
Select Tests > Libraries > <Library> > Properties . The generated zip archive can be uploaded to Silk Central with the command line tool or in the Keyword Library section.