切换页面空手道 UI 问题

Switch Page Karate UI issue

我在使用空手道 UI 切换标签页时遇到问题。我的代码如下:

  Scenario: SwitchPage Test
    Given driver 'original URL'
    * retry(5, 10000).waitFor('#someID')
    * input('#someID', ['numbers', 'input', Key.ENTER]) // this will open the new page
    * print driver.title \ this prints the original title of the original URL
    * switchPage('NewURL')
    * delay(10000) // I've put this just in case but it doesn't work without it either
    Then print driver.title // this still prints the original title of the original URL

非常感谢任何帮助,我认为它是一个很棒的工具,但我在这种情况下遇到困难,我们的应用程序会打开每个模块的新选项卡。

谢谢

是的,我知道这很难。在 0.9.6 中,我们可以选择通过 a) index 和 b) URL of the tab

的 sub-string 来切换 tab

如果需要,请考虑提交一个可以帮助我们模拟和改进空手道的简单示例:https://github.com/intuit/karate/tree/develop/examples/ui-test

最后,如果可能的话,我推荐这个选项。如果有某种方法可以让您导出 打开的选项卡的 URL,请尝试 re-use 当前选项卡,这样会更简单测试。有关详细信息,请参阅此线程:https://github.com/intuit/karate/issues/1269#issuecomment-682553602

另见: