Re: Cannot click the link element after scrolling the page

30 views
Skip to first unread message

Archit Dey

unread,
Jul 2, 2013, 10:40:49 AM7/2/13
to watir-...@googlegroups.com
Hi Charles,

I face this kind of situation almost everyday at work. There are a few things that you can try,

1. Before you click on this link which is currently not visible, try to give the reference of a parent element which is currently visible. 
@driver.#parent element#.link(:text=>'123').click

2.@driver.link(:text=>'123').fire_event(onmousehover)
   @driver.link(:text=>'123').click

3. The crude method for locating the elements

for i in 0...@driver.links.length
   if @driver.link(:index=>i).text=="123"
     @driver.link(:index=>i).click
      break
    end
end   
Reply all
Reply to author
Forward
0 new messages