-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scroll.java
29 lines (20 loc) · 912 Bytes
/
Scroll.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.net.MalformedURLException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Dimension;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
public class Scroll extends base {
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
AndroidDriver<AndroidElement> driver=Capabilities();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
/*Dimension size= driver.manage().window().getSize();
int x=size.getWidth();
int starty=(int)(size.getHeight()*0.60);
int endy=(int)(size.getHeight()*0.10);
driver.swipe(x,starty,endy,2000);
*/
driver.findElementByAndroidUIAutomator("text(\"Graphics\")").click();
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(text(\"Vertices\"));").click();
}
}