I tried with swipe method in android,but it not working.
Code:-
public void swipe() {
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap < String, Double > swipeObject = new HashMap < String, Double > ();
swipeObject.put("startX", 0.95);
swipeObject.put("startY", 0.5);
swipeObject.put("endX", 0.05);
swipeObject.put("endY", 0.5);
swipeObject.put("duration", 1.0);
js.executeScript("emulator: swipe", swipeObject);
}
Error:-
org.openqa.selenium.WebDriverException: Not yet implemented.
Any help great apprciation.
Changing the context to NATIVE_APP
worked for me:
String originalContext = driver.getContext();
driver.context("NATIVE_APP");
driver.swipe(startx, starty, endx, endy, duration);
driver.context(originalContext );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With