@@ -72,6 +72,7 @@ driver.executeScript("gesture: swipe", Map.of("elementId", scrollView.getId(),
72
72
73
73
# scrollElementIntoView
74
74
75
+ ** JAVA**
75
76
``` java
76
77
RemoteWebElement scrollView = (RemoteWebElement ) wait. until(presenceOfElementLocated(AppiumBy . accessibilityId(" Swipe-screen" )));
77
78
@@ -83,17 +84,35 @@ driver.executeScript("gesture: scrollElementIntoView", Map.of("scrollableView",
83
84
" maxCount" , 3 ));
84
85
85
86
```
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
+ ```
86
94
87
95
Sample app used to demonstrate below gesture is available [ here] ( https://github.com/AppiumTestDistribution/appium-demo/blob/main/VodQA.apk )
88
96
89
97
# Drag and Drop
90
98
99
+ ** JAVA**
91
100
``` java
92
101
RemoteWebElement source = (RemoteWebElement ) wait. until(elementToBeClickable(AppiumBy . accessibilityId(" dragMe" )));
93
102
RemoteWebElement destination = (RemoteWebElement ) wait. until(elementToBeClickable(AppiumBy . accessibilityId(" dropzone" )));
94
103
95
104
driver. executeScript(" gesture: dragAndDrop" , Map . of(" sourceId" , source. getId(), " destinationId" , destination. getId()));
96
105
```
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
+ ```
97
116
98
117
# Double Tap
99
118
0 commit comments