I tried to debug with verbose command and here is the output I see element "//span[contains(text(),'Save')]//ancestor::button" Emitted | step.passed (I see element "//span[contains(text(),'Save')]//ancestor::button") Emitted | step.finish (I see element "//span[contains(text(),'Save')]//ancestor::button") Emitted | step.start (I grab number of visible elements "//span[contains(text(),"Save")]//ancestor::button") I grab number of visible elements "//span[contains(text(),"Save")]//ancestor::button" Emitted | step.passed (I grab number of visible elements "//span[contains(text(),"Save")]//ancestor::button") Emitted | step.finish (I grab number of visible elements "//span[contains(text(),"Save")]//ancestor::button") Emitted | step.start (I click "//span[contains(text(),'Save')]//ancestor::button") I click "//span[contains(text(),'Save')]//ancestor::button" [1] Retrying... Attempt #2 [1] Retrying... Attempt #3 [1] Retrying... Attempt #4 [1] Retrying... Attempt #5 [1] Retrying... Attempt #6 [1] Error | WebDriverError: element click intercepted: Element ... is not clickable at point (808, 473). Other element would receive the click: (Session info: chrome=80.0.3987.149) Even though it is able to locate the element, click is not working. Any idea how to use executescript method in codeceptjs.
Asked
Active
Viewed 630 times
0
-
1Please format your question. I don't see where is your text and where code/logs - I don't know what is it. – Lukasz Szczygielek Mar 26 '20 at 21:50
-
i am unable to click on a button using codeceptjs with protractor Below is the Error message i got in codeceptjs I click "//span[contains(text(),'Save')]//ancestor::button" [1] Retrying... Attempt #2 [1] Retrying... Attempt #3 [1] Retrying... Attempt #4 [1] Retrying... Attempt #5 [1] Retrying... Attempt #6 [1] Error | WebDriverError: element click intercepted: Element ... is not clickable at point (808, 473). Other element would receive the click: (Session info: chrome=80.0.3987.149) – Niranjani Ravikumar Mar 27 '20 at 01:23
-
I tried to provide CSS Selector as well. Below code works in chrome console. ('#.badged-button.mat-raised-button.mat-primary').click() But, if i provide using I.executeScript method it is not working – Niranjani Ravikumar Mar 27 '20 at 01:27
1 Answers
0
There are a few ways to resolve the issue at hand.
- Remove number of elements found method and instead, use
I.seeElement(#id)
- Add a pause method before the step which is having the issue and debug on the go.
I.pause();
- Generally while writing test scripts ; before clicking any button always use
I.see(#id);
Lastly, don't complicate action as simple as a click by adding Executescript method Let me know if you still face issue.
PS - Please format your question when you ask it here. For reference check other questions.

Ashutosh Mishra
- 53
- 8