كيفية الوصول إلى عنصر مع سمة مخصصة باستخدام Watir؟

StackOverflow https://stackoverflow.com/questions/1453992

  •  12-09-2019
  •  | 
  •  

سؤال

لدي HTML الذي يشبه هذا:

<input custom_attribute="so cool" type="text" />

أرغب في إدخال نص في استخدامه Watir..

هل كانت مفيدة؟

المحلول 2

browser.text_field(:xpath , "//input[@custom_attribute='so cool']/").set("even more cool")

مصادر:

نصائح أخرى

إجابة فلبينية لم تنجح في وظيفتي مع Watir-Webdriver.

ومع ذلك، أجد طريقة للقيام بهذه المهمة مع محددات CSS.

browser.element(:css, "input[custom_attribute='so cool']").send_keys("the coolest")
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top