How to interact with the non-interact able Web Elements in Selenium
// Find the non-interactable element
element WebElement element = driver.findElement(By.id("hidden-or-covered-button"));
// 2. Cast the driver to JavascriptExecutor JavascriptExecutor js = (JavascriptExecutor) driver;
// 3. Execute the native JS click method on the element js.executeScript("arguments[0].click();", element);
No comments:
Post a Comment