Add touch actions to MobileDriver#487
Conversation
|
@kdaimiel I don't think so the above addition would really enable support for |
|
@kdaimiel You can utilize this https://github.com/appium/appium-ios-driver/blob/master/lib/commands/gesture.js#L455 and define it here in client https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/ios/IOSTouchAction.java for iOS. This should probably go in as a new feature request. @TikhomirovSergey ping. |
|
@SrinivasanTarget I don't understand your comments. I just wanted to use TouchActions with an AndroidDriver instance, but I get the error above. Here is an example: import io.appium.java_client.AppiumDriver; import org.junit.After; import java.net.URL; public class SwipeBrowserTest { } |
|
@kdaimiel I was saying we aren't consuming |
|
@SrinivasanTarget Ok. However, it is possible to use TouchActions in Chrome, it is supported after ChromeDriver 2.16. You can ckeck it on https://sites.google.com/a/chromium.org/chromedriver/downloads |
|
@kdaimiel Thats cool. Have you tried it? |
|
@SrinivasanTarget Yes, I have tried it. I opened a similar pull request to Selenium project and it was accepted, SeleniumHQ/selenium#2694. |
|
Hmm ok @kdaimiel Fix the merge conflicts to port it and also can you add some tests? |
|
@kdaimiel https://travis-ci.org/appium/java-client/builds/182849719#L2275 needs to be fixed |
|
@kdaimiel As said it would be great if you add some tests here |
|
@SrinivasanTarget Where exactly do I add my tests? That will take me some time. |
SrinivasanTarget
left a comment
There was a problem hiding this comment.
May i know the reason for this removal? Do you have any other solutions or thoughts in mind? If so feel free to share.
|
@SrinivasanTarget Sorry, first I added TouchActions tests with others, however I decided to create a new class for this tests but I forgot to remove them from the other class. |
Change list
Add support to TouchActions such as flick.
Types of changes
Details
MobileDriver does not implement HasTouchScreen interface so TouchActions like flick get the error below. However, Appium supports this types of actions.
java.lang.ClassCastException: io.appium.java_client.android.AndroidDriver cannot be cast to org.openqa.selenium.interactions.HasTouchScreen
at org.openqa.selenium.interactions.touch.TouchActions.(TouchActions.java:38)
at amazon_tests.browser_test.SwipeCellsTest3.swipeCellsTestChromeDriverPatched(SwipeCellsTest3.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)