To perform the actions described in this topic, ensure that Apache Ant is installed on your machine.
To replay keyword-driven tests with Apache Ant, for example to generate HTML reports of the test runs, use the KeywordTestSuite class.
@RunWith(KeywordTestSuite.class) @KeywordTests({ "My Keyword-Driven Test" }) public class MyTestSuite { }
<target name="runTests" depends="compile"> <mkdir dir="./reports"/> <junit printsummary="true" showoutput="true" fork="true"> <classpath> <fileset dir="${output}"> <include name="**/*.jar" /> </fileset> <fileset dir="${buildlib}"> <include name="**/*.jar" /> </fileset> <fileset dir="C:/Program Files (x86)/Silk/SilkTest/ng/KeywordDrivenTesting"> <include name="**/*.jar" /> </fileset> </classpath> <test name="MyTestSuite" todir="./reports"/> </junit> </target>For additional information about the JUnit task, see https://ant.apache.org/manual/Tasks/junit.html.
<formatter type="xml" />
<junitreport todir="./reports"> <fileset dir="./reports"> <include name="TEST-*.xml" /> </fileset> <report format="noframes" todir="./report/html" /> </junitreport>For additional information about the JUnitReport task, see https://ant.apache.org/manual/Tasks/junitreport.html. The complete target should now look like the following:
<target name="runTests" depends="compile"> <mkdir dir="./reports"/> <junit printsummary="true" showoutput="true" fork="true"> <classpath> <fileset dir="${output}"> <include name="**/*.jar" /> </fileset> <fileset dir="${buildlib}"> <include name="**/*.jar" /> </fileset> <fileset dir="C:/Program Files (x86)/Silk/SilkTest/ng/KeywordDrivenTesting"> <include name="**/*.jar" /> </fileset> </classpath> <formatter type="xml" /> <test name="MyTestSuite" todir="./reports"/> </junit> <junitreport todir="./reports"> <fileset dir="./reports"> <include name="TEST-*.xml" /> </fileset> <report format="noframes" todir="./report/html" /> </junitreport> </target>