kamahade
15 years agoRegular Contributor
Using Setup Script
I have following steps in my Single Testcase.
I'm using Data source to fectch values from DB and feeding to my Create operation
And then doing Groovy script step to verify values fetched from DB
fetching of one of my response value from Create operation and feeding to get operation
Looping above 3 steps through Datasource loop step
Now, I want to create a setup script where I want to intialize DB connection. Since I do not want to open and close DB connection for every of my testcase. I tried placing following piece of code in setup script tab. However, while running my DB_Checker step, UI complains that it could NOT find property sql which is defined in setup script. ANY help will be useful
- Data source
Create operation
DB Checker
Get operation
Datasource Loop
I'm using Data source to fectch values from DB and feeding to my Create operation
And then doing Groovy script step to verify values fetched from DB
fetching of one of my response value from Create operation and feeding to get operation
Looping above 3 steps through Datasource loop step
Now, I want to create a setup script where I want to intialize DB connection. Since I do not want to open and close DB connection for every of my testcase. I tried placing following piece of code in setup script tab. However, while running my DB_Checker step, UI complains that it could NOT find property sql which is defined in setup script. ANY help will be useful
import groovy.sql.Sql;
def MA_UUID;
def ERR_MESSAGE = "DATABASE MISMATCH ";
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
def sql = Sql.newInstance("jdbc:db2://IP_ADDRESS:60000/DB_NAME", "USERNAME","PASWORD", "com.ibm.db2.jcc.DB2Driver");