Ask a Question

Response - Request Nested REST API Calls / Groovy Script fetch parameter from URL

SC
New Member

Response - Request Nested REST API Calls / Groovy Script fetch parameter from URL

Hi, I am new to SOAP UI and Groovy. I am working on a REST API Automation project.

I have a REST API which gives a 'URL' in the response (Response is in XML).

 

Now this URL received in the response is my next API which i am supposed to hit. (Structure of the project is:

Request 1 ---> Response 1(which is my Request 2)

Request 2 ---> Response 2 (which is my Request 3)

 

I have used a groovy script to get the XML node which has the URL in the response.

 

Now the problem is, How do i make next call with this URL? I added another REST test step but it doesn't read the URL.

 

Another solution to my problem can be to fetch a URL parameter from the response URL-

Can anyone help me in groovy script which can fetch a parameter from the URL?

 

I have used: def downloadUrl = context.expand('${REST Request - GetConfig#ResponseAsXml#//data[1]/table[1]/row[1]/@url}')

 

This url is : https://www.google.com/?aaa=111&bbb=222&ccc=33&__dd__=1484088989_b23f248ac6e5d9a9b47475526bb92ee1

 

How can i fetch _dd_ parameter from the URL?

 

Replies awaited.. Cheers 

1 REPLY 1
nmrao
Community Hero

May be it would be easy to understand the issue if the screen shots or small recording.

When you are new, the documentation is the best friend.

http://readyapi.smartbear.com/soapui/rest/start

https://www.soapui.org/rest-testing/getting-started.html


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: