I am trying to do web automation. I am defining a pop-up menu containing a button defined with either xpath or css respectively as
XPath:-->:
//button[contains(text(), 'Open Door')
CSS:-->:
div.device-item.content.view-content > div.detail > div > button.btn.btn-primary.ng-star-inserted
While all is well, it throws
org.openqa.selenium.ElementClickInterceptedException: element click intercepted:
when I am debugging the test one step at a time, it runs successfully by clicking the button, with out any problem. But when I am running the test, it fails. I hope it is not a wait issue, as we apply check waiting for the presence of the button and verify it exists and clickable.
I believe many would advice to use JavaScriptExecutor approach, but our framework has a problem of returning any web element as a custom object called "Element" which is neither Web Element nor sub class of it, but extends Object and implements an interface called IElement, so we can't use JavaScriptExecutor method since it needs Web Element form of the button which we want to click on.