Forum Discussion
SmartBear_Suppo
Alumni
12 years agoHi,
There is currently a workaround posted here, viewtopic.php?f=13&t=20577.
Add this to event handler TestRunListener.beforeRun.
Regards,
Marcus
SmartBear Support
There is currently a workaround posted here, viewtopic.php?f=13&t=20577.
Add this to event handler TestRunListener.beforeRun.
// Get first databaseName.
databaseName = context.testCase.testSuite.project.activeEnvironment.databaseConnectionContainer.getDatabaseConnectionAt(0).getName()
// Get connectionString of active environment.
connectionString = context.testCase.testSuite.project.activeEnvironment.databaseConnectionContainer.getDatabaseConnectionByName(databaseName).getConnectionString()
// Iterate all test steps in the test case and change connectionString for all ProJdbcRequestTestStep to the selected environment connectionString.
for(testStep in context.testCase.getTestStepList())
{
// Set the connectionString for all ProJdbcRequestTestStep
if(testStep instanceof com.eviware.soapui.impl.wsdl.teststeps.ProJdbcRequestTestStep)
{
testStep.setConnectionString(connectionString)
}
}
Regards,
Marcus
SmartBear Support