Forum Discussion

ME_Bank_Support's avatar
ME_Bank_Support
Occasional Contributor
11 years ago

Test Step Result

hello

I am creating a health check test suit for a test environment. I created the test suit and its working fine. Now i want to put the results into a Excel sheet and send an email automatically. the only problem i am facing for this is how to capture a Test step result in a property so i can easily use the property in Data sing to print it in an Excel sheet. Say i got a 2 assertions for every test step in the suit and those assertions will decide whether the particular step failed or passed i know we can say it easily by looking at the color green and red but i want to capture it in a property and print it on a excel using Data sink. Can some one help me in how to know whether a test step is pass or fail in run time and store the result in a property.
  • Hi,

    Please see this article: http://www.soapui.org/Scripting-Propert ... -datasinks
    In section 2.1, the 2nd example shows how you can retrieve the response of a test request using property expansion that you can build using the right-click functionality "Get Data..."

    Below is an example you can use to iterate through the applicable assertions that you need to check and build your logic to save the response as applicable:

    def testcase = testRunner.testCase
    for (i in testcase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep )){
    for( assertion in i.assertionList )
    {
    log.info "Assertion [" + assertion.label + "] has status [" + assertion.status + "]"
    }
    }


    Regards,

    Giscard
    SmartBear Support