Forum Discussion

CSC_Financial_S_2's avatar
CSC_Financial_S_2
New Contributor
12 years ago

Conditional logic for XPath Assertion

I have a testcase that is data driven from an excel spreadsheet. When setting up the assertions, my response message may or may not have a specific element returned. I want to be able to set up something as follows:

If element (middle name) exists in the response
Then do an XPath comparision from the response to what is in the excel spreadsheet
Else
Do nothing
End If

Is there a way to do this in soapUI. If the answer is to use a groovy script, can you provide an example because I am no familiar with groovy scripting.