Scroll Element into View with Selenium -


There is no way to scroll the browser window in Selenium 1.x or 2.x, so that any special element Is there an XPath browser to be recognized? Selenium has a focus method, but it does not appear to be physically scrolling in Firefox. Does anyone have any suggestions about this?

For this I need it, I am testing the click of an element on the page. Unfortunately this phenomenon does not work until the element is visible. I do not have control of the code on which the element is clicked, so I can not debug or modify it, so, the simplest solution, scroll to see the item.

Many things have been tried to scroll, but the code below provides better results Have done

It will scroll by the time the element is looking:

  web element element = driver.fix element (bye. ID ("id_of_element")); ((JavaScript Extractor) driver) .executeScript ("argument [0] .scrollIntoView (true);", element); Thread.Sleep (500); /  
element you want to do anything

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -