Watir and text field inside iframe

前端 未结 4 1637
自闭症患者
自闭症患者 2021-01-22 10:26

I\'m trying to setup new text into a text field using Watir. The text field is placed inside iframe.

4条回答
  •  情书的邮戳
    2021-01-22 11:12

    Maybe watir has been updated since these answers were posted, but none of these frame methods worked for me. I was able to successfully use the iframe method, and interact with that just like any other object. Once the iframe object was selected, I could call on DOM elements after the iframe call successfully. Was only able to select the iframe object using its 'id' tag even though it had a 'name' attribute as well..

    browser.text_field(:id => "handle").exists?
    #=> false
    
    browser.iframe(:id => "secureform").text_field(:id => "handle").exists?
    #=> true
    

提交回复
热议问题