[java] Refactor DriverCommand and W3CHttpCommandCodec for improved readability #16013
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
fixes #10397
💥 What does this PR do?
changes to remove driver commands are the same as in the commit
also rb and node bindings need similar changes
🔧 Implementation Notes
This pull request removes support for local storage and session storage commands from the Selenium WebDriver's W3C HTTP Command Codec. The changes streamline the codebase by eliminating unused or deprecated commands and their associated logic.
Removal of Local Storage and Session Storage Commands:
java/src/org/openqa/selenium/remote/DriverCommand.java
: Removed constants for local storage and session storage commands, such asGET_LOCAL_STORAGE_ITEM
,SET_LOCAL_STORAGE_ITEM
, andCLEAR_SESSION_STORAGE
.java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java
: Removed import statements for local storage and session storage commands that were no longer needed. [1] [2]java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java
: Removed alias definitions for local storage and session storage commands, which mapped these commands to JavaScript execution.java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java
: Removed case statements and associated JavaScript logic for handling local storage and session storage commands. This includes commands likeCLEAR_LOCAL_STORAGE
,GET_SESSION_STORAGE_KEYS
, andSET_SESSION_STORAGE_ITEM
.💡 Additional Considerations
🔄 Types of changes
PR Type
Bug fix
Description
Remove deprecated HTML5 local storage and session storage commands
Clean up unused driver command constants and imports
Eliminate associated command codec aliases and implementations
Streamline W3C HTTP command codec for better maintainability
Changes diagram
Changes walkthrough 📝
DriverCommand.java
Remove HTML5 storage command constants
java/src/org/openqa/selenium/remote/DriverCommand.java
W3CHttpCommandCodec.java
Remove storage command codec implementations
java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java