Assert exist().exists将断言评估为false,即使DOM中的定位符可用 [英] Assert exists().exists returns assert evaluated to false even locator is available in DOM

查看:349
本文介绍了Assert exist().exists将断言评估为false,即使DOM中的定位符可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,感谢Karate-UI.在使用空手道-API之后,我们开始使用空手道UI :-)

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?

推荐答案

您能尝试0.9.6.RC3吗?我们意识到exists()如此令人困惑,并更改了API.

Can you try 0.9.6.RC3 - we realized exists() was so confusing, and changed the API.

详细说明在这里: https://github.com/intuit/karate/issues/1148

更新的文档在这里: https://github.com/intuit/karate/tree/develop/karate-core#optional

所以您应该这样做:

* assert exists('{}header')

如果您确认此方法有效,它将对我们有很大帮助.否则,请遵循以下过程: https://github.com/intuit/空手道/tree/develop/examples/ui-test

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

这篇关于Assert exist().exists将断言评估为false,即使DOM中的定位符可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆