Ask a Question

How to use result of test step in next step

aneurysm
Occasional Contributor

How to use result of test step in next step

Hi, how can I get result of gRPC request from one test step and use it in next test step in the same test case (compare result of two test steps following)? GUI or groovy script.

1 REPLY 1
nmrao
Champion Level 3

How does the response look like? Sample would help to understand.

 

Of course, one can read the response of any test step(s) in groovy step

 

import com.eviware.soapui.impl.wsdl.teststeps.*

// Get the gRPC request test step - change if the step name is different
def grpcStep = testRunner.testCase.getTestStepByName("gRPC Request")

// Get the gRPC response message
def grpcResponse = grpcStep.testRequest.responseContent

// Parse the response message as a byte array
def responseBytes = grpcResponse.getBytes()

// Deserialize the response message using Protocol Buffers
def responseMessage = MyProtoMessage.parseFrom(responseBytes)

// Print the response message
log.info "Response message: $responseMessage"

 



Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: