Hi All,
I'm trying to perform a swipe or a scroll on Android emulator (within my hybrid app, of course) and not having any luck.
This is the code I'm executing:
JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, Double> object = new HashMap<String, Double>();
object.put("startY", 0.95);
object.put("startX", 0.5);
object.put("endY", 0.05);
object.put("endX", 0.5);
object.put("duration", 1.8);
js.executeScript("mobile: swipe", object);
This is the response I get:
POST /wd/hub/session/16d720bd-133c-403f-9237-ffae14df43e7/execute 500 1ms - 475b
debug: Appium request initiated at /wd/hub/session/16d720bd-133c-403f-9237-ffae14df43e7/execute
debug: Request received with params: {"args":[{"duration":1.8,"startX":0.5,"startY":0.95,"endX":0.5,"endY":0.05}],"script":"mobile: swipe"}
info: Responding to client with error: {"status":9,"value":{"message":"The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource. (Original error: That device doesn't know how to respond to 'mobile: 'swipe--it's probably not using Appium's API)","origValue":"That device doesn't know how to respond to 'mobile: 'swipe--it's probably not using Appium's API"},"sessionId":"16d720bd-133c-403f-9237-ffae14df43e7"}
POST /wd/hub/session/16d720bd-133c-403f-9237-ffae14df43e7/execute 500 0ms - 475b
debug: Appium request initiated at /wd/hub/session/16d720bd-133c-403f-9237-ffae14df43e7/element
I have tried the WebDriver's TouchActions Class with no luck.
I'm running: - Appium 0.13.0
- Emulator with Api 17
- Both on Mac OS X (10.8.5)
- Latest Android SDK tools are available on path.
As always, any help is greatly appreciated.
Thanks in advance,
Mario