Verification tab can't recognise defined variable


Rencently, I am working on API testing and found below issue.
I want to parameterize my request with this syntax
“name”: “${userName}”,
“job”: “zion resident”

And I also add variable tab

And I tried below syntax in verification tab
WS.verifyElementPropertyValue(response, ‘name’, userName)
But test case always failed with below message.

I even tried “WS.verifyElementPropertyValue(response, ‘name’, “${userName}”)”, it still failed.
Does this mean verification tab can’t recognise variable? BTW, globalvariable is working.


In the Verification TAB there is a code SNIPPET for “Get a variable” which goes likes this:

def variables = request.getVariables()
def variable = variables.get(‘userName’)


Thanks!!! It works.