cancel
Showing results for 
Search instead for 
Did you mean: 

how do you access content of an assertion test step within groovy

Highlighted
Occasional Contributor

how do you access content of an assertion test step within groovy

how do I get/access the content of an assertion test step within groovyscript?

I have the line  

			def ass = it.getAssertions()

This gives me the container

Wed Jun 17 13:51:39 CAT 2015:INFO:assertion: [Contains:com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.SimpleContainsAssertion@9167631]

I've looked at the apidocs, not succesfully at all. From what i know I can't use the messageExchange methods because this is going to sit in the teardown script. I can't even find getAssertions Smiley Sad

3 REPLIES 3
Occasional Contributor

Re: how do you access content of an assertion test step within groovy

this is the best i could do - if anyone could give me a way to not list through (i know its better this way below for a few reasons)

            def ass = ""
            def assList = testRunner.getTestCase().getTestStepByName("${it.name}").getAssertionList()
            for(x in assList)
               {ass = x.getToken().toString()}

 

Contributor

Re: how do you access content of an assertion test step within groovy

.getToken() does not work - her is what I get

groovy.lang.MissingMethodException: No signature of method: Script30.getToken() is applicable for argument types: () values: [] Possible solutions: getClass() error at line: 79.

 

Any idea what else to use to retreive the content of the assertion?

Community Hero

Re: how do you access content of an assertion test step within groovy

What is your use case?


Regards,
Rao.
New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors