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.