This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
20 / 43
Nov 2014

hi,
actually, I have faced this kind of error when i was using like e.g. tap(button).perform()
then I used (X,Y) co-ord but Y co-ord is not correctly located on screen while X co-ord is correct so i add some offset (in my case i add 100 i.e. Y+100) then its worked for me.
But i dont think this is the reliable way to do this job.

Hi guys!
Has anybody got it resolved? Please share your results as hardcoded Y offset couldn't be worked for different mobiles as they have different resolutions.

Eric knows another workaround, how to get this resolved.
But it also works unstable:-(

public static void tap(WebElement we) {
    Point p = we.getLocation();
    Dimension size = we.getSize();
    try {
      nativeContext();
      Point appLoc = driver.findElement(By.xpath("//UIAWebView[1]")).getLocation();
      driver.tap(1, appLoc.x + p.x + (size.width / 2), appLoc.y + p.y + (size.height / 2), 1);
    } finally {
      webContext();
    }
  }

Hi,

This doesn't work for me:

Point appLoc = driver.findElement(By.xpath("//UIAWebView[1]")).getLocation();

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.

Smth that worked on one phone. failed on another...
Is there any ideas how to get correct coordinates for tap?

@jonahss
Looks, this can be fixed in 1.3.2. When are you going to release 1.3.2?

Hey, @jonahss, @SergeyTichomirov

Looks, this is no longer valid in 1.3.2:
executeScript("mobile: swipe", swipeObject)

Is there a way to tap, swipe and scrollTo element in webview?

Does it not work?
Have you tried

element.tap()
element.zoom()
element.pinch()
element.swipe(direction, int)

?

It something weird if it doesn't work

executeScript("mobile: swipe", swipeObject);

Maybe something is broken on the server-side...

Regarding the last one I'm not sure if it still needed if above will works.
But I got the following:

[36minfo[39m: [37m-->[39m [37mPOST[39m [37m/wd/hub/session/cde2565af9101509c4316c499667ac90/execute[39m [90m{"script":"mobile: swipe","args":[{"startX":0.5,"duration":2,"startY":0.6,"endX":0.5,"endY":0.2}]}[39m
[36minfo[39m: [debug] Tried to execute non-existent mobile command 'swipe'. Most mobile commands have been ported to official client library methods. Please check your Appium library for more information and documentation
[36minfo[39m: [debug] Responding to client that a method is not implemented

Let me get out the error message for trying touch actions for web, like element.tap()

public LobbyPage(AppiumSwipeableDriver driver, String game) {
this.driver = driver;
this.game = game;
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
}

@FindBy(xpath = "//img[contains(@src, 'image')]")
public MobileElement casinoTab;

And the next one is failed with:
casinoTab.tap(1,1);

java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at io.appium.java_client.pagefactory.ElementInterceptor.intercept(ElementInterceptor.java:27)
at io.appium.java_client.MobileElement$$EnhancerByCGLIB$$50f36ea9.tap()
at com.pages.LobbyPage.openCasinoTab(LobbyPage.java:67)
at com.pages.LobbyPage.openGameWithLogin(LobbyPage.java:87)
at com.run.ScreenshotMaker.gameActions(ScreenshotMaker.java:81)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:38)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:382)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Is AppiumSwipeableDriver a RemoteWebDriver (not AndroidDriver/IOSDriver) subclass?

Ok. Now it is clear for me.

AppiumDriver is abstract class since 2.0.0 (java-client version). It is extended by AndroidDriver and IOSDriver. AndoidDriver generates AndroidElements and IOSDriver generates IOSElements. Both AndroidElement and IOSElement extend MobileElement.

AndroidDriver and IOSDriver have specific JsonToWebElementConverters. AppiumDriver has't any specific converter. In your case it works like RemoteWebDriver and you receive RemoteWebElement. It is the root cause of your problem.

Why you are using AppiumSwipeableDriver (customized AppiumDriver)?

Let me check AndroidDriver

Hmm, seems I got another error:
Not yet implemented. Please help us: http://appium.io/get-involved.html1 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4 milliseconds
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at io.appium.java_client.pagefactory.ElementInterceptor.intercept(ElementInterceptor.java:27)
at io.appium.java_client.MobileElement$$EnhancerByCGLIB$$4ecee8af.tap()
at com.pages.LobbyPage.openCasinoTab(LobbyPage.java:64)
at com.pages.LobbyPage.openGameWithLogin(LobbyPage.java:84)
at com.run.ScreenshotMaker.gameActions(ScreenshotMaker.java:81)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:38)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:382)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

This error was the cause why I was using Custom AppiumDriver with HasTouchScreen interface

Ok. Now I need help too. :frowning:
It seems that something wrong with chromedriver. I have got something similar. Android 4.4.4. I caught this error before, but I seems that problem is still here.

Caused by: org.openqa.selenium.UnsupportedCommandException: unknown command: session/0b2b54337ca29e828a1234450ec437ec/touch/perform
Command duration or timeout: 21 milliseconds
Build info: version: '2.43.1', revision: '5163bceef1bc36d43f3dc0b83c88998168a363a0', time: '2014-09-10 09:43:55'
System info: host: 'xxx', ip: 'xxxx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_20'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{app=xxxx, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, deviceName=Android Emulator, platform=LINUX, desired={app=xxx, platformName=Android, deviceName=Android Emulator}, platformVersion=4.4.4, webStorageEnabled=false, locationContextEnabled=false, browserName=Android, takesScreenshot=true, javascriptEnabled=true, platformName=Android}]
Session ID: 3603990e-67e6-49df-81dc-304f1b49bdfa
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at io.appium.java_client.AppiumDriver.performTouchAction(AppiumDriver.java:304)
at io.appium.java_client.MultiTouchAction.perform(MultiTouchAction.java:74)
at io.appium.java_client.AppiumDriver.tap(AppiumDriver.java:331)
at io.appium.java_client.MobileElement.tap(MobileElement.java:71)
at io.appium.java_client.MobileElement$$FastClassBySpringCGLIB$$f90deb4e.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

Actually today is the first time I use appium 1.3.2 beta.

@jonahss

Do you have any idea? It happens when driver is switched to WEBVIEV and chromedriver is started. I attempted to perform tap()