Jenkins is a continuous integration server which creates the build and deploys on the environment. It can also be used as a scheduler where you can schedule your test and build process in a nightly fashion.
Jenkins can also help you achieve code quality by integrating with tools like selenium and SoapUI. Based on the results of the test runs, action could be taken to improve the current build.
As we know what Jenkins is, let's see how it can be integrated with testing tools. But before that let's see how to setup Jenkins.
Setting up Jenkins on your local machine:
.war
file from: https://updates.jenkins-ci.org/download/war/.war
files are downloaded, open a command prompt and enter the following command:Java –jar "Path of WAR file"
http://localhost:8080/
.The preceding screen proves that we have successfully installed Jenkins on a Windows machine.
Now as we have installed Jenkins on the machine let's see how we integrate SoapUI with it:
In the preceding screen you can add the description of the project.
After we have added the source code repository details, your repository is in sync with your tool.
You also have certain other build options which can be useful in configuring your build:
After you have configured your build options, you have now learnt how to integrate your codebase with Jenkins. Now is the time for integrating the test tools.
If you see in the following screenshot, we have several options to add a build step:
Using Ant: We have in previous chapters seen how can we create a build.xml
file to execute and generate reports for our Test automation suites. We can use the same build.xml
file and the same shall work for us.
<arg line= "-j -f 'c:projectSoapUITest ' ' like c:/project/SoapUITest like c:/project/SoapUITest /Production.xml'"/> </exec> </target> <target name = "testreport" depends ="soapui"> <junitreport todir="C:/Users/pnandan/Desktop/Analysis/NewFolder"> <fileset dir="C:/Users/pnandan/Desktop/Analysis/NewFolder"> <include name="TEST-TestSuite_1.xml"/> </fileset> <report todir="C:/Users/Admin / Analysis/Reports /HTML" styledir="C:/Testing/apache-ant-1.9.6/etc" format="frames"> </report> </junitreport> </target> </project>
The second option we have is to invoke a batch file. We can use the command line functionality of SoapUI to create a batch file which executes the project:
Commandline utility of soap UI Sample Batch file: cd C:Program FilesSmartBearsoapUI-4.0.1in testrunner.bat -ehttps://192.90.190.19:7001/test?wsdl -sTestSuite -r -a -fC:UserspnandanDesktopatchsoap -I "C:UserspnandanDesktopatsoapsoapuitestproject.xml"
Use the batch file and enter the details of the configuration of your project and name it with an extension .bat
.
Once you have done that you can pass the reference in the Execute Windows batch command option displayed in the preceding screenshot.
Now to integrate it using the same batch file, you just need to add the batch file content to the execute Windows batch file command, as shown in the following screenshot.
The following screenshot shows how you can add the batch file and run SoapUI from Jenkins:
Let's also have a look at the command line options available:
a
: Returns all test results, not only errorsA
: Returns results using folders instead of long namesc
: This can be used to select the specified test cases to be runD
: Sets system property with name=value
d
: The domain to use in any authentications, overrides any domain set for any TestRequests
e
: Sets the endpoint to be usedf:
Specifies the root folder to which test results should be exportedG
: Sets global property with name=valueh
: The host:port
to use when invoking test-requests
, overrides only the host part of the endpoint set in the project fileI
: Do not stop if error occurs, ignore themi
: Enables SoapUI UI-related componentsj
: Turns on exporting of JUnit-compatible reportsM
: Creates a Test Run Report in XML formatm
: Sets the threshold value for test step errors P
: Sets project property with name value pairp
: The password to use in any authenticationr
: Turns on printing of a small summary reportS
: Sets to save the project file after tests have been runs
: Used to select the test suite to runt
: Sets the soapui-settings.xml
fileu
: The username to use in any authenticationv
: Sets password for soapui-settings.xml
filew
: Sets the WSS password typex
: Sets project passwordSo now we have seen two possible ways to integrate SoapUI or any other tool with Jenkins using Ant and a batch file.
Once we are done with integrating the tool now is the time to see what can be done post-test case execution.
Once you have done the execution step you may want to decide to perform additional steps. For that you have options in Add post-build action.
Let's have a look at some of the options that can be useful to us:
This gives us a view of end to end use of Jenkins with respect to integration with SoapUI.
With the Test Automation phase of Software Testing Life Cycle showing tremendous increase in the ROI, project leaders want to get more and more out of it, which has laid the foundations of more areas which can be covered as part of test automation.
Tracking the results of the Test automation runs has always been a tedious job, it is very important to keep track of such metrics since they can be used to track the build cycle automation suite performance, defect metrics, and so on.
So to avoid manual effort of updating the test results in Test management tools, testers have come up with innovative solutions to automate the process of updating the test management tools with the test automation results status.
Updating of Test results can be triggered from the Automation suite as well as from the Test management tool as shown in the figure preceding.
So, in the Test Management Tool, when you run any test case it runs the Test Automation suite and updates QC automatically. Or, if you run the Test Automation suite it updates the test case status in QC automatically.
So let's see how we do that.
Let take a look at the top two test management tools on the market:
For JIRA plugins visit https://github.com/SmartBear/ready-jira-plugin
Dragonfly is the answer to the question; how do we integrate QC with SoapUI? so let's see how we update QC with Automation test cases results automatically and vice versa.
http://www.agiletestware.com/dragonfly
While installing Dragonfly, please provide the directory to be installed as the bin
directory of SoapUI.
QC_URL
QC_Domain
QC_Project
QC_User
QC_Password
QC_TestPlanDirectory
QC_TestLabDirectory
QC_soapUI_ARGS
QC_Bulk Update
QC_Run Name
QC_ProjectPath
QC_Export_Disabled_Tests
QC_Dragonfly_Plugin
Before that, create a project in SoapUI and right click on the project level in SoapUI and you can verify that the options for the Dragonfly plugins are now available.
Now if you select any of the features, for example Export to HP ALM you will see the following screen:
Which will make sure that the test is now created in HP QC.
With this we have come to the end of this chapter. Let's see the summary section to see what have we covered in this chapter.
18.218.187.108