Over the past few weeks, I have been introducing Eye on Quality readers to some of the protocols for running LeanFT (UFT Pro) and UFT tests with Jenkins. (Learn more about both products at https://software.microfocus.com). Using Jenkins to execute your UFT and LeanFT tests is a great way to enhance your CICD pipeline. Today, I’ll share instructions for running LeanFT tests with Jenkins.
To read the earlier articles in this series, click the links below:
- Setting up Jenkins to execute tests built with Micro Focus UFT and LeanFT
- Using Jenkins to Run and View UFT Tests in ALM
Note that the purpose of this article is not to cover every scenario, but rather to review basic set up including a few potential setting changes that I discovered I needed in my test environment. You may need to make other changes necessary for your environment. If you find something that might benefit others, please include details in comments.
LeanFT jobs run from file system
- From the Jenkins dashboard, click New Item
- Enter an appropriate job name
- Choose Freestyle Project and click OK
- Check the “Restrict where this project can be run” box and enter the node on which you want to run the test
- In the Build section, click “Add build step”
- Choose “Execute Windows batch command”
- Enter the command that will run your test runner (for this example, I’m using NUnit). The first part of the command is the path to the test runner, and the second part is the path to the test executable file (in this case a .dll since I used .Net for this example). The command line will look similar to this:
“C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe” “C:\LeanFT-Tests\Advantage-Shopping\Advanced_Shopping_Tutorial.dll”
There are several other options you can perform with Jenkins. Please refer to the Micro Focus Community (registration required) and search under Integrating LeanFT With Jenkins for additional information.
LeanFT jobs run from ALM
- From the Jenkins dashboard, click New Item
- Enter an appropriate job name
- Choose Freestyle Project and click OK
- Check the “Restrict where this project can be run” box and enter the node you which you want to run the test
- In the Build section, click “Add build step”
- Choose “Execute Micro Focus* functional tests from Micro Focus ALM”
- Enter your ALM server information
- Choose the ALM Server
- Enter the ALM User Name and Password for the user that will be running the test set
- Enter the ALM Domain and Project
- Enter the full path to the test set(s), including the Root folder. It should look something like:
Root\testfolder1\testset_a - Click apply
- In the Post-build Actions section, click “Add post-build action”
- Choose “Publish Micro Focus tests result”
- For the “Report archive mode” there are several options. Choose the one appropriate for your use. I typically choose “Always archive HPE test reports”
- Click Save.
Viewing the results of LeanFT tests run via Jenkins
LeanFT jobs run from the file system
- In Jenkins, click on the job.
- Click the Console Output link.
- Find the Results section and navigate to the path shown.
4. Enter the RunResults folder and find the runresults.html file. Open the file in Internet Explorer to view the results.
LeanFT Jobs run from ALM
- From the dashboard, click on the job.
- Click the Console Output link to view the ALM information.
- Copy the ALM link to your Internet Explorer browser that has access to ALM and view the Test Set results from within ALM. The link will look similar to this:
td://Sandbox.DEFAULT.10.0.2.50:8080/qcbin/TestLabModule-000000003649890581?EntityType=IRun&EntityID=97- The link will take you to the Test Lab in ALM. You may have to drill down into the test sets to find the test and link to report. I have found it easiest to simply click the Test Runs tab then find and click the Run ID (in my link it is 97) to get to the report.
- The link will take you to the Test Lab in ALM. You may have to drill down into the test sets to find the test and link to report. I have found it easiest to simply click the Test Runs tab then find and click the Run ID (in my link it is 97) to get to the report.
- On the Run Details screen, click the Report button then the “LeanFT Run Report” link. The report should open.
Summary
Using the above procedures, you will be able to set up Jenkins to run LeanFT tests, whether they are stored on the file system or in ALM. You will also be able to view the results of the tests.
As mentioned previously, these procedures are basic steps to run tests from Jenkins. Depending on your situation, you may need to change some settings or accommodate for security in your network or test environment.
*Older versions of LeanFT will be branded HPE rather than Micro Focus, so substitute one name for the other in older versions.