-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The "EventsTest::testRightClick" test fails on Selenium 3.x #381
Comments
The https://github.com/instaclick/php-webdriver doesn't seem to be maintained anymore. Without fixing it there is no way to make right-clicking work. I'm proposing to release this driver as-is so that developers can have almost full Selenium 3 support (without right-clicking) until the https://github.com/minkphp/webdriver-classic-driver is released. |
If it can't be fixed, why not skip the test (with a reasonable skip message)? |
If you can manage to invoke the right-click action using I wasn't able to understand how to make it happen. I don't use right-clicking in my tests, but maybe somebody does. |
@aik099 while running the test on chrome, the selenium docker service has the following output: selenium+chrome docker service output
This part is particularly suspicious: From what I know, Selenium in this version can switch between W3C and JWP (JsonWireProtocol AKA OSS). I've found out that I can force chrome to disable W3C, but it's not very well documented. When I apply the following patch to the MinkSelenium2Driver, the test passes (for chrome): diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php
index fe8b165..83b4050 100755
--- a/src/Selenium2Driver.php
+++ b/src/Selenium2Driver.php
@@ -93,6 +93,7 @@ class Selenium2Driver extends CoreDriver
*/
public function __construct(string $browserName = 'firefox', ?array $desiredCapabilities = null, string $wdHost = 'http://localhost:4444/wd/hub')
{
+ $desiredCapabilities['goog:chromeOptions'] = array_merge($desiredCapabilities['goog:chromeOptions'] ?? [], ['w3c' => false]);
$this->setBrowserName($browserName);
$this->setDesiredCapabilities($desiredCapabilities);
$this->setWebDriver(new WebDriver($wdHost)); Similarly, this is the selenium docker service output for firefox: selenium+firefox docker service output
There are some follow up questions though:
|
On the other hand, I'm wondering why Selenium is not translating our JWP calls to W3C correctly. So other potential solutions would be:
|
By the way, just now I found the root cause of this problem: SeleniumHQ/selenium#7393 - selenium loses / doesn't translate the You can see the faulty code and a fix (only applied to Selenium 4) here: SeleniumHQ/selenium@085ceed |
I've tried to use the
I'm trying to make the test suite green -> make a final release -> advocate everybody to use the I'm not planning to abandon this driver completely because it does have differences in the Considering all your findings I can now do 2 things:
. |
I'm not saying to abandon it - however the facts are clear:
Since you'd be adding a selenium version check anyway, I would just make it throw an exception saying that it won't work with selenium 3.
That said, I'm also fine with your proposal. I just don't feel it is worth the trouble. |
The latest release of this driver does work (except for window/frame management) on Selenium 3 and even on Selenium 4 (if desired capabilities are given in a new format with the The current code in the Here is the PR with a proposed implementation: #407 . Please review. |
When the
\Behat\Mink\Tests\Driver\Js\EventsTest::testRightClick
test is executed on Selenium 3.x it fails with this message:The driver code seems to be written correctly (I've double-checked with the Facebook's driver version: https://github.com/php-webdriver/php-webdriver/blob/5d8e66ff849b5614015d35e99d759252e371ce26/lib/Remote/RemoteMouse.php#L100 ).
Not sure why the test fails.
More research is done in #354 (comment) .
The fix was done in #372 , but it's using Actions , which isn't implemented in the WebDriver.
The text was updated successfully, but these errors were encountered: