Passing Test Data from Test Suite, to a Test Case, to a Web Service Request Object, to Verification

Hi there,

I have recently come across an issue where I cannot variable data from a Test Data excel sheet in a Test Suite, all the way down to a groovy Verification script for a Web Service Request object.

I first set up a working Test Data object. Then I am able to pass this object along to the Test Suite. I am able to do the data binding of the Columns in the Test Data to the variables in the Test Case. Then in the Test Case, I have one Web Service Request Object, where upon placing it in there, I tie the Web Service Request’s variables to the Test Case variables. From here, I run the suite to have all the data flow through. Up until the use to the Web Service Request, everything is successful, for example, I can use my query parameters with variables in the Test Object, running a successful web service request. However, when I try to use a variable from the Web Service Request Object, in the groovy verification script, I notice that the data does not flow from the Test Data into this script. It refers to the default, which I leave blank on purpose to help me isolate that the data is only coming from one place (the Test Data Object). This then fails and I am not able to verify the results of the request from the Test Data Object. Now I know I can set up the variable to pull from the Test Data Object, but I prefer not to “hard tie” that variable in the object to to the Test Data Object, since it doesn’t give me the flexibility of using the object in a different test case where a different Test Data Object may be referenced.

If this is working as expected, or if there is a more correct way to do this, please advise.

I am doing this just to I can increase the reuse of my Web Service Request Objects among different Test Cases.

Additionally, I have another question. When setting a variable in a Web Service Request Object to “Test Data Value”, and then setting the Test Data Values “Test Data, Column, Row”, I noticed that there is a “Variable” option for the Value Type. However, I was not able to discern where exactly the “Variable” reference comes from, since it was empty when clicking the dropdown. If anyone has some insight into this, I would appreciate it as it could provide possible work arounds.

Thanks!

Orest

Hello Orest,
to help you i would like to know following:
1. What do you mean by Test Data Object? (show script/screen shot)
2. How you call WS.request? (show script/screen shot)
3. How you trying to verify result? (show script/screen shot)
since there is multiple ways how you can do any of above, i need to know more.

i can just write how i approach such TC:
1. TS - connection to excel
2. TC - variables to bind defined in TC
3. from TC i call keywords/other TC by passing values from variables (e.g. my call to check data looks: CustomKeywords.‘com.swre.irampcc.executeQueryOnIrampCCDB’(queryToExecute, expectedResult) and i don’t rely on variable queryToExecute or excpecedResult in definition of executeQueryOnIrampCCDB)

Andrej, here is what I see on this issue.

<On v5.8.6 as of 11/7/18>

Given I have a SOAP Login Web Service that requires variables (i.e., User & Pswd)
When I add the syntax “${user}” and “${pswd}” to the Request Message Tab
And on the Variable Tab, Add/define variable: pswd; type: String; value: ABC1234
And add variable: user; type String ; value: !Welcome1
And press Play Button on SOAP Test Object aka “Test Request Button”
Expected: Then the values should be passed into the SOAP Request.
And ${user} is ABC1234 & ${pswd} is !Welcome1

Actual: Issue/Bug:
${user} & ${pswd} are “” or NULL; and not being passed values during the Test Request or Test Script Execution.

###-- SOAP Request Body --###


        <Username>${user}</Username>  
          <Password>${pswd}</Password>  
              
    </Login>  
</Body>  

#---- Result (edited) —#

image.png

1 Like

I have a similar issue. Without the possibility of passing data to a web service from excel the whole feature is useless.

guys, how you call those requests? just from definition?

see details in http://forum.katalon.com/discussion/10731/bug-in-web-service-object-cannot-pass-parameters-from-testcase-to-a-soap-web-service-test-object?new=1

Adrian Birlogeanu

I answered with a possible explanation in that bug report.

Kindly try the proposed solution and revert

Can you share the response that you provided to @Adrian_Birlogeanu, the URL in the comment above is now a broken link.

To date, my only means to using a data sheet to pass variable data, is to do this through a test case, having an individual ‘send request’ item for each data row and linking each variable of the test data object to a test data value. Very time consuming!

Any update on this issue?? I am also facing the same problem, Not able to parameterize the data source input to test suite level.