11 years ago
Changing connection
Hi,
I'm trying to change the connection of a datasource teststep (without the use of environments for specific reasons), but I guess I'm missing a few steps in the process? The script below is executed from within the testsuite's setup script and is supposed to be changing all datasource (teststep) connections to a projectdefined variable that contains the name of one of the projectdefined JDBC Connections. However, the connections remain the same. Should I reload or re-initialize in some way? It might as well be a syntax issue ..
Any help would be very much appriciated!
Regards,
Patrick
[hr:1qio71b6][/hr:1qio71b6]
import com.eviware.soapui.impl.wsdl.teststeps.*
testCaseList = testSuite.getTestCases()
testCaseList.each {
testCase = testSuite.getTestCaseByName(it.key)
datasrcTestSteps = testCase.getTestStepsOfType( com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSourceTestStep.class )
datasrcTestSteps.each {
it.getDataSource().setDbConnectionName("NewConnection")
}
}
I'm trying to change the connection of a datasource teststep (without the use of environments for specific reasons), but I guess I'm missing a few steps in the process? The script below is executed from within the testsuite's setup script and is supposed to be changing all datasource (teststep) connections to a projectdefined variable that contains the name of one of the projectdefined JDBC Connections. However, the connections remain the same. Should I reload or re-initialize in some way? It might as well be a syntax issue ..
Any help would be very much appriciated!
Regards,
Patrick
[hr:1qio71b6][/hr:1qio71b6]
import com.eviware.soapui.impl.wsdl.teststeps.*
testCaseList = testSuite.getTestCases()
testCaseList.each {
testCase = testSuite.getTestCaseByName(it.key)
datasrcTestSteps = testCase.getTestStepsOfType( com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSourceTestStep.class )
datasrcTestSteps.each {
it.getDataSource().setDbConnectionName("NewConnection")
}
}