css - 使用 by,linktext 时无法定位元素
问题描述
我正在尝试在以下位置测试过滤器功能
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
吗?
解决方案
我只是意识到这是我不应该使用双引号的步骤问题,只需直接输入字符串“Completed”即可。
And I filter the list to show Completed tasks
推荐阅读
- php - PHP/SQL:从数据库接收到的“假”值具有良好的查询
- javascript - 递归搜索最长路径
- javascript - javascript return false vs preventdefault 焦点更改
- c# - 最后一个文本框输入值,设置保存
- javascript - Firestore 设置新规则后缺少或权限不足
- c++ - 使用 opencv 进行实时流式传输和处理
- c - 将代码添加到 C 中的每个函数调用
- windows - Electron、electron-builder、nsis、卸载时删除 SchTasks
- python - CNN,在 tensorflow 中使用 CTC 损失实现文本识别的双向 LSTM
- reactjs - 启动一个反应应用程序会引发“A
“src/index.js”中可能只有一个子元素”