Package com.learingselenium.android;
Import Junit.framework.TestCase
Import org.openqa.selenium.Rotatable;
Import org.openqa.selenium.ScreenOrientation;
Import Org.openqa.selenium.WebDriver;
Import Org.openqa.selenium.android.AndroidDriver;
Import org.openqa.selenium.interactions.touch.TouchActions;
...
Webdriver Driver = new Androiddriver ("Http://localhost:8888/wd/hub");
((rotatable) driver). Rotate (Screenorientation.landscape); //Rotate the screen
Driver.get ("http://1.com");
Driver.close ();
...
Webdriver Driver = new Androiddriver ("Http://localhost:8888/wd/hub");
Driver.get ("http://1.com");
((rotatable) driver). Rotate (screenorientation.portrait); //Make sure the screen orientation is PORTRAIT
Scroll down 400 pixel offsets
Touchactions touch = new Touchactions (driver);
Touch.scroll (0, +). Build (). Perform ();
Driver.close ();
...
Rotate the screen in Android, touch, scroll