---
name: Get Window Handles
short_description: Retrieve the list of all window handles available to the session (Web context only)

example_usage:
  java:
    |
      Set<String> windowHandles = driver.getWindowHandles();
  python:
    |
      window_handles = self.driver.window_handles()
  javascript_wd:
    |
      let windowHandle = await driver.windowHandles();
  javascript_wdio:
    |
      let handles = driver.windowHandles();
  ruby:
    |
      @driver.window_handles
  php:
    |
      // TODO PHP sample
  csharp:
    |
      // TODO C# sample

client_docs:
  java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebDriver.html#getWindowHandles--"
  python: "http://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webdriver.WebDriver.window_handles"
  javascript_wdio: "http://webdriver.io/api/protocol/windowHandles.html#description"
  javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L379"
  ruby: "http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Driver:window_handles"
  php: "https://github.com/appium/php-client/" # TODO PHP documentation link
  csharp: "https://github.com/appium/appium-dotnet-driver/" # TODO Dotnet documentation link

# Driver support by platform
driver_support:
  ios:
    xcuitest: false
    uiautomation: false
  android:
    uiautomator2: false
    uiautomator: false
  mac:
    mac: false
  windows:
    windows: false
client_support:
  java: true
  python: true
  ruby: true
  php: true
  csharp: true
  javascript_wd: true
  javascript_wdio: true
  

# Information about the HTTP endpoints
endpoint:
  url: /wd/hub/session/:session_id/window_handles
  method: GET
  url_parameters:
    - name: session_id
      description: ID of the session to route the command to
  response:
    - type: array<string>
      description: A list of window handles

# Links to specifications. Should link to at least one specification
specifications: 
  w3c: https://www.w3.org/TR/webdriver/#dfn-get-window-handles
  jsonwp: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindow_handles
