minkphp / MinkSelenium2Driver

Selenium2 (webdriver) driver for Mink framework
MIT License
508 stars 163 forks source link

Click on element behind top fixed menu #280

Open fauger opened 6 years ago

fauger commented 6 years ago

Reproduction case :

We have a top fixed menu (position: fixed; top: 0; left: 0; right: 0;)

  1. When i want to click on specific element outside the view screen (clickOnElement(Element $element) in Selenium2Driver.php)
  2. Selenium move to my element : $this->wdSession->moveto(array('element' => $element->getID()));
  3. Then this element goes to the top of the view screen behind my fixed menu.
  4. The click is catched by the menu and the following error is throwed : Element <details data-drupal-selector="edit-markets-fr" id="edit-markets-fr" class="js-form-wrapper form-wrapper collapse-processed"></details> is not clickable at point (480, 15.466659545898438). Other element would receive the click: <nav data-offset-top="" id="toolbar-bar" role="navigation" aria-label="Éléments de la barre d'outils" class="toolbar-bar clearfix"></nav>

Please, How can i fix it ? Actually the only solution i see is hacking the function clickOnElement and adding the height of my menu.

Any helps greatly appreciated, thank you.

aik099 commented 6 years ago

No way really without breaking DriverInterface API that this and other drivers implement.

Maybe you can just hide the top menu before clicking on everything else?