Skip to content

Commit

Permalink
Add documentation for ‘mobile: touchAndHold’ endpoint (appium#8446)
Browse files Browse the repository at this point in the history
* Add documentation for ‘mobile: touchAndHold’ endpoint

* Remove extra backet
  • Loading branch information
Mykola Mokhnach authored and imurchie committed May 16, 2017
1 parent fd19391 commit 739f06e
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/en/writing-running-appium/ios-xctest-mobile-gestures.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ driver.execute('mobile: doubleTap', {element: element.value.ELEMENT});
```


### mobile: touchAndHold

Performs long press gesture on the given element or on the screen.

#### Supported arguments

* _element_: The internal element identifier (as hexadecimal hash string) to long tap on
* _duration_: The float duration of press action in seconds. Mandatory patameter
* _x_: Screen x long tap coordinate of type float. Mandatory parameter only if _element_ is not set
* _y_: Screen y long tap coordinate of type float. Mandatory parameter only if _element_ is not set

#### Usage examples

```csharp
// c#
Dictionary<string, object> tfLongTap = new Dictionary<string, object>();
tfLongTap.Add("element", element.Id);
tfLongTap.Add("duration", 2.0);
((IJavaScriptExecutor)driver).ExecuteScript("mobile: touchAndHold", tfLongTap);
```


### mobile: twoFingerTap

Performs two finger tap gesture on the given element or on the application element.
Expand All @@ -127,7 +149,7 @@ Performs two finger tap gesture on the given element or on the application eleme
// c#
Dictionary<string, object> tfTap = new Dictionary<string, object>();
tfTap.Add("element", element.Id);
((IJavaScriptExecutor)driver).ExecuteScript("mobile: twoFingerTap", tfTap));
((IJavaScriptExecutor)driver).ExecuteScript("mobile: twoFingerTap", tfTap);
```


Expand Down

0 comments on commit 739f06e

Please sign in to comment.