You must update the PATH variable to reference your JDK location before performing this task. For details, reference the Sun documentation at: http://java.sun.com/j2se/1.5.0/install-windows.html.
To replay keyword-driven tests from the command line, for example when replaying the tests from a CI server, use the KeywordTestSuite class.
@RunWith(KeywordTestSuite.class)
@KeywordTests({ "My Keyword-Driven Test" })
public class MyTestSuite {
}
set CLASSPATH=<eclipse_install_directory>\plugins\org.junit_4.11.0.v201303080030\junit.jar;<eclipse_install_directory>\plugins\org.hamcrest.core_1.3.0.v201303031735.jar;%OPEN_AGENT_HOME%\JTF\silktest-jtf-nodeps.jar;%OPEN_AGENT_HOME%\KeywordDrivenTesting\com.borland.silk.keyworddriven.engine.jar;C:\myTests.jar
package demo;
import org.junit.runner.RunWith;
import com.borland.silktest.jtf.keyworddriven.KeywordTestSuite;
import com.borland.silktest.jtf.keyworddriven.KeywordTests;
@RunWith(KeywordTestSuite.class)
@KeywordTests({ "My Keyword Driven Test 1", "My Keyword Driven Test 2" })
public class MyTestSuite {
}
To run the class from the command line, type the following:
java org.junit.runner.JUnitCore demo.KeywordTestSuiteTo run the class from the command line, using global variables stored in the file c:\temp\globalvariables.properties, type the following:
java -Dsilk.keyworddriven.engine.globalVariablesFile=c:\temp\globalvariables.properties org.junit.runner.JUnitCore demo.KeywordTestSuiteFor additional information, see Replaying a Keyword-Driven Test with Specific Variables.