how to get/set TestStep's property value using javascript in soapUI?

i have tried using Groovy script. the following code is to set property value using roovy script:


"request" is a property of testStep. object is a some value.

when i try above code in javascript but i got following error:

org.mozilla.javascript.ecmaerror: TypeErro: org.mozilla.javascript.ecmaerror Cannot read property "testSteps" from undefined.

So please tell me how to use in using javascript?



answered 6 months ago bhavesh.sarvaiya #1

hurra, i got solution. Please see following code:

var project = testRunner.getTestCase().getTestSuite().getProject();
var testSuite = project.getTestSuiteByName("TestSuite");
var testCasesItr=testSuite.getTestCaseList().iterator();
        var testStepsItr = testCasesItr.getTestStepList().iterator();
            var testStep =;
              // here you can set property
              // testStep.setPropertyValue("request","someValue");



above code will run for all the testcases.

comments powered by Disqus