【问题标题】:Error with Selector in TestCafe - method .find()TestCafe 中的选择器出错 - 方法 .find()
【发布时间】:2021-03-06 18:21:00
【问题描述】:

我正在努力使用“.find”方法在 TestCafe 中定义一个选择器,我需要单击该链接“开始索赔”,如下图所示。

我正在使用 id 元素并使用“.find”转到链接。似乎 Testcafe 对该选择器不满意,它经常将错误抛出为“未定义”...

await t.(Selector('#policySummaryDetails_M0014157733').find('#claimLink_0'))

【问题讨论】:

    标签: javascript selenium testing automated-tests testcafe


    【解决方案1】:

    await t.(Selector('#policySummaryDetails_M0014157733').find('#claimLink_0'))

    您忘记调用tclick 方法。如果你想点击那个链接,你需要重写你的代码如下:

    await t.click(Selector('#policySummaryDetails_M0014157733').find('#claimLink_0'))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-10
      • 2019-03-26
      • 1970-01-01
      • 2021-01-27
      • 1970-01-01
      • 2019-02-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多