كيف يمكنني الحصول على قيمة السمة المخصصة للعنصر باستخدام Watir
-
22-07-2019 - |
سؤال
لدي HTML يبدو كالتالي:
<input custom_attribute="so cool" type="text" />
أود الحصول على قيمة custom_attribute
استخدام واتير.
المحلول
browser.text_field(:index, 1).attribute_value("custom_attribute")
#=> "so cool"
مصادر:
لا تنتمي إلى StackOverflow