Protractor: Failed: element not interactable


Posted by Steven

While writing some Protractor tests yesterday, I came across this error:

  1. Failed: element not interactable
  2. (Session info: chrome=71.0.3578.98)
  3. (Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.16299 x86_64)
  4. ElementNotVisibleError: element not interactable
  5. (Session info: chrome=71.0.3578.98)
  6. (Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.16299 x86_64)
  7. at Object.checkLegacyResponse (C:\repositories\project\node_modules\selenium-webdriver\lib\error.js:546:15)
  8. at parseHttpResponse (C:\repositories\project\node_modules\selenium-webdriver\lib\http.js:509:13)
  9. at doSend.then.response (C:\repositories\project\node_modules\selenium-webdriver\lib\http.js:441:30)
  10. at <anonymous>
  11. at process._tickCallback (internal/process/next_tick.js:160:7)
  12. From: Task: WebElement.click()

The reason for this error is the window size of the Chrome browser that is used by Protractor to run the tests. I don't know why, but the windows size is only half the screen so some elements are rendered outside of the visible area. Yes I know, that's not cross-platform, but the feature I'm developing is for desktop/laptops.

The browser window can be maximized by adding the following line to either the test setup or at the beginning of the test itself:

  1. browser.driver.manage().window().maximize();
Category: 
Share: