After you create tests or test suites for your application in
HCL OneTest™ API, you can generate a project configuration file for the tests.
Procedure
-
Select Generate External Tool Configuration from the
Tools menu.
The Generate External Tool Configuration wizard is displayed.
-
Complete the following steps in the Configuration type
and environment window of the Generate External
Tool Configuration wizard:
-
Select Jenkins project configuration for executing
tests or suites using the Integration Tester Test Execution
plugin.
-
Select the HCL OneTest™ API
environment from the list in which the selected resources are to be run.
-
Click Next.
The Select resources window is displayed with the project resources
tree.
-
Complete the following steps in the Select
resources window of the Generate External Tool
Configuration wizard:
-
Select the tests or suites that you want to include in the
project
configuration.
Note: You can select multiple items by pressing the
Ctrl or Shift
key and clicking the tests or suites.
-
Select from the options Name or
ID, in which the resources are
referred.
The advantage of using names is that they are more easily
recognizable. If you delete the resource from the project and
create another resource with the same name, the script still
works.
If you choose to use IDs, you can rename or move the resource
within the project, and the script still works.
Note: If you have selected one or more resources in the Test
Factory perspective, those resources are automatically
included in the project configuration.
-
Click Next.
The Jenkins project configuration options
window is displayed.
-
Complete the following steps in the Jenkins project
configuration options window of the Generate
External Tool Configuration wizard:
-
Select an option from the following that the Jenkins project
configuration script can refer to during a test run:
- The current installation directory of HCL OneTest™ API or HCL OneTest™ API Agent.
- Allow the script to use the environment variables that can
be queried at runtime.
-
Click Next.
The Summary window is displayed with a
preview of the contents of the Jenkins project configuration
file in an XML format.
-
Complete the following steps in the Summary
window of the Generate External Tool
Configuration wizard:
-
Click Browse to select a location.
-
Enter config for the filename.
Note: The project configuration file is saved as an XML file by
default.
-
Click Save.
-
Click Finish.
An example of the Jenkins project configuration generated by
HCL OneTest™ API is as follows:
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<com.hcl.products.test.it.jenkins.RunTests plugin="jenkins-it-runtests@1.920.0">
<additionalArgs></additionalArgs>
<baseTempDirectory></baseTempDirectory>
<environment>RedHatTest</environment>
<environmentTags></environmentTags>
<input></input>
<installationDirectory>C:\Program Files\HCL\HCLProducts\API</installationDirectory>
<junitDir></junitDir>
<loginAsAdmin>false</loginAsAdmin>
<noDB>false</noDB>
<noHTTP>false</noHTTP>
<noResultsPublishers>false</noResultsPublishers>
<output></output>
<overrideSlowFail></overrideSlowFail>
<project>D:\Shivi\Projects\RIT\92\Testfor66501\911RITTest\911RITTest.ghp</project>
<projectPassword></projectPassword>
<projectUser></projectUser>
<resultsServerLogging></resultsServerLogging>
<securityToken></securityToken>
<startupTimeout></startupTimeout>
<tests>addNumbers/addition/additionTest</tests>
<useResultsPublishers></useResultsPublishers>
<vmArgs></vmArgs>
</com.hcl.products.test.it.jenkins.RunTests>
</builders>
<publishers/>
<buildWrappers/>
</project>
-
Create a directory preferably with the name of the job you want to
create in the following folder:
Jenkins_installation_directory/jobs
-
Copy the config.xml file into the new
directory.
-
In the Jenkins admin panel, click , and then click OK to list the
new job in Jenkins.
Results
The Jenkins project configuration file for the tests is generated.
What to do next
You can configure the Jenkins job as appropriate to run the tests or
suites. See Configuring the Freestyle project by using the Ant script.