Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
14 years ago

Execute test case from load test setup with parameters

Hi -

I have the following code in a load test setup script,

import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext

def genData = loadTestRunner.loadTest.testCase.testSuite.project.getTestSuiteByName('Reusable Test Cases').getTestCaseByName('Generate Applicant Data')
WsdlTestCaseRunner runner = new WsdlTestCaseRunner(genData, null)
log.info("Running test: " + genData.name)
runner.start(true)
runner.waitUntilFinished()


The called test case has some properties that determine how it executes. Is it possible to pass parameters to the test case to modify those values (like the Run TestCase step does?)

Thanks.

2 Replies

  • Hi!

    Sure, you can set your Test Case properties like this:
    genData.setPropertyValue("<name>", "<value>")

    for example:
    genData.setPropertyValue("id", "1254")


    Hopes this helps!

    --
    Regards

    Erik
    SmartBear Sweden
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Doh! I should have realized that. Thanks.

    I ended up modifying the target test case to look for values in context before using the property, then created a context object and passed the value in the Runner constructor.