更新时间:2023-10-14 15:01:40
browser.text_field(:index,1).attribute_value(custom_attribute)
#=> 很酷
来源: I have HTML that looks like this:
ul> <input custom_attribute="so cool" type="text" />
I would like to get value of custom_attribute
using Watir.
browser.text_field(:index, 1).attribute_value("custom_attribute")
#=> "so cool"
Sources: