【问题标题】:unable locate element when using by,linktext使用 by,linktext 时无法定位元素
【发布时间】:2021-10-22 17:44:24
【问题描述】:

我正在尝试在

处测试过滤器功能
https://todomvc.com/examples/vue/

用户可以点击“全部”、“活动”或“已完成”来过滤列表。

java 类:

public static By filterButtonWithLabel(String filters) {
    return By.linkText(filters);
}

错误:

Caused by: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"link text","selector":""Active""}

这个错误是关于什么的?是不是告诉我不能使用by.linktext

【问题讨论】:

    标签: css css-selectors cucumber-java cucumber-serenity


    【解决方案1】:

    我才意识到这是步骤问题 我不应该使用双引号,直接输入字符串“Completed”。

    And I filter the list to show Completed tasks
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-02-11
      • 2021-08-19
      • 2016-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多