问题
First of all Thanks for the Karate-UI. After consuming karate - API, we have started using Karate UI :-)
Let me summarize my question here: I am getting 'assert evaluated to false' from the below code:
* match text({}header) == 'header'
* assert exists({}header).exists
The first line of the code able to locate the element and compare the text, the second line throws an error for the same locator. Could you please help me sort out this problem?
回答1:
Can you try 0.9.6.RC3 - we realized exists()
was so confusing, and changed the API.
Detailed explanation is here: https://github.com/intuit/karate/issues/1148
Updated docs are here: https://github.com/intuit/karate/tree/develop/karate-core#optional
So you should do this:
* assert exists('{}header')
It will help us a lot if you confirm this works. Else please follow this process: https://github.com/intuit/karate/tree/develop/examples/ui-test
来源:https://stackoverflow.com/questions/62250992/assert-exists-exists-returns-assert-evaluated-to-false-even-locator-is-availab