Let’s just focus on one script, one failure at a time. From what I’ve seen so far, the error in your original post does not reflect the script you posted afterward.
When you run this script:
what is the error?
Let’s just focus on one script, one failure at a time. From what I’ve seen so far, the error in your original post does not reflect the script you posted afterward.
When you run this script:
what is the error?
Sorry -
the error is the same -
Test Cases/SignIn/Sign In FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to verify element property value (Root cause: groovy.lang.MissingPropertyException: No such property: signInStatus for class: Script1
at Script1.run(Script1.groovy:1)
at com.kms.katalon.core.webservice.helper.WebServiceCommonHelper.parseAndGetPropertyValueForJson(WebServiceCommonHelper.java:162)
OR
Test Cases/SignIn/Sign In FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to verify element property value (Root cause: groovy.lang.MissingPropertyException: No such property: accounts for class: Script1
at Script1.run(Script1.groovy:1)
This shouldn’t matter, but worth a try. The JSONpath should work either way (at least it does in online testers).
Some further information on the response object might help. Try printing out some details on the response object, like this:
def resObj = WS.sendRequest(findTestObject(‘Sign In/Sign-in-API’, [(‘username’) : ‘8881110030’, (‘password’) : ‘Test-1234’
, (‘identifier_for_vendor’) : ‘1234566789’]))
System.out.println(resObj.getStatusCode())
System.out.println(resObj.getContentType())
System.out.println(resObj.getResponseBodyContent())
The error still doesn’t make sense against the provided code for some reason.
I’m looking at the code examples. I don’t see any with dot prefixes.
OMG! removing the dots worked!!! So the documentation is wrong then…3 hrs on this…jeez.
Ok so while I have your attention how do I take the “token” value from my Sign In response and use it as input to another API??
HAHA nice!
That’s a new question.
New Question equals New Topic (please)
Thanks
I watched a tutorial and it said to copy the value returned from the JSON PATH FINDER and use it…
Stick to the code examples: e.g.
Notice, no dot prefix: '[0].email'
The dot does work in normal JSONpath syntax, so this may be a problem with the WS API. In either case, with a JSON as simple as the one you are working with, it’s generally best to type your own JSONpath.
hello you,
this is the valid resp, NOTE only resp, do not touch for anything else as Slurper
def js = new JsonSlurper().parseText(’{“token”: “ewrerydjgkfgijrtupk,nyouktu”,“tokenValidityTime”:“300”,“signInStatus”: “LoginSuccessfull”,“accounts”: [{“accNumber”: “6000112216066021”,“balance”: “0”,“routingNumber”: “122106316”}],“profileInformation”: {“first_name”: “Apple”,“last_name”: “Test”,“sysDate”: “2020-01-30T15:46:40.969Z”}}’)
println("DEBUG* "+js.accounts[0].accNumber)
DEBUG* 6000112216066021
OK…thanks again