Skip to content

Conversation

@iampopovich
Copy link
Contributor

@iampopovich iampopovich commented Jul 7, 2025

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.CommandName object in javascript/webdriver/command.js. These changes streamline the CommandName definitions by eliminating unused or deprecated commands.

Key changes:

Removal of local storage commands:

  • Removed commands for interacting with local storage, including getting items, keys, and size, setting items, removing items, and clearing storage.

Removal of session storage commands:

  • Removed commands for interacting with session storage, including getting items, keys, and size, setting items, removing items, and clearing storage.

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Cleanup (formatting, renaming)

PR Type

Other


Description

  • Remove obsolete local storage command names

  • Remove obsolete session storage command names

  • Clean up deprecated HTML5 storage commands


Changes diagram

flowchart LR
  A["webdriver.CommandName"] --> B["Remove Local Storage Commands"]
  A --> C["Remove Session Storage Commands"]
  B --> D["Cleaned Command Object"]
  C --> D
Loading

Changes walkthrough 📝

Relevant files
Cleanup
command.js
Remove obsolete storage commands                                                 

javascript/webdriver/command.js

  • Removed 6 local storage command definitions
  • Removed 6 session storage command definitions
  • Cleaned up obsolete HTML5 storage commands
  • +1/-13   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-code-review
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Code Formatting

    An empty line was added at line 186 which appears to be unintentional and creates inconsistent spacing in the command definitions object.

    @qodo-code-review
    Copy link
    Contributor

    qodo-code-review bot commented Jul 7, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @pujagani
    Copy link
    Contributor

    pujagani commented Aug 5, 2025

    Did we deprecate before removal? Just curious

    @iampopovich
    Copy link
    Contributor Author

    Did we deprecate before removal

    My motivation: I saw a TODO to remove obsolete commands here

    // TODO: Delete obsolete command names.
    so I decided that there is no need to deprecate them, just remove them.

    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
    Screenshot 2025-08-07 012952

    @iampopovich
    Copy link
    Contributor Author

    @cgoldberg @pujagani check please 🙏

    Copilot AI review requested due to automatic review settings January 4, 2026 14:21
    @iampopovich iampopovich changed the title [js] Remove obsolete local and session storage command names [js] Mark obsolete local and session storage command names as deprecated Jan 4, 2026
    @iampopovich iampopovich requested a review from cgoldberg January 4, 2026 14:22
    Copy link
    Contributor

    Copilot AI left a 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.js with @deprecated JSDoc annotations and migration examples showing how to use executeScript instead

    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',
    Copy link

    Copilot AI Jan 4, 2026

    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.

    Suggested change
    GET_SESSION_STORAGE_KEYS: 'getSessionStorageKey',
    GET_SESSION_STORAGE_KEYS: 'getSessionStorageKeys',

    Copilot uses AI. Check for mistakes.
    @iampopovich
    Copy link
    Contributor Author

    iampopovich commented Jan 5, 2026

    i've marked obsolete constants as deprecated
    according to TODO here let's delete them in the few next releases

    // TODO: Delete obsolete command names.

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

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    Remove HTML 5 functionality helper code

    3 participants