Žel*_*pin 4 html internet-explorer watir
我有这样的HTML:
<input custom_attribute="so cool" type="text" />
Run Code Online (Sandbox Code Playgroud)
我想使用Watir在其中输入文本.
菲律宾的回答对我的watir-webdriver工作不起作用.
但是,我确实找到了使用css选择器完成工作的方法.
browser.element(:css, "input[custom_attribute='so cool']").send_keys("the coolest")
Run Code Online (Sandbox Code Playgroud)
browser.text_field(:xpath , "//input[@custom_attribute='so cool']/").set("even more cool")
Run Code Online (Sandbox Code Playgroud)
资料来源: