cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get the operation name at the groovy script?

SOLVED
Highlighted
Occasional Contributor

Can I get the operation name at the groovy script?

Hi,

 

Can I get the operation name at the groovy script?

What's command do I use?

 

 

 

 

2019-06-26 12_07_23-SoapUI 5.0.0-m-SNAPSHOT.pngOperationName.png

Regards,

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Can I get the operation name at the groovy script?

@wichitk 

 

Try

mockResponse.operation.name


Regards,
Rao.

View solution in original post

6 REPLIES 6
Super Contributor

Re: Can I get the operation name at the groovy script?

With reference to screenshot, I can understand that you want to read the property Value which is "CustomerProfileInq". if it is, then you can use below code:-

testRunner.testCase.testSteps['RequestName'].getPropertyValue("Name")

Where you need to create a testStep as "RequestName".

Occasional Contributor

Re: Can I get the operation name at the groovy script?

Hi @avidCoder ,

 

I'm working at the mock service (Mock Response).

It doesn't work.

I applied your code and it returns: 

 

com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; groovy.lang.MissingPropertyException: No such property: testRunner for class: Script33

Is it can be used the testRunner on the MockResponses?

 

Regards,

Dan

Super Contributor

Re: Can I get the operation name at the groovy script?

Not sure.. here.  @nmrao - Could you please suggest?

Community Hero

Re: Can I get the operation name at the groovy script?

@wichitk 

 

Try

mockResponse.operation.name


Regards,
Rao.

View solution in original post

Occasional Contributor

Re: Can I get the operation name at the groovy script?

Hi,

 

I changed the code to:

log.info("Name: "+mockOperation.operation.name)

It worked!!.

 

Regards,

Dan

Community Hero

Re: Can I get the operation name at the groovy script?

Appreciate to respect the original answer while marking solution.

log.info is to show the actual value of the object.


Regards,
Rao.