Skip to content

Feature Request: Add maximize, minimize, fullscreen, and setRect actions to the window tool #68

@mikejohnstonPremierinc

Description

@mikejohnstonPremierinc

Problem

The window tool currently supports list, switch, switch_latest, and close actions, but has no way to maximize, minimize, fullscreen, or resize/reposition the browser window. This is important because many web applications use responsive design — elements render differently depending on window size, and automation tests typically run maximized.

Current workarounds

  • Chrome/Edge: Pass --start-maximized as a browser argument to start_browser
  • Firefox: --start-maximized doesn't work. Must use -width/-height args with screen dimensions (requires a two-pass approach: launch → measure screen.availWidth/screen.availHeight → close → relaunch with measured values)
  • Safari: No workaround available
  • JavaScript approaches (window.resizeTo(), requestFullscreen(), F11 key press) all fail — they are silently ignored or rejected by browsers on main windows

These workarounds are browser-specific, fragile, and cannot achieve a true OS-level maximize on all browsers.

Proposed solution

Add new actions to the existing window tool:

Action W3C WebDriver Endpoint Selenium API
maximize POST /session/{id}/window/maximize driver.manage().window().maximize()
minimize POST /session/{id}/window/minimize driver.manage().window().minimize()
fullscreen POST /session/{id}/window/fullscreen driver.manage().window().fullscreen()
setRect POST /session/{id}/window/rect driver.manage().window().setRect({x, y, width, height})

All four are standard W3C WebDriver commands supported cross-browser. The server already has access to the driver object (e.g., cookie tools use driver.manage()), so the implementation would be straightforward — just map the new action values to the corresponding driver.manage().window() calls.

maximize alone would solve the most common need, but setRect would cover arbitrary resize/reposition, and minimize/fullscreen would round out the full W3C window management API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions