Element is not clickable in Protractor

123 Views Asked by At

I am facing issue while interacting with any element in a modal popup. I am using ChromeDriver 2.46 and all tests which involves modal popup fails on Chrome 74.

I get below error

element is not clickable. Other element would receive the click

I have tried with scrollToTop, scrollToElement and visibilityOf but nothing worked. Has anyone faced similar issue?

2

There are 2 best solutions below

0
Nitin Sahu On

I suspect that Driver version and chrome version incompatibility could be the reason for your problem. Since chrome driver 2.46 supports v71-73 and you are using v74. We also observed that there are many evident instances of this. I would suggest first make sure that drive and chrome browser compatibility before running any test case.

Refer this link for browser and driver compatibility

0
Sergey Pleshakov On

Attach you html, and full error stack

Meanwhile here is my assumption which is 90% likely what your problem is

Lets assume your html is something like

<div>
  <button></button>
</div>

your button is visible... but so is div element. BUT because wraps the button, it is above the button (has higher z-index). That's why when you click button, div gets this click, which protractor doesn't let happen. And fails

In this case just simply use js click

browser.executeScript(
  "arguments[0].click();",
  $element.getWebElement() // substitute $element to your elementFinder
)

this will work because element gets the click regardless of visibility and the page layout