Dynamically create query parameters to get request in ReadyAP
As per my requirement need to create single test case for multiple endpoints and pass different query parameters for each endpoint in the iteration. I followed Data driver framework to achieve it but, here I am facing issue while setting dynamic parametres to different end points in each iterations.
Solved! Go to Solution.
dynamically generating REST query parms seems to have popped up several times on the board in the last 6 months or so.
Please see this link - in the link someone else was asking about this a while back and @nmrao put a groovy script to do this. There is also a feature request asking for the ability to dynamically populate the query parms - the link to this feature request is also included via the link - suggest you add an upvote - the more votes it gets, the more likely SmartBear will consider adding it into the OTB functionality.
I also had the same issue a couple of months before the previous link was raised on the forum - I raised a service request and eventually SmartBear provided me the following:
1. Modify the request as shown in the screenshot: https://1drv.ms/u/s!AtuBNgWQsBvDgYo3igoN8Xngs-wUhQ [https://1drv.ms/u/s!AtuBNgWQsBvDgYo3igoN8Xngs-wUhQ]
All the query parameters are passed as a value of a single dummy template parameter that seems to give the correct request in the result: https://1drv.ms/u/s!AtuBNgWQsBvDgYo4SC0gbfYYNrQj_w [https://1drv.ms/u/s!AtuBNgWQsBvDgYo4SC0gbfYYNrQj_w]
2. User a groovy script that produces a string of query params and their values and returns it: https://1drv.ms/u/s!AtuBNgWQsBvDgYo5ZKnigE64mSf2wg [https://1drv.ms/u/s!AtuBNgWQsBvDgYo5ZKnigE64mSf2wg] Then, refer to the script result from the parameter's value: https://1drv.ms/u/s!AtuBNgWQsBvDgYo63NVVLRPgkufTzg [https://1drv.ms/u/s!AtuBNgWQsBvDgYo63NVVLRPgkufTzg]
It appears that this is a common problem for the engineers who test / automate the REST Services as it is repeatedly seen in the forum. Is it possible to push for feature enhancement ? Also possible for Knowledge Base article with the original answer for quick access?
I've sent a request to our team to consider creating a KB article. Thanks for drawing our attention to this topic, @nmrao.
SmartBear Community and Education Manager