Merge pull request #1186 from mgmanikandan87/patch-2

Code snippet for long press in Android Touchevent (Java and Python)
This commit is contained in:
Dan Cuellar
2013-09-20 07:58:17 -07:00
+7
View File
@@ -13,6 +13,7 @@ new TouchActions(driver).longPress(imageView).perform();
For Android Application:
Java:
```java
WebElement element = wd.findElement(By.name("API Demo"));
JavascriptExecutor js = (JavascriptExecutor) wd;
@@ -21,6 +22,12 @@ tapObject.put("element", ((RemoteWebElement) element).getId());
js.executeScript("mobile: longClick", tapObject);
```
Python:
```python
element = wd.find_element_by_xpath("your_element_xpath")
wd.execute_script("mobile: longClick",{ "touchCount": 1, "x": 0, "y": 300, "element":element.id })
```
Currently Appium support some of the gestures in the Touch Actions API:
* flick