How to use result of test step in next step
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023
03:50 AM
02-20-2023
03:50 AM
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.
Labels:
- Labels:
-
Function Tests
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023
06:52 AM
02-22-2023
06:52 AM
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.
