Hi again
Thanks @jonahss your example helped me to debug the functionality. I have now made it work but I have made a few discoveries.
- When you use getLocation(WebElement), the result is in reference to the web page itself.
- When you perform TouchActions (like press and move) they are in reference to the screen. (quite unexpected, but unfortuantely it is WAP (work as planned)).
- BUG : In the documentation for the moveTo method (Both 1.7 & 2.0), we state Move current touch to an absolute position on the screen. However this is incorrect! We actually move the move to a point in reference to the original point.
- BUG ? : These actions do not work on a real device
Example (using code from the Jonahโs example using Java). In this example we draw a horizontal line:
URL url = new URL("http://10.131.151.227:4723/wd/hub");
AppiumDriver driver = new AppiumDriver(url, capabilities);
driver.get("http://lukasolson.github.io/multi-touch-draw/");
action.press(100,100).moveTo(163, 0).release().perform();
The line below creates a vertical line that is 100px long:
action.press(100,100).moveTo(0, 100).release().perform();