0

Is there any way to scroll page to current webElement using selenium for Java?

I would like to click on element but when the element is down or up it clicks on another place - so I want to scroll page to current element.

I searched but havent found any solution.

Any help - Advance Thanks !

Hrant Vardanyan
  • 265
  • 1
  • 4
  • 11
  • 1
    This answer is the one, that has been working for me all the time. http://stackoverflow.com/a/20487332/4193730 – Subh Oct 31 '14 at 13:12

1 Answers1

0

You need look up the id and fire click event on that id. I want to click on next button on my page whose id="nextButton" In the page object here is how i declared. That way you dont need worry about where the position is Eg:

@FindBy(how = How.ID, using = "nextButton")
private WebElement next;

More info at http://reddymails.blogspot.com/2011/09/selenium-2-or-webdriver-for-automation.html

Reddymails
  • 793
  • 1
  • 10
  • 24