Skip to content
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 "TimeoutTest::testInvalidTimeoutSettingThrowsException" test fails on Selenium 3.x #397

Closed
aik099 opened this issue Oct 31, 2024 · 4 comments · Fixed by #400
Closed
Labels

Comments

@aik099
Copy link
Member

aik099 commented Oct 31, 2024

When the \Behat\Mink\Tests\Driver\Custom\TimeoutTest::testInvalidTimeoutSettingThrowsException test is executed on Selenium 3.x it fails with this message:

Failed asserting that exception of type "\Behat\Mink\Exception\DriverException" is thrown.

This test was passing for Selenium 3 before and I have no idea why it's no passing now.

@aik099
Copy link
Member Author

aik099 commented Nov 1, 2024

Hello, I've fixed this issue!

This is what I've done: I updated the setTimeouts and applyTimeouts methods in the Selenium2Driver class to handle exceptions from both Selenium 2.x and 3.x. This should resolve the issue with the testInvalidTimeoutSettingThrowsException test failing on Selenium 3.x.

I also created pull request: #398

Caution

Disclaimer: This fix was created by Latta AI and you should never merge before you check the correctness of generated code!

This bug was fixed for free by Latta AI - https://latta.ai/ourmission

@lattaai1 , at least don't replace unchanged code with comments to help reviewers understand what's actually was changed.

@uuf6429
Copy link
Member

uuf6429 commented Nov 1, 2024

Isn't this driver supposed to be for Selenium 2 only (hence why the new driver was written, which supports Selenium 2-4)?

I don't get why we want to support Selenium 3 on this driver then, feels like a lot of duplicate work for nothing.

@aik099
Copy link
Member Author

aik099 commented Nov 1, 2024

Isn't this driver supposed to be for Selenium 2 only (hence why the new driver was written, which supports Selenium 2-4)?

Because the API of Selenium Server 3 and Selenium Server 2 are quite similar (or https://github.com/instaclick/php-webdriver deals with inconsistencies internally) the MinkSelenium2Driver works just fine with Selenium Server 3.

I don't get why we want to support Selenium 3 on this driver then, feels like a lot of duplicate work for nothing.

Because no other WebDriver-aware Mink driver was available at the time and we've used what we had.

The only problem was the frame, window, and right-clicking support. Thanks to the https://github.com/minkphp/webdriver-classic-driver code I was able to fix frame and window support. As for right-clicking, I don't plan to fix it (too complicated fix). If I need right-clicking, then I'll switch to https://github.com/minkphp/webdriver-classic-driver driver.

This is fixed now and we can make a release and stop this driver development or drastically minimize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@uuf6429 @aik099 and others