Skip to content

Instantly share code, notes, and snippets.

@thu2004
Created November 25, 2014 16:58
Show Gist options
  • Save thu2004/13991ef45b545367a0c6 to your computer and use it in GitHub Desktop.
Save thu2004/13991ef45b545367a0c6 to your computer and use it in GitHub Desktop.
package selendroid_1;
import io.selendroid.MultiTouchAction;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
import io.selendroid.TouchAction;
import io.selendroid.TouchActionBuilder;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
public class TestTouch {
public static void main(String[] args) {
SelendroidCapabilities capa = new SelendroidCapabilities("com.example.android.interactivechart:1.0");
SelendroidDriver driver;
try {
driver = new SelendroidDriver(capa);
TouchAction finger1 = new TouchActionBuilder().pointerDown(300,420).pause(500).
pointerMove(300,515).pointerUp().build();
TouchAction finger2 = new TouchActionBuilder().pointerDown(300,800).pause(500).
pointerMove(300,705).pointerUp().build();
MultiTouchAction multiAction = new MultiTouchAction(finger1, finger2);
multiAction.perform(driver);
driver.quit();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment