cancel
Showing results for 
Search instead for 
Did you mean: 

How to make multiple Rest Requests with different properties each time?

Highlighted
New Contributor

How to make multiple Rest Requests with different properties each time?

 

I am very new to Groovy Script and SoapUI and facing a lot of problems.

 

So I wanna make a Rest Request with different values each time.

I have two properties

Property 1: h[0]=1,2

Property 2: h[0]= 3,4

 

So I wanna make a Rest Request first with Property 1 and once its complete , there should be another rest request with Property 2.

I am trying to us runTestStepByName in groovy script but still struggling.

 

Can somebody help?

2 REPLIES 2
Highlighted
Moderator

Hi,

 

I believe the best way to do this is to use data-driven testing with a datasource and datasource loop.  Please see the below documentation link on how to do data driven testing.

 

http://readyapi.smartbear.com/soapui/data_driven/tutorial/intro/start

 

If you can not use any external file or storage then a Groovy datasource may be the best datasource to use for this scenario.

 

http://readyapi.smartbear.com/structure/sources/groovy/start

 

Regards,

Marcus

SmartBear Support



Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
New Contributor

This is actually what I am trying to do

 

 

So I am able to fetch the data from mysql db using jdbc request. I get the data and I process and store it as properties. So Property 1: h[0]=1,1&h[1]=2,2&h[2]=3,3& Property 2: h[0]=4,4&h[1]=5,5&h[2]=6,6& Property 3.. Property 4..

These are the rest request config:

Style: Query Level: Resource Value: I get data from the property using ${Properties#Property 1}

Now I want to run the same rest request for all the properties

So it should be like

http://xxxxxxx/api/h[0]=1,1&...h[2]=3,3
http://xxxxxxx/api/h[0]=4,4&...h[2]=6,6
http://xxxxxxx/api/h[0]=7,7&...h[2]=9,9
http://xxxxxxx/api/h[0]=10,101&...h[2]=12,12

Tags (2)
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors