如何使用Watir访问自定义属性的元素?
16lz
2021-01-22
I have HTML that looks like this:
我有这样的HTML:
<input custom_attribute="so cool" type="text" />
I would like to enter text in it using Watir.
我想用Watir输入文本。
2 个解决方案
#1
7
Filipin's answer did not work for my job with watir-webdriver.
菲利平的回答对我在watir-webdriver手下的工作没有帮助。
I did, however, find a way to do the job with css selectors.
然而,我找到了一种使用css选择器的方法。
browser.element(:css, "input[custom_attribute='so cool']").send_keys("the coolest")
更多相关文章
- 使用Objective-C将HTML文本转换为纯文本
- 点击后如何使弹出文本消失?
- js去掉html标签和去掉字符串文本的所有的空格
- 如何将添加到ajax html编辑器的文本保存为html文档?
- 如何将每个单词都包含在一个span中,同时保留文本格式
- 文本输入占位符不在IE和Firefox中显示
- php 读取文本文件
- 在数组中找到键是找不到文本[重复]
- PHP DOMNode:如何不仅提取文本,而且提取HTML标签