1

In Qmetry, I have placed api request data in requests.wsc file. For example in the below api request- want to update 'baseUrl' key value from 'https://google.com' to 'https://stackoverflow.com' through qmetry method/ or programmatically.

api request content in requests.wsc file:

get.sample.call={'headers':{'Accept':'application/xml'},'baseUrl':'https://google.com','method':'GET','query-parameters':{},'form-parameters':{},'body':''}

Can any one help me on achieving this within qmetry or any other way? Thanks!

sanjay pujari
  • 459
  • 2
  • 7
  • 23
  • Where and how you are using this request call? Can you provide that details? You can parameterize and provide values when you are actually using it. – user861594 Mar 03 '21 at 16:10
  • Hi, In feature file , calling api as - user requests 'get.sample.call' . Please let me know how can I update values through parametrization . any example will be very helpful! – sanjay pujari Mar 03 '21 at 17:40
  • @user861594, how to use this step - user requests {request} with data {data} . how to pass data here? any example will help. – sanjay pujari Mar 05 '21 at 15:48

1 Answers1

0

Refer documentation of Request Call Repository. You should use parameters and parameter-resolution done at the time of execution. For example:

get.sample.call={'headers':{'Accept':'application/xml'},'baseUrl':'${env.baseurl}','method':'GET','query-parameters':{},'form-parameters':{},'body':''}

user861594
  • 5,733
  • 3
  • 29
  • 45
  • Thanks it worked!. I used step as - user requests {'get.sample.call'} with data {'env.baseurl'= "https://stackoverflow.com"} . I also want to update multiple values. For ex: want to update values of baseurl & method keys when calling api request. Can we send multiple paramters ? Please let me know with an example. – sanjay pujari Mar 11 '21 at 13:30
  • Yes you can have multiple parameters. Refre documentation for usage and examples – user861594 Mar 12 '21 at 15:48