More correct assertion of testcase
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
More correct assertion of testcase
I use a groovy script to cancel (or abort) the test execution (if some precondition is satisfied):
// test step "SendSellOrderVerifyRequest" is a setup/precondition of the testcase.
def rspHeader = context.testCase.testSteps["SendSellOrderVerifyRequest"].testRequest.response.responseHeaders
if (! rspHeader["#status#"].contains("HTTP/1.1 200 OK")) {
context.testRunner.cancel("TestCase cancelled, because ...... ")
}
This gives the test case "Cancelled" result in ReadyAPI, as well as in the test log:
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@fwseb wrote:
This gives the test case "Cancelled" result in ReadyAPI, as well as in the test log:
2021-03-23T13:51:45.4138758Z 14:51:45,399 INFO [SoapUIProTestCaseRunner] Finished running TestCase [xxxxxx], time taken: 1259ms, status: CANCELED
Does this work when the same project is called / execute from command-line using testrunner utility?
NOTE: No-voice in Azure pipeline.
By the way, what command do you use in Azure pipeline to execute the project?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't tried to run the test project by command line myself, but the command line that is used in pipeline is:
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you see the same behavior if you run the command locally to execute the project?
Regards,
Rao.
