-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] Allow ClientConfig when instantiating local webdrivers #16570
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
base: trunk
Are you sure you want to change the base?
[py] Allow ClientConfig when instantiating local webdrivers #16570
Conversation
… in WebDriver classes
…e_server_addr is always set to service.service_url for local drivers.
|
https://github.com/iampopovich/selenium/actions/runs/19208403903 |
Add unit tests for ClientConfig support across multiple WebDriver implementations Add unit tests for ClientConfig support in Firefox, IE, and Chrome WebDrivers - Implemented unit tests for FirefoxDriver to validate ClientConfig handling. - Added tests for IE WebDriver to ensure proper ClientConfig acceptance and passing. - Created tests for Chrome WebDriver to verify ClientConfig integration. - All tests check for correct handling of remote server address, keep-alive settings, and timeouts. - Fixed assertion issues in tests to compare ClientConfig attributes correctly.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
…Chromium, Firefox, IE, and Safari WebDriver implementations
User description
🔗 Related Issues
relates to #16282
💥 What does this PR do?
This pull request introduces support for advanced HTTP and WebSocket configuration in all major Selenium WebDriver classes through a new
client_configparameter. The change allows users to pass aClientConfiginstance for fine-grained control over connection settings, which takes precedence over legacy parameters likekeep_alive. The constructors for Chrome, Edge, Firefox, Internet Explorer, and Safari drivers are updated to accept and normalize this new configuration, ensuring consistent behavior and clear documentation for users.Major feature: Advanced connection configuration
Added an optional
client_configparameter (type:ClientConfig) to the constructors of all major WebDriver classes (chrome,edge,firefox,ie,safari), enabling advanced HTTP/WebSocket settings. The parameter is documented to take precedence overkeep_aliveand other legacy options, and example usage is provided in each class docstring. [1] [2] [3] [4] [5]For each driver, the constructor now normalizes
client_configby always settingremote_server_addrto the local driver service URL. If aclient_configis provided by the user, its fields are copied and merged with the service URL, ensuring local drivers always connect to the correct endpoint. [1] [2] [3] [4]Integration and documentation
The new
client_configparameter is passed through to the corresponding remote connection classes (ChromiumRemoteConnection,FirefoxRemoteConnection,SafariRemoteConnection,RemoteConnection), allowing these classes to use the advanced configuration for HTTP and WebSocket connections. [1] [2] [3] [4]Imports for
ClientConfigare added to all affected driver files to support the new parameter. [1] [2] [3] [4] [5]Docstrings for all affected constructors are updated to clearly explain the purpose and precedence of
client_config, including usage examples for both default and custom configurations. [1] [2] [3] [4] [5]🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Added
client_configparameter to all major WebDriver classesEnables advanced HTTP/WebSocket configuration for local drivers
Normalizes
remote_server_addrto service URL for local driversComprehensive unit tests for ClientConfig support across drivers
Diagram Walkthrough
File Walkthrough
7 files
Add ClientConfig parameter to Chrome WebDriverImplement ClientConfig normalization in ChromiumDriverAdd ClientConfig parameter to Edge WebDriverAdd ClientConfig parameter to Firefox WebDriverAdd ClientConfig parameter to IE WebDriverAdd ClientConfig parameter to Safari WebDriverMake remote_server_addr optional in ClientConfig6 files
Add functional tests for ClientConfig timeout handlingAdd unit tests for Chrome ClientConfig supportAdd comprehensive unit tests for ChromiumDriver ClientConfigAdd unit tests for Edge ClientConfig supportAdd unit tests for Firefox ClientConfig supportAdd unit tests for IE ClientConfig support