Hi!
Your email and password variables come from a data file, right? On the variables tab it is shown that the type is Test Data Value.
When you write the Verification
for the query, you write
def variables = request.getVariables()
This will get you the variables, that are specified on the Variables
tab. So this only gets you the email and password, that you told the test to use, from the DataTest
named file. And does not get the email and password from the response!
If you wanted to get this in the Test Case also from the DataTest, than it is already done when you send the request here:
But if you want it from the response that is being sent to you, than we have to know if email and password values are included in the response, and if yes, how exactly are they called and how the response looks like. Because the structure of the JSON is important.
For example:
{
"user": [
{
"email": "something@something.com",
"password": "password123"
}
]
}
If you want to get the email, you have to write:
WS.getElementPropertyValue(response, "user[0].email")
→ this will give you a String
WS.getElementPropertyValue(response, "user.email")
→ this gives you a List
When you send the request in Katalon, and get the response back, you can check the structure under Body
, if you hover over the value, Katalon will write the path in the lower left corner: