Skip to content

Commit ffe7b96

Browse files
Merge pull request #112 from mmonfared/mmonfared-patch-1
2 parents 9b50f38 + 46b53f3 commit ffe7b96

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: README.md

+19
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ driver.executeScript("gesture: swipe", Map.of("elementId", scrollView.getId(),
7272

7373
# scrollElementIntoView
7474

75+
**JAVA**
7576
```java
7677
RemoteWebElement scrollView = (RemoteWebElement) wait.until(presenceOfElementLocated(AppiumBy.accessibilityId("Swipe-screen")));
7778

@@ -83,17 +84,35 @@ driver.executeScript("gesture: scrollElementIntoView", Map.of("scrollableView",
8384
"maxCount", 3));
8485

8586
```
87+
**PYTHON**
88+
```python
89+
list_view = driver.find_element(by=AppiumBy.ID, value='android:id/list')
90+
driver.execute_script('gesture: scrollElementIntoView',
91+
{'scrollableView': list_view.id, 'strategy': 'accessibility id', 'selector': 'Picker',
92+
'percentage': 50, 'direction': 'up', 'maxCount': 3})
93+
```
8694

8795
Sample app used to demonstrate below gesture is available [here](https://github.com/AppiumTestDistribution/appium-demo/blob/main/VodQA.apk)
8896

8997
# Drag and Drop
9098

99+
**JAVA**
91100
```java
92101
RemoteWebElement source = (RemoteWebElement) wait.until(elementToBeClickable(AppiumBy.accessibilityId("dragMe")));
93102
RemoteWebElement destination = (RemoteWebElement) wait.until(elementToBeClickable(AppiumBy.accessibilityId("dropzone")));
94103

95104
driver.executeScript("gesture: dragAndDrop", Map.of("sourceId", source.getId(), "destinationId", destination.getId()));
96105
```
106+
**PYTHON**
107+
```python
108+
el1 = driver.find_element(by=AppiumBy.ID, value='io.appium.android.apis:id/drag_dot_1')
109+
el2 = driver.find_element(by=AppiumBy.ID, value='io.appium.android.apis:id/drag_dot_2')
110+
111+
driver.execute_script('gesture: dragAndDrop', {
112+
'sourceId': el1.id,
113+
'destinationId': el2.id,
114+
})
115+
```
97116

98117
# Double Tap
99118

0 commit comments

Comments
 (0)