Accessing elements from within a iFrame -fails in watir-webdriver 0.6.6 - works fine in 0.6.4

后端 未结 2 1982
轻奢々
轻奢々 2021-01-16 13:35

I am trying to select a value in a dropdown which is inside a iFrame. The frame is nested within a table. HTML:

 


        
2条回答
  •  佛祖请我去吃肉
    2021-01-16 14:22

    Watir-webdriver 0.6.5 has changed the way locating frames works.

    • Before (ie pre-0.6.5), browser.frame located frame and iframe elements.
    • Now, browser.frame locates frame elements and browser.iframe locates iframe elements.

    You will need to change your frame accessor to match the new rules (when you migrated to 0.6.5 or later). The second parameter needs to change from :frame to :iframe:

    element(:select_frame, :iframe, :src => /MyApplicantPortal\/Applicant\/\d+\/SelectOrderTemplate\?t=1/)
    

提交回复
热议问题