Forum Discussion

Patil86's avatar
Patil86
Occasional Contributor
11 years ago

How to change test request step operation

Hi ,

I need to change the interface operation of soap requests , I know to change using - Right click on test request and selecting "Change Operation " option.
Is there any a way to do the same using Groovy?

Scenario: I have soap test requests with interface operation say GetLocation and i want them to be changed to GetGeoLocation using groovy step.


Thanks in Advance
Patil
  • Cizo89's avatar
    Cizo89
    Frequent Contributor
    Hi,

    please, try this script, it should work for you:

    def changeTo = testRunner.testCase.testSuite.project.interfaces["Soap Interface 1"].operations["GetGeoLocation"]

    testRunner.testCase.testSteps["Soap Test Step 1"].getTestRequest().setOperation(changeTo)


    Regards,
    Marek
  • Patil86's avatar
    Patil86
    Occasional Contributor
    That worked perfectly ..
    Thanks you very much Mares