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..?

I would like to know if it is possible to control the properties of a soap request through a script…? What I mean is, I do not want to hard code the properties of a soap request and I would like to read the values from a file and pass it to the properties or write a function to randomize the values for the properties.

For example, if I have a soap request with two properties, User Name and Password, I would like to pass different values to these properties, each time I call this web service request in a test case.

An example of how to do that would be much appreciated.

Hi Vinh Nguyen,

If it is possible, could you please provide a tutorial on how to test web services using Katalon, perhaps for a simple webservice with steps as to how to pass values dynamically and also how to parse the response data…? A tutorial on this would be highly helpful to clear the the doubts/questions.

Hi Vinh,

I tried the way you have explained, but I got the following error while running test case,

Test Cases/API_Test FAILED because (of) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/C:/Users/qaddaffi.sulaiman/Katalon%20Studio/AutomationTrial/Scripts/API_Test/Script1494360124193.groovy: 29: unable to resolve class TestObjectProperty
@ line 29, column 33.
request.getRestParameters().add(new TestObjectProperty(“username”, ConditionType.EQUALS, username))

file:/C:/Users/qaddaffi.sulaiman/Katalon%20Studio/AutomationTrial/Scripts/API_Test/Script1494360124193.groovy: 30: unable to resolve class TestObjectProperty
@ line 30, column 33.
request.getRestParameters().add(new TestObjectProperty(“password”, ConditionType.EQUALS, password))

2 errors


The screenshot of the code is at