Ask a Question

How do I extract REST query parameters and access them via a Groovy Script

SOLVED
MikeDally
Contributor

How do I extract REST query parameters and access them via a Groovy Script

Hi guys,

 

I have the following REST request, whereby I am submitting 2 query values. I want to use these values in a Groovy script which will be used to connect to a database later in my tests.

 

GET http://<host>/<path>?postcode=LS1%2000EY&ProductList=10006541

I basically want to extract the postcode and ProductList values.

 

Any idea on how to do this? I've not found much online around this.

 

Many thanks,

 

Mike

 

1 REPLY 1
MikeDally
Contributor

Update: I was able to do this simply by entering:

 

context.expand(${postcode})
context.expand(${ProductList})
cancel
Showing results for 
Search instead for 
Did you mean: