Appium TouchAction not working

1,192 views
Skip to first unread message

SOUVIK DUTTA

unread,
Aug 5, 2014, 6:50:47 PM8/5/14
to appium-...@googlegroups.com
Hi Team,

I am unable to perform Appium touch action for my app. I am automating a hybrid application and able to perform most of the operation other than gestures as it is throwing UnsupportedCommand exception.

Here is my code

public static AppiumDriver driver;
public static TouchAction touch;

 
if(browser.equalsIgnoreCase("android")){
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities
.setCapability(CapabilityType.BROWSER_NAME,"");
capabilities
.setCapability("deviceName","Android");
capabilities
.setCapability("device","Android");
capabilities
.setCapability("takesScreenshot","true");
capabilities
.setCapability("platformName","Android");
capabilities
.setCapability("platformVersion","4.4.2");
//capabilities.setCapability(CapabilityType.PLATFORM,"Mac");

capabilities
.setCapability("appPackage","uk.co.ee.myee");
capabilities
.setCapability("appActivity","uk.co.ee.myee.Launcher");
capabilities
.setCapability("udid","989fb005");
driver
= new AppiumDriver(new URL("http://0.0.0.0:4723/wd/hub"),capabilities);
touch
= new TouchAction(driver);
Now I am trying for

touch.press(10, 10).waitAction(300000).moveTo(10,-200).release().perform();

and exception I am getting

org.openqa.selenium.UnsupportedCommandException: unknown command: session/9e5f0b55fdfb2c98dd019f44a7bf9c8a/touch/perform
Command duration or timeout: 19 milliseconds
Build info: version: '2.42.2', revision: '6a6995d31c7c56c340d6f45a76976d43506cd6cc', time: '2014-06-03 10:52:47'

System info: host: 'Praveen-Prabhus-MacBook-Pro.local', ip: '192.168.0.15', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.7.0_65'
Session ID: 2aa1b3fc-7437-41be-9665-01fa3d565180
Driver info: io.appium.java_client.AppiumDriver


I have debugged the complete code and found that .perform() is the method for which I am getting this exception.

Please let me know what I am missing, I am attaching my POM to list all dependencies - let me know if I am missing anything at POM.

Thanks
Souvik





pom.xml

Isaac Murchie

unread,
Aug 5, 2014, 7:10:29 PM8/5/14
to SOUVIK DUTTA, appium-...@googlegroups.com
Can you post the entire server log?


--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

David Turner

unread,
Aug 5, 2014, 8:06:22 PM8/5/14
to appium-...@googlegroups.com
moveTo(10,-200) your moving off screen. moveTo should be the end point of the move.

SOUVIK DUTTA

unread,
Aug 6, 2014, 3:18:57 AM8/6/14
to appium-...@googlegroups.com, souvi...@gmail.com
Hi Issac,

Please check the attached log and exception details, let me know wut could be the issue.

Thanks
Souvik
AppiumLOG.txt
AppiumException.txt

SOUVIK DUTTA

unread,
Aug 6, 2014, 3:25:49 AM8/6/14
to appium-...@googlegroups.com
Hi David,

I tried with moveTo(10,-10) but still I am getting the same error.

Actually I am trying to mimic swipe down for android and iOS, but this not going right. Please let me know if you can think of any other stuff I have missed.

Thanks
Souvik

Isaac Murchie

unread,
Aug 6, 2014, 11:35:33 AM8/6/14
to SOUVIK DUTTA, appium-...@googlegroups.com
Ah. You're doing it in a web view. That will not work. You need to look into how ChromeDriver actions work.


SOUVIK DUTTA

unread,
Aug 6, 2014, 11:48:16 AM8/6/14
to appium-...@googlegroups.com, souvi...@gmail.com
Hi Issac,

Please check the first post in 

I was able to achieve swipe in Webview using AppiumSwipableDriver, which I was able to execute successfully from Windows but the same code didnt run on a MAC. 

Please let me know why this could happen.

Much appreciate your help.

Thanks
Souvik

Isaac Murchie

unread,
Aug 6, 2014, 11:49:54 AM8/6/14
to SOUVIK DUTTA, appium-...@googlegroups.com
Do you have the logs from the windows machine? ChromeDriver is not accepting the command in the log you sent.

SOUVIK DUTTA

unread,
Aug 6, 2014, 1:05:49 PM8/6/14
to appium-...@googlegroups.com, souvi...@gmail.com
No Issac,

I have moved my project into a MAC machine .... if you want to get the log I will be able to the same to you soon. 

But as of now could you please provide me a solution on how could achieve a swipe in webview .... do I need to use JavaScriptExecutor or something similar.

Could you please provide me a code snippet.

Thanks
Souvik
Message has been deleted

Jd Ghuman

unread,
Aug 6, 2014, 2:51:36 PM8/6/14
to appium-...@googlegroups.com, souvi...@gmail.com
Here's a snippet that worked for me:
         
  driver.executeScript("target.
frontMostApp().mainWindow().scrollViews()[1].webViews()[0].staticTexts()[\"(text you want to swipe to\"].scrollToVisible();");

SOUVIK DUTTA

unread,
Aug 6, 2014, 2:56:55 PM8/6/14
to appium-...@googlegroups.com, souvi...@gmail.com
Hi Jd,

Do you have any snippet for swiping to particular object in the page, like a button text or link text, is there an option to use a part of the string or regular expression.

Thanks
Souvik

karthik holla

unread,
Aug 11, 2014, 7:01:51 AM8/11/14
to appium-...@googlegroups.com
@Issac  Can you please elaborate on this("You need to look into how ChromeDriver actions work.")
Reply all
Reply to author
Forward
0 new messages