Forum Discussion

sukanya's avatar
sukanya
Contributor
6 years ago

SoapUI Pro

Hi,

 

How can I run a request using groovy script without using testRunner.runTestStepByName("Request").

Is there any other alternate way?

 

Thanks

10 Replies

  • Lucian's avatar
    Lucian
    Community Hero

    Your topics would attract more viewers if you would name them more suggestive. The title 'SoapUI Pro' doesn't tell anything about what your problem is. 

     

    Nevertheless, why do you need to run a step (and not a request as you said btw...) by using another method?

    • sukanya's avatar
      sukanya
      Contributor

      I am having two test steps. I want to read the first response and run the second test step and read the response from there.

       

      I want to do this under test step1 script assertion part.

      Please do the needful on this.

  • Two Ways I am providing here depending upon your requirement you can pick any.

     

     First way:

    def tsbus=testRunner.testCase.testSuite.testCases["Business"]

    tsbus.getTestStepByName("PortPsVerification").run(testRunner, context)

     

    Second Way: 

    testRunner.runTestStep(pro.testSuites['Project Scripts'].testCases['Project Scripts'].testSteps['Soap Request Execution and Validation']) 

     

    I hope this is what you are looking for

     

    Thanks,

    Himanshu

    • sukanya's avatar
      sukanya
      Contributor

      I want that to be done under test step1 script assertion part where testRunner cannot be used.

      • shubhimu's avatar
        shubhimu
        Contributor

        yeah testRunner won't be available there.

         

        I dont think there will be any option to run your step from script assertion.

         

        Thanks,

        Himanshu