AnandKiran
17 years agoFrequent Contributor
Verify data after the transaction has been commited!
Hi Ole,
I came acrross this post which i was browsing through the forum ,I have stored some values from my test to database and i want to verify the data after transaction.... I want to do this with the help of groovy .
Using the below script i have stored the results in DB
import groovy.sql.Sql
Xvalue = testRunner.testCase.getTestStepByName( "Add_inputs" )
Yvalue = testRunner.testCase.getTestStepByName( "Add_inputs" )
Zvalue = testRunner.testCase.getTestStepByName( "DataSink" )
X= Xvalue.getPropertyValue( "x" )
Y= Yvalue.getPropertyValue( "y" )
RESULT= Zvalue.getPropertyValue( "result" )
sql = Sql.newInstance("jdbc:mysql://localhost:3306/anand", "root", "evipass", "com.mysql.jdbc.Driver")
sql.execute("insert into DATA (x, y,result) values (${X}, ${Y},${RESULT})")
One thing i can do is go to my DB and check out manually whether results are stored properly or not. But if there are n no of rows and columns how do we do it with the help of groovy
I came acrross this post which i was browsing through the forum ,I have stored some values from my test to database and i want to verify the data after transaction.... I want to do this with the help of groovy .
Using the below script i have stored the results in DB
import groovy.sql.Sql
Xvalue = testRunner.testCase.getTestStepByName( "Add_inputs" )
Yvalue = testRunner.testCase.getTestStepByName( "Add_inputs" )
Zvalue = testRunner.testCase.getTestStepByName( "DataSink" )
X= Xvalue.getPropertyValue( "x" )
Y= Yvalue.getPropertyValue( "y" )
RESULT= Zvalue.getPropertyValue( "result" )
sql = Sql.newInstance("jdbc:mysql://localhost:3306/anand", "root", "evipass", "com.mysql.jdbc.Driver")
sql.execute("insert into DATA (x, y,result) values (${X}, ${Y},${RESULT})")
One thing i can do is go to my DB and check out manually whether results are stored properly or not. But if there are n no of rows and columns how do we do it with the help of groovy