Forum Discussion

Jsyed's avatar
Jsyed
Occasional Contributor
17 years ago

Running test step from groovy and removing that test step.

Hi!
I have successfully created teststep using Groovy. Now i want to know how i can run that and after running remove it from my test steps.

Thanks

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    sure, try

    import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus

    def testStep = .. create your teststep..

    def result = testStep.run( testRunner, context )
    if( result.status == TestStepStatus.OK )
    {
    ...
    }
    else
    {
    ...
    }


    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Jsyed's avatar
    Jsyed
    Occasional Contributor
    I think i didn't explain it properly. Suppose i have following test steps.

    1. Delay
    2. Some Groovy
    3. Properties
    4. Transfer Properties
    5. Some request
    6. Some Groovy
    7. Some request.
    8. some step
    9.
    10.
    I want to add test step in between step 6 and step 7 (code inside groovy at step 6)after that i want to run that step from groovy and then remove it from the test step list.

    I hope this explains my situation better. I was able to create test step but i want to know how i can place that in between step 6 and step 7.

    Thanks
  • Jsyed's avatar
    Jsyed
    Occasional Contributor
    Hi!
    Don't worry about it. I figured it out how to do it.

    Thanks