Uploading a Keyword Library to Silk Central

To work with Silk Central, ensure that you have configured a valid Silk Central location. For additional information, see Integrating Silk4J with Silk Central.

To automate manual tests in Silk Central, upload keywords that you have implemented in a Silk4J project as a keyword library to Silk Central, where you can then use the keywords to automate manual tests.
  1. In Silk4J, select the project in which the keyword-driven tests reside.
  2. Ensure that a library with the same name exists in Silk Central (Tests > Libraries).
  3. In the toolbar, click Upload Keyword Library.
  4. Optional: Provide a description of the changes to the keyword library.
  5. Optional: Click Configure to configure the connection to Silk Central.
  6. Optional: To see which libraries are available in the connected Silk Central instance, click on the link.
  7. Click Upload.
    CAUTION:
    If the keyword library in Silk Central is already assigned to a different automation tool or another Silk Test client, you are asked if you really want to change the type of the keyword library. Upload the library only if you are sure that you want to change the type.
Silk4J creates a keyword library out of all the keywords that are implemented in the project. Then Silk4J saves the keyword library with the name library.zip into the output folder of the project. The library is validated for consistency, and any changes which might break existing tests in Silk Central are listed in the Upload Keyword Library to Silk Central dialog box. Finally, Silk4J uploads the library to Silk Central. You can now use the keywords in Silk Central. Any keyword-driven tests in Silk Central, which use the keywords that are included in the keyword library, automatically use the current implementation of the keywords.

Uploading a keyword library from a project that was created in Silk Test 15.5

To upload keyword libraries from Silk4J projects that were created with Silk Test 15.5, you need to edit the build.xml file of the project.

  1. In the Package Explorer, expand the folder of the project from which you want to upload the keyword library.
  2. Open the build.xml file.
  3. Add the keyword assets directory of the project to the JAR build step of the compile target:
    <fileset dir="Keyword Assets" includes="**/*.kwd" erroronmissingdir="false" />
  4. Add the following target for the keyword library:
    <target name="build.keyword.library" depends="compile">
      <java classname="com.borland.silk.kwd.library.docbuilder.DocBuilder" fork="true">
        <classpath refid="project.classpath" />
           
        <arg value="AutoQuote Silk4J Library" />
        <arg value="${output}" />
        <arg value="${output}/library.zip" />
      </java>
    </target>

The new build.xml file should look like the following:

<?xml version="1.0" encoding="UTF-8"?>
<project name="AutoQuote" default="compile">

  <property name="src" value="src" />
  <property name="bin" value="build" />
  <property name="output" value="output" />
  <property name="lib" value="lib" />
  <property name="buildlib" value="buildlib" />

  <path id="project.classpath">
    <fileset dir="${lib}" includes="*.jar" excludes="*source*" />
    <fileset dir="${buildlib}" includes="*.jar" excludes="*source*" />
  </path>

  <target name="clean">
    <delete dir="${output}" />
  </target>
  
  <target name="compile" depends="clean">
    <mkdir dir="${output}" />

    <delete dir="${bin}" />
    <mkdir dir="${bin}" />

    <componentdef name="ecj" classname="org.eclipse.jdt.core.JDTCompilerAdapter" classpathref="project.classpath" />
    <javac srcdir="${src}" destdir="${bin}" debug="true" source="1.7" target="1.7" encoding="utf-8" includeantruntime="false">
      <classpath refid="project.classpath" />
      <ecj />
    </javac>

    <jar destfile="${output}/tests.jar" >
      <fileset dir="${bin}" includes="**/*.class" />
      <fileset dir="${src}" includes="**/*" excludes="**/*.java" />
      <fileset dir="Object Maps" includes="**/*.objectmap" erroronmissingdir="false" />
      <fileset dir="Image Assets" includes="**/*.imageasset" erroronmissingdir="false" />
      <fileset dir="Verifications" includes="**/*.verification" erroronmissingdir="false" />
      <fileset dir="Keyword Assets" includes="**/*.kwd" erroronmissingdir="false" />
    </jar>

    <copy todir="${output}" overwrite="true">
      <fileset dir="${lib}" includes="*.jar" excludes="*source*" />
    </copy>
    <delete dir="${bin}" />
  </target>

  <target name="build.keyword.library" depends="compile">
    <java classname="com.borland.silk.kwd.library.docbuilder.DocBuilder" fork="true">
      <classpath refid="project.classpath" />
       
      <arg value="AutoQuote Silk4J Library" />
      <arg value="${output}" />
      <arg value="${output}/library.zip" />
     </java>
  </target>
</project>