a3c8fe33fa69f0e8132f0c125e5244542e3d56c5
[yaffs-website] / vendor / jcalderonzumba / gastonjs / docs / api / commands / mouse / click.md
1 click
2 ========
3 Sends a click event to the browser, this event is sent as if it comes as part of the user interaction, meaning is not a synthetic [DOM event](http://www.w3.org/TR/DOM-Level-2-Events/events.html).
4
5 In order to send a click you have to send the page and the element id where you want to click.
6
7 **TODO: add link to find command documentation**
8
9 ##Click Request
10 ```json
11 {
12     "name": "click",
13     "args": [1, 0]
14 }
15 ```
16 A successful click command has the following response:
17 ##Click Response
18 ```json
19 {
20     "response": {
21         "position": {
22             "x": 165,
23             "y": 59
24         }
25     }
26 }
27 ```
28 Where **x** and **y** are the coordinates where the click was done.
29
30 You need coordinates to click because that is how PhantomJS works, for more info check [PhantomJS native events](http://phantomjs.org/api/webpage/method/send-event.html).