单击水豚中的编辑按钮?
我正在尝试单击这个特定的编辑按钮。我在 ruby 中使用 find 方法来执行此操作,我遇到的问题是它无法找到特定元素。
<i ng-click="grid.appScope.editMOO(row.entity._id)" class="ca ca-pencil-square-o" role="button" tabindex="0"></I>
这是我尝试单击编辑按钮的代码。
find('.ng-click', class: 'ca ca-pencil-square-o').click
I'm trying to click on this specific edit button. I'm using find method in ruby to do so, the problem I'm running into is that It's not able to find the specific element.
<i ng-click="grid.appScope.editMOO(row.entity._id)" class="ca ca-pencil-square-o" role="button" tabindex="0"></I>
Here is my code trying to click on the edit button.
find('.ng-click', class: 'ca ca-pencil-square-o').click
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要单击所需的按钮,您可以使用以下任何一个:
或
To click on the desired button you can use either of the following Locator Strategies:
or
根据
ng-click
属性的属性不是一个好主意,而是要进行或
注意,如果您想对两个类(例如您最初进行)进行测试,您将数组传递给
class
选项,但是检查“ CA”和“ CA-Pencil-square-o”确实没有意义
Depending on the
ng-click
attribute for this is not a great idea, instead do either ofor
Note, if you wanted to test for both classes like you were doing originally you pass an array to the
class
optionbut that doesn't really make sense to check for both 'ca' and 'ca-pencil-square-o'