Forum Discussion

RaMup29's avatar
RaMup29
Occasional Contributor
7 years ago

Groovy Script for stopping the testSteps after User selection

Hi All,

 

I am looking for a Groovy script to ask the user to Conti next steps or stop it?
if the user selected yes (Conti) then next steps need to be executed, if no (stop) then it should cancel the execution of testSteps.

 

4 Replies

  • JHunt's avatar
    JHunt
    Community Hero
    import com.eviware.soapui.support.UISupport
    if (!UISupport.confirm("Continue?", "Shall we...")) {
        testRunner.cancel("User doesn't want to continue")
    }

    Documentation for UI elements is here:

    http://www.soapui.org/apidocs/com/eviware/soapui/support/UISupport.html

     

    If you want the test to be considered failed then instead of testRunner.cancel, use:

    testRunner.fail("User doesn't want to continue")
  • nmrao's avatar
    nmrao
    Champion Level 3
    That will be come hurdle if you wanted to achieve un-attended execution of automated tests.

    What is your use case, by the way?
    • nmrao's avatar
      nmrao
      Champion Level 3
      RaMup29, consider marking the question as "Accept as Solution" if you think that is the best answer and addresses your problem.