So here is something interesting. When the test runs those assertions don't take as long as if I edit the assertion after a run.
I updated the previous assertion to groovy and it still takes a really long time after an edit.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def responseHolder = groovyUtils.getXmlHolder(messageExchange.responseContent)
Boolean flag = true;
// Count all form name tags
int formNamesCount = Integer.parseInt(responseHolder.getNodeValue("count(//a:Coverages[1]/a:Coverage/a:Form/a:Name)"))
//Count all the forms with a match to give names from relevant test suite property
def formName = context.expand( '${#TestSuite#FormName3}' )
int formNamesCount2 = Integer.parseInt(responseHolder.getNodeValue("count(//a:Coverages[1]/a:Coverage/a:Form/a:Name[text() ='" + formName + "'])"))
if((formNamesCount != formNamesCount2) || (formNamesCount<=0)){
flag = false
}
assert flag
So the steps to recreate this is the following:
- I run my test step, this will execute all the assertions that I have and it doesn't take super long.
- I find the one assert to change based on something I see in the response to update.
- I open the XPath Match or, now updated, Script Assertion.
- I edit whatever and click the test button, it responds quickly.
- Now when I do one or the other I get the long delay.
- XPath Match - clicking SAVE it will hang the screen until it's finished.
- Script Assertion - clicking OK it will return to the Assertions listing but SoapUI is completly locked until it's finished.
So the main question is what is different from the run or clicking the test button, to the actual saving of the assertion, whichever it is.
Hopefully this explains the issue best. I was hoping the Groovy script was the answer.
If you see anything in the code I can change to improve it I'm all ears. :smileywink: I appreciate all the feedback!
Thanks!