4

I have a error which is org.openqa.selenium.InvalidElementStateException: invalid element state: Element is not currently interactable and may not be manipulated.

I'm just trying to find a search box (idNEXT_SCRN). It never happened when this script is running on local. Only after I integrated this automation script with Jenkins(Maven + Cucumber + Jenkins). Anyone has this issue before? Thank you very much.

Here is the code:

public void navToScr(WebDriver driver, String scr) {
    driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
    try {
        driver.findElement(By.id("idNEXT_SCRN")).clear();
        driver.findElement(By.id("idNEXT_SCRN")).sendKeys(scr);
        } catch (ElementNotFoundException e) {
            e.printStackTrace();
        }
        try {
            driver.findElement(By.id("idGO_IND_1")).click();
        } catch (ElementNotFoundException e) {
            e.printStackTrace();
        }
    }
Shi Tim
  • 423
  • 2
  • 5
  • 18
  • Possible duplicate of [Selenium WebDriver throws "Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: Element is not visible" error](https://stackoverflow.com/questions/44690971/selenium-webdriver-throws-exception-in-thread-main-org-openqa-selenium-elemen) – undetected Selenium Dec 13 '17 at 05:50

1 Answers1

3

There have been a few reported issues with clear() and chrome in selenium. Make sure your webdriver is updated to the latest version and also try against a different browser like firefox or chrome.

Ataur Rahman Munna
  • 3,887
  • 1
  • 23
  • 34
Deadron
  • 5,135
  • 1
  • 16
  • 27
  • Thanks @Deadron. So there is nothing I can do on the Code? I will try to update webdriver. Thanks again. – Shi Tim Dec 12 '17 at 21:55