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.
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)
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.
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!