then I fetched one record from the table.Now I wanted to know how we can set the record as key value in properties test step.
So I can assert the record in next script
then I fetched one record from the table.Now I wanted to know how we can set the record as key value in properties test step.
So I can assert the record in next script
I am hoping that you are doing same as below
import groovy.sql.Sql;
//Establish JDBC Connection to the DB
def con = Sql.newInstance(“jdbc:oracle:thin:@<url server database>:<port>:<sid>”, “username”, “password”, “oracle.jdbc.driver.OracleDriver”);
def response = con.rows(“select * from employee”)
//storing name in variable
def name = response[0].name.toString()
//setting name record in properties test step
testRunner.testCase.getTestStepByName("Properties").setPropertyValue("emp_name",name)
//closing DB Connection
con.close()
Hope it will help you in resolving your issue 🙂
If the answer to the question is resolved in this question then it will advisable to ask new question in new thread, also you can ask in this too 🙂
I am hoping that you are doing same as below
import groovy.sql.Sql;
//Establish JDBC Connection to the DB
def con = Sql.newInstance(“jdbc:oracle:thin:@<url server database>:<port>:<sid>”, “username”, “password”, “oracle.jdbc.driver.OracleDriver”);
def response = con.rows(“select * from employee”)
//storing name in variable
def name = response[0].name.toString()
//setting name record in properties test step
testRunner.testCase.getTestStepByName("Properties").setPropertyValue("emp_name",name)
//closing DB Connection
con.close()
Hope it will help you in resolving your issue 🙂
If the answer to the question is resolved in this question then it will advisable to ask new question in new thread, also you can ask in this too 🙂