Skip to content

Make Driver Services consistent#11973

Merged
diemol merged 13 commits intotrunkfrom
java_service
May 4, 2023
Merged

Make Driver Services consistent#11973
diemol merged 13 commits intotrunkfrom
java_service

Conversation

@titusfortner
Copy link
Copy Markdown
Member

@titusfortner titusfortner commented May 1, 2023

Description

Different drivers currently have different behaviors. This brings everything into agreement.

Motivation and Context

Addresses #11643
This is also in accordance with what we discussed in #11410 as well as:

  • Remove / Deprecate undesired behavior
  • Improve logging ability

Specifics:

  1. Deprecates the constructors that do not include the timeout (users should be using builder anyway; IE has has even kept the constructor private for this reason)
  2. Deprecates the special Firefox behaviors that came from Legacy driver (FirefoxBinary related)
  3. Adds support for turning on Safari driver logging, including preventing users from calling superclass method to set log file location (which isn't supported)
  4. Adds missing features to GeckoDriver service
  5. Allows Chrome, Edge & IE to send all output from the process to the location of user's choosing.

The last item is the biggest one. By default geckodriver logs everything at an INFO level to stderr. This is annoying, so it was allowed to use the System Property webdriver.firefox.logLevel to set the "/dev/null" for it to discard the output. But only being able to do this by using a system property is bad, so I added methods and support for it in all browsers.

For comparison, Ruby has always sent everything from driver process to null output as a default.

This PR allows either of these:

    ChromeDriverService service = new ChromeDriverService.Builder()
        .withLogOutput(DriverService.LOG_NULL)
        .build();

or

    System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY,
        DriverService.LOG_NULL);

…the timeout value

Users should be using the builder
Allow log level to be set in service class, not just in options class
Allow Toggling truncation of log lines
Allow users to specify a different location for profile creation
…vers

This allows completely silencing all logging output or directing everything from the process to a specified file
@titusfortner titusfortner added the C-java Java Bindings label May 1, 2023
@titusfortner titusfortner requested a review from diemol May 1, 2023 03:26
Copy link
Copy Markdown
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thanks!

A couple of comments.

Comment thread java/src/org/openqa/selenium/edge/EdgeDriverService.java
Comment thread java/src/org/openqa/selenium/edge/EdgeDriverService.java
@diemol diemol added this to the 4.10 milestone May 2, 2023
@diemol diemol removed this from the 4.10 milestone May 3, 2023
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 3, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (440a388) 54.89% compared to head (360c8f6) 54.89%.

❗ Current head 360c8f6 differs from pull request most recent head 755ac50. Consider uploading reports for the commit 755ac50 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #11973   +/-   ##
=======================================
  Coverage   54.89%   54.89%           
=======================================
  Files          86       86           
  Lines        5733     5733           
  Branches      233      233           
=======================================
  Hits         3147     3147           
  Misses       2353     2353           
  Partials      233      233           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-java Java Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants