Is there any way in either Selenium 1.x or 2.x to scroll the browser window so that a particular element identified by an XPath is in view of the browser? There is a focus m
A solution is:
public void javascriptclick(String element) { WebElement webElement = driver.findElement(By.xpath(element)); JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("arguments[0].click();", webElement); System.out.println("javascriptclick" + " " + element); }