Assert exists().exists returns assert evaluated to false even locator is available in DOM

折月煮酒 提交于 2020-07-09 11:55:27

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!