X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fjcalderonzumba%2Fgastonjs%2Fdocs%2Fapi%2Fcommands%2Fmouse%2Fclick.md;fp=vendor%2Fjcalderonzumba%2Fgastonjs%2Fdocs%2Fapi%2Fcommands%2Fmouse%2Fclick.md;h=a3c8fe33fa69f0e8132f0c125e5244542e3d56c5;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/jcalderonzumba/gastonjs/docs/api/commands/mouse/click.md b/vendor/jcalderonzumba/gastonjs/docs/api/commands/mouse/click.md new file mode 100644 index 000000000..a3c8fe33f --- /dev/null +++ b/vendor/jcalderonzumba/gastonjs/docs/api/commands/mouse/click.md @@ -0,0 +1,30 @@ +click +======== +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). + +In order to send a click you have to send the page and the element id where you want to click. + +**TODO: add link to find command documentation** + +##Click Request +```json +{ + "name": "click", + "args": [1, 0] +} +``` +A successful click command has the following response: +##Click Response +```json +{ + "response": { + "position": { + "x": 165, + "y": 59 + } + } +} +``` +Where **x** and **y** are the coordinates where the click was done. + +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).