本文介绍了Karate-UI 自动化:能够切换页面但无法识别新页面上的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,在我点击链接后会打开一个新页面,然后我需要在加载的新页面上工作.使用 switchPage 我可以导航到该页面,但它没有识别新页面上的元素,而是在打开的第一页中搜索元素.

I have a scenario in which after I click on link a new page is opened and then I need to work on the new page which is loaded.Using switchPage I'm able to navigate to that page but it is not identifying the element on new page whereas it is searching for the element in the first page which is opened.

我无法找到解决此问题的方法.有人可以帮忙吗?

I'm not able to find a way to solve this problem. Can someone please help?

Scenario: Title of your scenario
Given driver baseUrl
    And waitFor("input[name='username']")
    And input("input[name='username']",username)
    And input("input[type='password']",password)
    When click("input[name='Login']")
    And waitFor("a[title='Setup']")
    When click("a[title='Setup']")
    * delay(2000)
    When switchPage(1)
    And waitFor("input[class='filter-box input']")

推荐答案

我们有可能在 1.0.1 中有回归 - 请参阅:https://github.com/intuit/karate/issues/1606

It is possible we have a regression in 1.0.1 - see this: https://github.com/intuit/karate/issues/1606

你能做的最有帮助的事情就是遵循这个过程:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue(最好贡献代码)

The most helpful thing you can do is to follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue (ideally contribute code)

另请参阅此答案:https://stackoverflow.com/a/63706655/143475

这篇关于Karate-UI 自动化:能够切换页面但无法识别新页面上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 08:34