I have a gradle script to execute one one SOAPUI test suite. Currently the failed logs are coming in the same folder. I want to get all of the pass and failed logs to be created in separate folder. I want to have a index.html like report too to see the execution pass/fail reports. Does it create any testsuite.xml that stores the passed and failed data of each testcase like ANT? I am not familiar with gradle. So I need a good gradle script that can help me out of this. My current gradle script is given below that executes only one test suite:
class SoapUITask extends Exec {
String soapUIExecutable = '/SOAPUIpath/SoapUI-5.1.2/bin/testrunner.sh'
String soapUIArgs = ''
public SoapUITask(){
super()
this.setExecutable(soapUIExecutable)
//printReport=true
}
public void setSoapUIArgs(String soapUIArgs) {
this.args = "$soapUIArgs".trim().split(" ") as List
}
}
// execute SOAPUI
task executeSOAPUI(type: SoapUITask){
// simply pass the project path as argument,
// note that the extra " are needed
soapUIArgs = '/path/of/SOAPUI project xml/src/PCDEMO-soapui-project.xml'
}
If you want to generate and HTML report from SOAPUI documentation you can use the follow parameters:
Note: As you can see on documentation the
-F
parameter only works for PRO version. If you use the free version when you try to use-F
parameter you'll get the follow ouput:org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -FPDF
So you can modify
task executeSOAPUI
to add-f location
and-FHTML
as follows:If instead you are expecting a Junit Html style report you can try with the follow parameter (which is also only available in PRO version):
Using this your
task
could be:Disclaimer: I don't have a PRO version so I can't test any of the options I give in the answer.
I post this answer as a separate POST because I think that it's a good option for who doesn't have a PRO version, and good enough to have their space.
So the possible alternative is to generate the Junit Xml report files and then generate the Html using the Xml report and Xslt transformation.
To generate the Junit Xml report you can use the
-j
parameter, and also-f
to specify the folder.And then you can create a gradle task to perform the XSLT transformation (my solution is based on this solution on github).
So your
build.gradle
could be:Then you can invoke
gradle executeSOAPUI
and your JUnit Html report will be generated onpath/of/outputReports/html/
folder.Hope it helps,