dimanche 7 janvier 2018

Selenium - Java - ElementNotInteractableException

I am trying to click on the element MY ACCOUNT:

enter image description here

and the system returns an exception ElementNotInteractableException

I'm using:

  • Selenium 3
  • Java
  • Firefox
  • GeckoDriver

My code:

String xpath = "//li[@id='li_myaccount']/a";

try {

    WebElement element = driver.findElement(By.xpath(xpath));

    element.click();            

} catch (Exception e) {

    e.printStackTrace();

}

I tried the following things:

  1. WebDriverWait to wait the element be clickable;
  2. Javascriptexecutor;
  3. Actions;
  4. Change the locator to find by text 'My account'

The system found the element but can't click on the element.

Any workarounds or help given would be greatly appreciated.

Aucun commentaire:

Enregistrer un commentaire