selenium hidden element code example
Example 1: hide element selenium
public void hideElement(String xpath)
{
WebElement element = driver.findElement(By.xpath(xpath));
((JavascriptExecutor)driver).executeScript("arguments[0].style.visibility='hidden'", element);
}
Example 2: how to handle hidden elements in selenium webdriver
JavascriptExecutor js=(JavascriptExecutor)driver;
js.executeScript("document.getElementsByClassName(ElementLocator).click();");