cancel
Showing results for 
Search instead for 
Did you mean: 

How to add oracle row record in properties test step as key value pair in Soap UI tool

SOLVED
Highlighted
Occasional Contributor

How to add oracle row record in properties test step as key value pair in Soap UI tool

In Soap UI, I am able to connect oracle database using groovy 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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Leader

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

@sparrowenclave :

 

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 🙂


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

Highlighted
Community Leader

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

 

@sparrowenclave :

 

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 🙂

 

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

6 REPLIES 6
Highlighted
Community Hero

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

Hey @sparrowenclave,

You can use the property transfer functionality to transfer a value/values to a Properties step so you can pass it onto next step for either use or assertion.

Check out: http://soapui.org/docs/functional-testing/properties/transferring-properties

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Community Leader

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

@sparrowenclave :

 

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 🙂


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

Highlighted
Community Hero

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

You can directly assert using script assertion without needing to have additional steps.


Regards,
Rao.
Highlighted
Community Hero

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

@nmrao,

Oooh! Super efficient. I didnt think of that! 😉

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Occasional Contributor

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

Hi Himanshu,
Agreed with the solutions.Thanks for the reply. I have another concern on the same issue but I am not sure whether I asked this in the question or ask a new question.
Can you please suggest ?
Highlighted
Community Leader

Re: How to add oracle row record in properties test step as key value pair in Soap UI tool

 

@sparrowenclave :

 

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 🙂

 

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors