Forum Discussion

Buschfunk's avatar
Buschfunk
Frequent Contributor
14 years ago

Change request properties globally with scripting

Hello,

I need to write a "setup script" which initializes the test suite with certain property values. To be more precise, the script shall get all test steps of type "Request" and

  • set the endpoint to a certain value

  • set the SSL keystore to a certain value


So far, this is what I got:

def testSuites = testRunner.testCase.testSuite.project.getTestSuiteList()
testSuites.each {
def testCases = it.getTestCaseList()
testCases.each {
def requests = it.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep)
// TODO: Set endpoint and SSL keystore
}
}

However I cannot find the correct methods for doing this.

Sincerely,
weeman

1 Reply

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    If all the endpoints are set to the same value, why not just use a project-level property and reference this in the request endpoint (e.g. ${#Project#endpoint} ). Then you just have to change that property rather than all the requests.