---
name: Click
short_description: Click element at its center point.
description:
  >
    Clicks element at its center point. If the element's center point is obscured by another element, an element click intercepted error is returned. If the element is outside the viewport, an element not interactable error is returned.

    Not all drivers automatically scroll the element into view and may need to be scrolled to in order to interact with it.
example_usage:
  java:
    |
      MobileElement el = driver.findElementByAccessibilityId("SomeId");
      el.click();
  python:
    |
      el = self.driver.find_element_by_accessibility_id('SomeId')
      el.click();
  javascript_wd:
    |
      let element = await driver.elementByAccessibilityId('id', 'SomeId');
      await element.click();
  javascript_wdio:
    |
      driver.click('#SomeId');
  ruby:
    |
      @driver.find_element(:accessibility_id, 'SomeId').click
  php:
    |
      $driver->byAccessibilityId('SomeId')->click();
  csharp:
    |
      // TODO

client_docs:
  java: "https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebElement.html#click--"
  python: "http://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webelement.WebElement.click"
  javascript_wdio: "http://webdriver.io/api/action/click.html"
  javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L1672"
  ruby: "http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#click-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: true
    uiautomation: true
  android:
    uiautomator2: true
    uiautomator: true
  mac:
    mac: true
  windows:
    windows: true
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/:element_id/click
  method: 'POST'
  url_parameters:
    - name: session_id
      description: UUID of the session
    - name: element_id
      description: UUID of the element

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