Skip to content

[Appium 1.0 - iOS 7] Got Exception after swipe gesture perform in Java in iOS 7 #15

Closed

Description

@ansonliao

Hi,
My Appium version: 1.0
iOS SDK: 7.1
Mac OS: 10.9
iOS device: iPhone simulator
Appium coding language: Java

I got exception after swipe gesture perform, some code of Java below.
could you kindly advise that something mistake I made and how I can revise it?

--------------------------------------------------- Code ---------------------------------------------------
TouchAction action = new TouchAction(driver);

int sX = 908;

int sY = 320;

int eX = 227;

int eY = sY;

int duration = 1500;

driver.swipe(sX, sY, eX, eY, duration);

// action.press(sX, sY).waitAction(duration).moveTo(eX, eY).release();

// action.perform(); ==> got error here.

--------------------------------------------------- Error Msg ---------------------------------------------------

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)

at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)

at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:76)

at io.appium.java_client.AppiumDriver.performTouchAction(AppiumDriver.java:203)

at io.appium.java_client.TouchAction.perform(TouchAction.java:253)

at com.ma.qa.cjol.cjol10.f(demotest.java:41)

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:334)

at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)

at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)

at org.testng.SuiteRunner.run(SuiteRunner.java:240)

at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)

at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)

at org.testng.TestNG.run(TestNG.java:1057)

at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)

at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)

at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

Activity

  1. Jonahss commented on May 6, 2014

    @Jonahss
    Member

    I ran the code you provided.

    The iPhone simulator running on my machine has a screen size of 320px by 568px. So the X coordinate of 908 is too large.

    The appium log contains this:

    {"status":17,"value":{"message":"An error occurred while executing user supplied JavaScript.","origValue":"start point is not within the bounds of the screen"},"sessionId":"bc809394-ac44-4120-b905-d357b7753bf9"}

    Try changing sX to be less than 320.

  2. ansonliao commented on May 7, 2014

    @ansonliao
    Author

    Dear Jonahss,
    I changed my iPhone 4-inch retina simulator to the 50% of size, and I changed start X value to 290, now no error gets, but the swipe gesture is not implement.

    int sX = 290;
    int sY = 240;
    int eX = 60;
    int eY = sY;
    int duration = 1500;
    driver.swipe(sX, sY, eX, eY, duration);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions