How can I send Global Variable as a Parameter in Webservice Request

I want to pass global variables as Webservice Parameter Key and Value. Is it possible?

Oh okay, is it part of your vision? would it be supported in next release?

So that is not possible because that’s not supported yet.

No, your code would be written in Testcase section. My scenario is to pass Key and Values (parameters) in ObjectRepository --> Webservice Request --> Post Request --> Body Section.

Please refer to my solution on this topic: http://forum.katalon.com/questions/how-to-pass-test-data-into-soap-web-service-request-is-it-possible-to-control-the-properties-of-soap-request-programmatically-through-a-script-rather-than-hard-coding-it/

Your case should adjusted to:

request.getRestParameters().add(new TestObjectProperty('Key', ConditionType.EQUALS, GlobalVariables.yourValue))

Could anyone answer this please

Also how can I pass the Global variables values in Request ‘Body’ section?

Scenario: I need to capture the value from Web UI and store it in Global variable. And I need to pass that variable as a parameter in Webservice request as POST

Hey Guys,

Is the feature of passing Objects to POST request body section still not available?
please confirm.

Thanks
Niro

Niro said:

Hey Guys,

Is the feature of passing Objects to POST request body section still not available?
please confirm.

Thanks
Niro

Yes I could do this that way:
1. First, you should make a references in your json body section:
For example your json was like this
{“email”: "mymail@mailserver.com"}
you want to parametrize the value of email element.
2. You should go to variable section and define here a variable like this
Name = Login
Value = mymail@mailserver.com
3. Then you shoul add refernces in your json-body in accordance with JSON spec
{“email”: {"$ref": “#Login”}}