dusk: Element is not clickable at (x, y)
I have a form which spans beyond the viewport and as a result the following test seems not able to find the button and reports the error;
Facebook\WebDriver\Exception\UnknownServerException: unknown error: Element is not clickable at point (605, 869)
(Session info: chrome=56.0.2924.87)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Mac OS X 10.12.3 x86_64)
Test below;
$this->browse(function ($admin) {
$admin->loginAs(User::find(1))
->visit('/admin')
->assertSee('Dashboard')
->clickLink('Quick Links')
->clickLink('Competitions')
->assertSee('Competitions')
->waitFor('.dropdown-toogle')
->click('.dropdown-toogle')
->assertSee('Copy')
->clickLink('Copy')
->type('name', 'Copy Competition 1')
->check('active')
->press('Save')
->assertSee('Copy Competition 1');
});
I am really not sure why it can’t see the button other than not showing within the viewport and will require a normal user to scroll down to get to the button. Not sure how to proceed beyond this point.
Thanks!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 32 (8 by maintainers)
Chromedriver v2.32 has fixed this issue (at least for me).
Running this code in v2.31
Will throw:
As a workaround for v2.31, I created a macro:
So, the code will be:
A quick hack that work for me : Resize the height of the browser.
@troccoli Try this:
See related issue since Chrome version 61 noted in Issue #366
Try to pause before the immediate click. Something like
$response->pause(500)->press('Save');I have similar problem but solved. It is related with css. I gave margin property for my button. Dusk try to click on the margin area. So, it returned “Element is not clickable at point”. So, I try to remove margin from my button and then it goes smoothly. I found this hint in - https://sites.google.com/a/chromium.org/chromedriver/help/clicking-issues
If you don’t want to touch the design, you should try to scroll the browser to see the btn completely-
$this->browse(function (Browser $browser) { $browser->visit('/login') ->type('email', 'user@user.com') ->type('password', '1234') ->driver->executeScript('window.scrollTo(0, 400);'); // can't chain methods after this $browser ->press('LOG IN') ->pause(500) ->assertSee('Select a location and time to see the cars'); });Try & Goodluck