The strategy file tells JTAF which tests to execute.
It is an XML file whose root element is “execute” and has the following child elements
automationValueThis is a way of filtering which tests specified by <target> elements should be run. A test will be run only if its <automationValue> is specified in the strategy file or if the strategy file does not specify an automationValue at all.
A test can be given an automationValue by adding <automationValue> as a child node under <test> elements in a test suite .xml file. A specific test can have zero or one<br> <automationValue>
maxThreads
This is the maximum number of threads with which to execute tests. The framework will attempt to execute this many tests in parallel depending on the number of tests that are remaining as well as any dependent tests that must be run first. If not specified, this value defaults to 1.
targetSpecifies one or more test to execute with the “name” attribute. All filepaths are specified in relation to the “testscripts” root folder.
Values may be:
1. A folder containing test suite files or additional folders (folders are searched recursively) .
2. A specific test suite file
3. A specific test within a test suite file
Example strategy file:
<execute>
<automationValue><High></automationValue>
<maxThreads>4</maxThreads>
<target name="Folder1" />
<target name="Folder2/testscriptfile.xml" />
<target name="”Folder2/scriptfile2.xml/Specific" Test="" Within="" File="" />
</execute>
In the above example:
- The framework will search recursively for all scripts in the folder testscripts/Folder1 .
- The framework will search for all tests in testscripts/Folder2/testscriptfile.xml .
- The framework will also execute the test “Specific Test Within File” that is part of the file Folder2/scriptfile2.xml .
- Only those scripts with an
of “High” will be executed.
Example file with a test that has set to “High”:
<testsuite name="automationValue Example Test Suite">
<test name="High automationValue test">
<automationValue>High</automationValue>
<teststeps>
<SomeCommand></SomeCommand>
</teststeps>
</test>
</testsuite>