我的 HTML 看起来像这样:
<input custom_attribute="so cool" type="text" />
我想使用 Watir 在其中输入文本。
I have HTML that looks like this:
I would like to enter text in it using Watir.
Filipin 的回答不适用于我的 watir-webdriver 工作。
不过,我确实找到了一种使用 css 选择器来完成这项工作的方法。
browser.element(:css, "input[custom_attribute='so cool']").send_keys("the coolest")
Filipin's answer did not work for my job with watir-webdriver.
I did, however, find a way to do the job with css selectors.
browser.text_field(:xpath , "//input[@custom_attribute='so cool']/").set("even more cool")
来源:
Sources:
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
Filipin 的回答不适用于我的 watir-webdriver 工作。
不过,我确实找到了一种使用 css 选择器来完成这项工作的方法。
Filipin's answer did not work for my job with watir-webdriver.
I did, however, find a way to do the job with css selectors.
来源:
Sources: