Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.63 KB

File metadata and controls

33 lines (24 loc) · 1.63 KB

Implementation Summary: Multi-Tab/Window Support

This document summarizes the implementation of multi-tab/window support in the MCP Selenium server.

Changes

  1. Added five new tools to src/lib/server.js for window management:

    • get_window_handles: Retrieves all active window handles.
    • get_current_window_handle: Gets the handle of the currently focused window.
    • switch_to_window: Switches focus to a specific window by its handle.
    • switch_to_latest_window: Switches to the most recently opened window.
    • close_current_window: Closes the currently active window without ending the session.
  2. Created docs/MULTI_TAB_USAGE.md:

    • Provides detailed usage examples and best practices for the new window management tools.
  3. Created docs/CHANGELOG_TAB_SUPPORT.md:

    • Documents the new features and explains how they remain backward compatible.
  4. Updated README.md:

    • Added a new section documenting the multi-tab/window management tools.

Testing Guidance

To ensure the new tools function correctly, follow these testing steps:

  1. Start a browser session using the start_browser tool.
  2. Open a new tab/window by clicking a link that opens in a new tab (e.g., <a href="..." target="_blank">).
  3. Use get_window_handles to verify that multiple handles are returned.
  4. Use switch_to_latest_window to switch to the new tab.
  5. Perform an action (e.g., get_element_text) to confirm the context has switched.
  6. Use close_current_window to close the new tab.
  7. Verify that the original tab is still active and responsive.