Ask a Question

The capability to abort entire test execution through groovy

The capability to abort entire test execution through groovy

It would be beneficial to be able to abort an entire test execution gracefully through groovy.

 

In my case I have an async operation that I kick off, delay a small period, check the status then iterate around that for a defined number of retries before deeming it a pass/fail.

 

In certain cases it does not make sense for me to continue the test suite/entire test run in certain circumstances and I'd like to be able to issue an abort through groovy in this situation.

 

Hopefully feature request gains traction with community.

Thanks in advance.

Ken.

7 Comments
groovyguy
Community Hero

I can definitely see the use in this, that if a certain condition is met to be able to automatically stop the tests. This could be a really useful feature available to trigger via groovy. 

sanj
Super Contributor

If its groovy does it need to be a feature request or can we just come up with a solution.

 

groovyguy
Community Hero

There is no solution currently available even with groovy, @sanj. There's no way to tap into the API of ReadyAPI itself to stop executions. In the original thread, this was confirmed with ReadyAPI engineers. 🙂 

sanj
Super Contributor

@groovyguy Thanks for the confirmation 🙂

Since that is indeed the case then agreed

 

 

GillerM
Staff

Have you tried the following code:

testRunner.cancel( "I'm getting tired" )

if you want to fail it use
testRunner.fail( "It didn't work" )

kenm
Contributor

Hi @GillerM I'm afraid that only cancels or fails the current test case in operation and resumes with the next testcase. My desire is to abort the entire execution of ALL testcases which this does not work.

rajs2020
Frequent Contributor

It would be nice to have this feature. But, I wonder if you could use a variable flag to tell other tests to fail. A groovy script could be used to check the flag and act on it.

Side note - The java library TestNG has Assert.fail() which allows you to do this. Unfortunately, you'll have to write all tests in programming language.

https://sqa.stackexchange.com/questions/2044/testng-mark-a-test-as-failed-if-a-particular-path-is-us...

 

Announcements
Welcome to the ReadyAPI Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Welcome to the Community
Sign Up Here