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

Update to Selenium 4.18 - Replace EventFiringWebDriver #381

Merged
merged 20 commits into from
Feb 27, 2024

Conversation

martingrossmann
Copy link
Contributor

@martingrossmann martingrossmann commented Jan 5, 2024

Description

The listener EventFiringWebDriver is deprecated and was also removed in current Selenium trunk (SeleniumHQ/selenium#13200).

Selenium now provides EventFiringDecorator and WebDriverListener. This change includes an update to Selenium 4.18.1.

There is still an open PR which adds some more methods to WebDriverListener we want to use:

Other ToDos:

  • Check for removing unwrap methods, maybe not needed any more --> still needed to get orginal driver from decorated one.
  • Rename all eventFiringWebdriver variables to webDriver
  • Cleanup

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@martingrossmann martingrossmann marked this pull request as ready for review February 20, 2024 12:02
@martingrossmann martingrossmann changed the title [WIP] Replace EventFiringWebDriver Replace EventFiringWebDriver Feb 20, 2024
@martingrossmann martingrossmann changed the title Replace EventFiringWebDriver Update to Selenium 4.18 - Replace EventFiringWebDriver Feb 20, 2024
if (!desktopWebDriverRequest.getBaseUrl().isPresent()) {
WebDriverManager.getConfig().getBaseUrl().ifPresent(desktopWebDriverRequest::setBaseUrl);
}
VisualEventDriverListener visualListener = new VisualEventDriverListener();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not instantiating VisualEventDriverListener only when Testerra.Properties.DEMO_MODE.asBool()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new EventFiringDecorator gets a list of custom listeners and returns the decorated webdriver, see some lines below. I cannot update a decorated driver with another listener.

And switch or if statements for different ways to create my decorated webdriver make the code more complex.

@martingrossmann martingrossmann merged commit 4d76845 into master Feb 27, 2024
@martingrossmann martingrossmann deleted the feature/replace-eventfiringwebdriver branch February 27, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants