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
Investigate and address repeated "Error: ConnectFailure (Connection refused)" when instantiating multiple ChromeDriver instances on Ubuntu 16.04 with Selenium 3.9.0 and Chrome/ChromeDriver versions specified.
Provide a fix or guidance to prevent connection failures after the first ChromeDriver instance.
Validate behavior across multiple instantiations and ensure stability.
Objective: To create a detailed and reliable record of critical system actions for security analysis and compliance.
Status: No auditing: The new behavior allowing null coordinates and updating the internal map has no accompanying audit/logging of this critical emulation change, but this may be handled elsewhere in the system.
Investigate and resolve repeated "Error: ConnectFailure (Connection refused)" when instantiating multiple ChromeDriver instances on Ubuntu 16.04 with Chrome/ChromeDriver versions specified.
Ensure ChromeDriver initialization works reliably beyond the first instance without console connection errors.
Provide fix or guidance specific to Selenium 3.9.0 and Chrome 65/ChromeDriver 2.35 on Linux 4.10.0.
Objective: To create a detailed and reliable record of critical system actions for security analysis and compliance.
Status: No Audit Logs: The new handling for null coordinates changes behavior but does not add any logging to create an audit trail of geolocation override actions.
Improve API usability by introducing a static factory method reset() in SetGeolocationOverrideParameters to avoid the need for casting null when resetting the geolocation override.
emul.setGeolocationOverride(
- new SetGeolocationOverrideParameters((GeolocationCoordinates) null)- .contexts(List.of(contextId)));+ SetGeolocationOverrideParameters.reset().contexts(List.of(contextId)));
Apply / Chat
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies an API usability issue due to constructor overloading ambiguity and proposes a standard design pattern (static factory method) to resolve it, which improves code readability and usability.
Low
Learned best practice
✅ Close context in finallySuggestion Impact:The commit added an explicit context.close() after the assertions, ensuring the context is closed. While not in a try-finally block, it addresses the resource cleanup intent.
code diff:
++ context.close();
Wrap context creation/usage in try-finally and close the BrowsingContext in finally to avoid leaks if assertions throw.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 6
__
Why:
Relevant best practice - Ensure resources are cleaned up using try-finally or equivalent to close/tear down contexts and user contexts, even on exceptions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
💥 What does this PR do?
Allows passing
nulltosetGeolocationOverride's coord parameter as per the W3C spec - https://w3c.github.io/webdriver-bidi/#command-emulation-setGeolocationOverrideUses
assertThatinstead ofassert🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Bug fix, Tests
Description
Allow passing null to GeolocationCoordinates parameter per W3C spec
Replace legacy assert statements with assertThat for better test clarity
Add test case for resetting geolocation override with null coordinates
Diagram Walkthrough
File Walkthrough
SetGeolocationOverrideParameters.java
Allow null coordinates in geolocation overridejava/src/org/openqa/selenium/bidi/emulation/SetGeolocationOverrideParameters.java
handling
SetGeolocationOverrideTest.java
Modernize assertions and add null coordinates testjava/test/org/openqa/selenium/bidi/emulation/SetGeolocationOverrideTest.java
assertions
canSetGeolocationOverrideWithCoordinatesInContext test
canSetGeolocationOverrideWithMultipleUserContexts test
verify null coordinate handling