Reputation: 47
Api returns a confirmationNumber, which i'm storing in a variable then using that confirmationNumber to click and assert on the UI page.
//some ui login steps are here
Then input('#paymentNum',confirmationNumber) //--successfully entered confirmationNumber
And assert exists('{div}confirmationNumber'). //--not successful. not able to read the stored value
And click('{a}confirmationNumber') //--not successful. not able to read the stored value
Please help Thank you
Upvotes: 1
Views: 978
Reputation: 58088
Easy. Think of anything within the (
and )
as pure JavaScript. Also please note the extra exists
, hmm maybe I should re-design that part of the API - and thanks for asking this question ! https://github.com/intuit/karate/issues/1148
# this is how to use exists() right now, but I have decided to change this !
And assert exists('{div}' + confirmationNumber).exists
And click('{a}' + confirmationNumber)
Upvotes: 1