---
name: Get Active Element
short_description: Gets the active element of the current session

example_usage:
  java:
    |
      WebElement currentElement = driver.switchTo().activeElement();
  python:
    |
      element = driver.switch_to.active_element
  javascript_wd:
    |
      let element = await driver.active();
  javascript_wdio:
    |
      driver.elementActive();
  ruby:
    |
      @driver.switch_to.active_element
  php:
    |
      // TODO PHP example
  csharp:
    |
      // TODO C# example

client_docs:
  java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebDriver.TargetLocator.html#activeElement--"
  python: "http://selenium-python.readthedocs.io/api.html?highlight=active_element#selenium.webdriver.remote.webdriver.WebDriver.switch_to_active_element" # TODO
  javascript_wdio: "http://webdriver.io/api/protocol/elementActive.html"
  javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1934"
  ruby: "http://www.rubydoc.info/gems/selenium-webdriver/0.0.28/Selenium/WebDriver/TargetLocator#active_element-instance_method"
  php: "https://github.com/appium/php-client/" # TODO
  csharp: "https://github.com/appium/appium-dotnet-driver/" # TODO

# 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/element/active
  method: 'POST'
  response:
    - name: ELEMENT
      type: object
      description: A JSON object for the located element

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