-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[js] Mark obsolete local and session storage command names as deprecated #16014
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?
[js] Mark obsolete local and session storage command names as deprecated #16014
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
|
Did we deprecate before removal? Just curious |
My motivation: I saw a TODO to remove obsolete commands here selenium/javascript/webdriver/command.js Line 104 in 7a35455
I also searched for the use of these commands in the code in the trunk branch and did not find any obvious references to the variables. I think the change can cause bugs for users of the binding if they use command execution, like here driver.execute(webdriver.CommandName.REFRESH); Should I change the change to deprecate these variables? It will be possible to remove them after the release |
|
@cgoldberg @pujagani check please 🙏 |
…avor of executeScript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request removes obsolete HTML5 local storage and session storage command definitions from the legacy JavaScript WebDriver implementation while simultaneously adding these same commands with deprecation warnings to the modern selenium-webdriver library. The changes align with the W3C WebDriver specification, which does not include native support for localStorage/sessionStorage operations.
Key changes:
- Removed 12 storage-related command definitions from
javascript/webdriver/command.js(legacy implementation) - Added the same 12 commands to
javascript/selenium-webdriver/lib/command.jswith@deprecatedJSDoc annotations and migration examples showing how to useexecuteScriptinstead
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| javascript/webdriver/command.js | Removed 6 local storage and 6 session storage command definitions from the legacy WebDriver implementation |
| javascript/selenium-webdriver/lib/command.js | Added the same 12 storage commands with deprecation warnings and migration guidance directing users to use executeScript for localStorage/sessionStorage operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @example | ||
| * driver.executeScript('return Object.keys(window.sessionStorage)') | ||
| */ | ||
| GET_SESSION_STORAGE_KEYS: 'getSessionStorageKey', |
Copilot
AI
Jan 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value for GET_SESSION_STORAGE_KEYS is 'getSessionStorageKey' (singular) but should be 'getSessionStorageKeys' (plural) to match the constant name and the other localStorage/sessionStorage command naming patterns. This inconsistency was carried over from the original code in javascript/webdriver/command.js and should be corrected.
| GET_SESSION_STORAGE_KEYS: 'getSessionStorageKey', | |
| GET_SESSION_STORAGE_KEYS: 'getSessionStorageKeys', |
…ted in favor of executeScript" This reverts commit cf1e53d.
…avor of executeScript
|
i've marked obsolete constants as deprecated selenium/javascript/webdriver/command.js Line 104 in 5a55743
|

User description
🔗 Related Issues
fixes #10397
💥 What does this PR do?
This pull request removes several commands related to local storage and session storage from the
webdriver.CommandNameobject injavascript/webdriver/command.js. These changes streamline theCommandNamedefinitions by eliminating unused or deprecated commands.Key changes:
Removal of local storage commands:
Removal of session storage commands:
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Other
Description
Remove obsolete local storage command names
Remove obsolete session storage command names
Clean up deprecated HTML5 storage commands
Changes diagram
Changes walkthrough 📝
command.js
Remove obsolete storage commandsjavascript/webdriver/command.js