Forum Discussion

stega's avatar
stega
Contributor
12 years ago

Run TestStep with request parameter

Hi All,

My question is, how can i run rest method with template parmater by groovy script.
I can run methods without paramters (below), but i haven't found solution for the parameters. I have a method which needs a template parameter, called "id" and gives back the specified record.

testRunner.testCase.testSuite.getTestCaseByName("TestCase").getTestStepByName("TestStep").run(testRunner, context).getResponseContent();
  • I've found the solution:
    testRunner.testCase.testSuite.getTestCaseByName("TestCase").getTestStepByName("TestStep").getProperty("id").setValue(maxid);
    responseContentUpdate = testRunner.testCase.testSuite.getTestCaseByName("TestCase").getTestStepByName("TestStep").run(testRunner, context).getResponseContent();