# How to Set Query Parameters in WebService Request

**URL:** <https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [April 29, 2017, 5:50am UTC](https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346 "2017-04-29T05:50:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srikanth](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/srikanth/32/23869_2.png) [@Srikanth](https://forum.katalon.com/u/Srikanth)\
**Post date:** [April 29, 2017, 5:50am UTC](https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346/1 "2017-04-29T05:50:58Z")

</div>

Hi,

I have Created the Web Service Test Object [SearchReport] under Object Repository and created two Parameters let say [Param1,Param2].

I created Testcase[TestSearch] with Test Step WebServiceKeyword, i can see only sendrequest keyword.

Can you let me know how to set values for Param1 & Param2 and how to send them has Query parameters not has Post body parameters?

---

<div class="post-metadata">

**Author:** ![Srikanth](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/srikanth/32/23869_2.png) [@Srikanth](https://forum.katalon.com/u/Srikanth)\
**Post date:** [May 1, 2017, 2:14pm UTC](https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346/2 "2017-05-01T14:14:43Z")

</div>

Thanks, it means we have to write this in testcase and execute it.

Is there a way to set Global variable in Test Objects itself instead of writing separate testcase.

---

<div class="post-metadata">

**Author:** ![Srikanth](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/srikanth/32/23869_2.png) [@Srikanth](https://forum.katalon.com/u/Srikanth)\
**Post date:** [May 1, 2017, 4:44am UTC](https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346/3 "2017-05-01T04:44:04Z")

</div>

I want Param1 & param2 to be passed as query parameters with using Global Variables in test object.

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [May 1, 2017, 2:30pm UTC](https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346/4 "2017-05-01T14:30:30Z")

</div>

Hi there,

The current design of Test Object doesn’t have any ability to do this. You have to pass in from test case.

Thanks

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [May 1, 2017, 11:51am UTC](https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346/5 "2017-05-01T11:51:35Z")

</div>

Hi there,

Here is the example you can follow:

`'Add REST parameter using local variable from Variables tab'`  
`RequestObject request = findTestObject('REST_CommentDetails')`  
`request.getRestParameters().add(new TestObjectProperty('param1', ConditionType.EQUALS, GlobalVariable.param1))`  
`request.getRestParameters().add(new TestObjectProperty('param2', ConditionType.EQUALS, GlobalVariable.param2))`

`'Send a REST request and returns its response'`  
`def response = WS.sendRequest(request)`

So you can use APIs to help you adding custom parameters usng Global Variables to the request object. Please refer to [API page](http://api-docs.katalon.com/studio/v4.5.0/api/com.kms.katalon.core/com/kms/katalon/core/testobject/RequestObject.html) for more details.

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [April 29, 2017, 1:11pm UTC](https://forum.katalon.com/t/how-to-set-query-parameters-in-webservice-request/6346/6 "2017-04-29T13:11:50Z")

</div>

Hi there,

I don’t clearly understand your question. What do you really want with that web service test object by using param1 & param2?

Thanks
