You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
click Function does not correspond to top-left corner of the element #38
Wrong element (the left or the right element) gets clicked instead. Based on the documentation hereclickWithLeftButton with offset should place the cursor on the upper left corner of the element, but with extensive testing, we've found out that the position of the cursor is actually at the center of the element. Note that we are writing acceptance tests for a web application. The same code works fine with Chrome (configuration below) but it does not work well with Selenium/Gecko/Firefox. We are using an RTL language (Persian) in UTF-8.
Codeception : 4
PHP : 7.2 Remi
Selenium : 3.8.1 with enablePassThrough function
Geckodriver : 0.26.0
Mozilla Firefox : 72.0.1
OS : Windows 10
acceptance.suite.yml:
# Codeception Test Suite Configuration## Suite for acceptance tests.# Perform tests in browser using the WebDriver or PhpBrowser.# If you need both WebDriver and PHPBrowser tests - create a separate suite.actor: AcceptanceTestermodules:
enabled:
- \Helper\Acceptance
- WebDriver
- Db
- Assertsdepends:
- Db:
- WebDriver:
- Asserts:
url: 'http://localhost/'config:
WebDriver:
url: 'http://localhost/'port: 4444Db:
dsn: 'mysql:host=1.1.1.1;dbname=mysql;charset=utf8'user: 'root'password: 'password'populate: falsecleanup: falsereconnect: trueenv:
firefox:
modules:
config:
WebDriver:
url: 'http://localhost/'window_size: 1920*1080browser: firefoxcapabilities:
acceptInsecureCerts: trueunexpectedAlertBehaviour: 'accept'binary: "/opt/firefox/firefox-bin"chrome:
modules:
config:
WebDriver:
url: 'http://localhost/'window_size: 1920*1080browser: chromecapabilities:
chromeOptions: # additional chrome optionsargs: ["--no-sandbox", "--disable-notifications", "--start-maximized", "--disk-cache-dir=null", "--aggressive-cache-discard", "--disable-dev-shm-usage"]
After a lot of trial-and-errors, we eventually fixed our problem using the following code. The code uses JS functionalities to find the width and height of an element, then moves the cursor and selects the top right corner (This is where we found out that its not selecting the top left corner) :
Does this issue affect only specific HTML element or all elements?
A minimal reproduction case (minimal html page and test case) would be useful, but it looks like this is an issue of Geckodriver, so it would be better to raise issue there.
These tests pass on SemaphoreCI with Chrome (but not Chrome Headless) , because it uses Ubuntu 14.04 with Chrome 69. Which means that this change was introduced in later version.
Activity
Naktibalda commentedon Feb 11, 2020
Does this issue affect only specific HTML element or all elements?
A minimal reproduction case (minimal html page and test case) would be useful, but it looks like this is an issue of Geckodriver, so it would be better to raise issue there.
Naktibalda commentedon Feb 29, 2020
I think that I reproduced this issue with Chrome 80:
Firefox 73 fails too.
Naktibalda commentedon Mar 1, 2020
These tests pass on SemaphoreCI with Chrome (but not Chrome Headless) , because it uses Ubuntu 14.04 with Chrome 69. Which means that this change was introduced in later version.
Naktibalda commentedon Mar 2, 2020
Most likely solution on Codeception side will be documentation update.