【问题标题】:How to wait for the element to appear on the browser before clicking on it in testcafe?如何等待元素出现在浏览器上,然后在 testcafe 中单击它?
【发布时间】:2021-01-21 20:44:38
【问题描述】:

我遇到了一个问题,链接需要一段时间才能出现在屏幕上,但下一步(即单击链接)执行不会等到元素出现。因此它失败了。我尝试添加等待时间,但它并没有等待那么久。无法理解可能是什么问题。任何帮助表示赞赏。

async Action() {
   await this.t.click(this.Selector(".execution"),{ timeout: 50000 });
}

甚至尝试添加 等待 this.t.wait(100000000000);

仍然可以正常工作。 任何帮助表示赞赏

【问题讨论】:

标签: javascript selenium automation ui-automation testcafe


【解决方案1】:

您可以在点击 testcafe 中的元素之前添加等待。

    fixture("Your  Fixture").page(
      "<your URL>"
    );

    test("Test", async (t) => {
      await t
        .wait(3000)
        .click(".execution");    
    });

这是你需要的吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-08
    • 2015-11-30
    • 1970-01-01
    • 2019-03-16
    • 1970-01-01
    • 2014-08-30
    • 1970-01-01
    相关资源
    最近更新 更多