Forum Discussion

kenm's avatar
kenm
Contributor
6 years ago

How to abort ALL current running testcases via Groovy

Good morning fellow SoapUIers,

 

Is it possible to abort the current entire execution via a groovy script?

 

In my tests I basically have an async operation in setup I need to wait for it to complete and it'll retry a defined number of times before it's deemed a failure. What I would like to do, in the even that this fails, is abort the entire execution rather than pushing onto the subsequent test cases/test suites.

 

Is this possible. I just see testRunner.fail and testRunner.cancel available to me which both won't do what I require as I understand?

 

Appreciate any help in advance.

Thanks guys,

Ken.

10 Replies

  • groovyguy's avatar
    groovyguy
    Champion Level 1

    I am not 100% aware there's a way to do this. You would have to find a way to mimic the pressing of the "Stop" button on the GUI. There's probably a way, but you would have to read up on the GUI/API documentation for ReadyAPI itself. I'll take a look when I get a chance to see if I can find anything.

    • kenm's avatar
      kenm
      Contributor

      Thx for your response... I've had a quick run through the API documentation and in the context of TestRunner you can fail the test step or abort the testcase execution via Groovy however you don't seem to be able to do "more".... e.g. abort the Test Suite execution or, what I'm after, abort the entire execution at that point of time.

       

      I've a sneaking suspicion it's not possible?

  • Olga_T's avatar
    Olga_T
    SmartBear Alumni (Retired)

    kenm, have you finally found a way how to abort the entire execution?


    Community, maybe, does anyone have a guess how to do this?

    • groovyguy's avatar
      groovyguy
      Champion Level 1

      I've been reviewing the ReadyAPI APIDOCS and do not see a way to trigger a test suite / test case to be forced to stop processing. 

      • kenm's avatar
        kenm
        Contributor

        Thanks guys... I really appreciate your time on this!,

         

        I'm afraid I haven't figured out a solution and I don't believe there is a mechanism to do cleanly through groovy. If the process has permission to kill itself I'm sure I could do it but SoapUI isn't going to exit cleanly and I doubt will produce reports etc. on completion.

         

        Perhaps a change request/enhancement for SmartBear?

  • Olga_T's avatar
    Olga_T
    SmartBear Alumni (Retired)

    kenm, I have contacted our support engineer to check whether there is really no way to accomplish your task from SoapUI now, and, unfortunately, it looks like it is so. And, the only way to do this now is, as you said, to kill the process itself, maybe with a third-party tool.


    So, yes, you can make the appropriate feature request by the link that Matthew has provided so that our Product Team could consider this feature implementation. Other users can then vote for it to increase its rating.


    In the meantime, if you find some suitable solution, please share it with us! Thank you in advance.