Appium 1.5.2 cannot perform SWIPE, always gives the error "point is not within the bounds of the screen", but works very well with Appium 1.4.8

Appium 1.5.2 cannot perform SWIPE, always gives the error “point is not within the bounds of the screen”, but the same command works very well with Appium 1.4.13

Environment:

APPIUM 1.5.2
iOS 9.2.1
MAC OS

Any idea how to solve this?

thanks

Try to update java-client to 4.0.0

I updated the java-client to 4.0.0 and I don’t get the error but the swipe still cannot be performed. Nothing happens.
It’s just ignores the swipe command.

Are you use driver.swipe or scroll method for JavascriptExecutor?

i am using java and driver.swipe
the thing is that it works everywhere besides from bottom to top
in ios, in order to see the wifi button i need to swipe from the bottom and it’s just ignores the swipe and nothing happens.

any solution regarding this?

and you swipe like: swipe (x_absolute_start, y_absolute_start, x_absolute_end, y_absolute_end, some_time) instead of in 1.4.X appium was: swipe (x_absolute_start, y_absolute_start, x_RELATIVE_end, y_RELATIVE_end, some_time) ?

yes
i use Dimension in order to get the real height and width and its not working
swipe from top to bottom works
swipe from bottom to top doesn’t work

look into appium logs and compare what coordinates sending while you doing up/down scrolling.

theses are the logs
y: 568 is the real size of the screen

Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“x”:160,“y”:568}},{“action”:“wait”,“options”:{“ms”:100}},{“action”:“moveTo”,“options”:{“x”:160,“y”:284}},{“action”:"…
[debug] [iOS] Executing iOS command ‘performTouch’
[debug] [UIAuto] Sending command to instruments: target.touch([{“touch”:[{“x”:160,“y”:568}],“time”:0.2},{“touch”:[{“x”:160,“y”:568}],“time”:0.30000000000000004},{“touch”:[{“x”:320,“y”:852}],“time”:0.5}])

[debug] [Instruments] [INST] 2016-06-16 14:08:34 +0000 Debug: Got new command 6 from instruments: target.touch([{“touch”:[{“x”:160,“y”:568}],“time”:0.2},{“touch”:[{“x”:160,“y”:568}],“time”:0.30000000000000004},{“touch”:[{“x”:320,“y”:852}],“time”:0.5}])

[debug] [Instruments] [INST] 2016-06-16 14:08:34 +0000 Debug: evaluating target.touch([{“touch”:[{“x”:160,“y”:568}],“time”:0.2},{“touch”:[{“x”:160,“y”:568}],“time”:0.30000000000000004},{“touch”:[{“x”:320,“y”:852}],“time”:0.5}])

[debug] [Instruments] [INST] 2016-06-16 14:08:34 +0000 Debug: target.touch(__NSCFArray)

[debug] [Instruments] [INST] 2016-06-16 14:08:35 +0000 Debug: point is not within the bounds of the screen

first try to avoid using maximum values of screen while swipe. try maximum set to MaxSize - 10pixels.
second if you saying that 568 is MAX then {“touch”:[{“x”:320,“y”:852}] is not valid screen point and it should not really work.
third when you doing swipe why you increase X value? 160 -> 320. look like you still using old java client while changed swipe to absolute coordinates.

see discussion in https://github.com/appium/java-client/issues/409 there seems to be a bug.

i am not increasing the x and never change the value of y to 852
i guess it is the bug

i reviewd the bug
it is similar but i use ios
not sure if that matters
now i saw a message on appium ui: Swipe up with three fingers to reveal the control center
this is basically what i need…

can you write your code when you swipe? maybe it helps…

sure

    try {
        dimension = driverWrapper.getIosDriver().manage().window().getSize();
        int middleX = dimension.getWidth() / 2;
        int y = dimension.getHeight();

// driverWrapper.getIosDriver().swipe(middleX,y - 10 ,middleX,y / 2,600);
action = new TouchAction(driverWrapper.getIosDriver());
action.press(middleX, y - 1 ).waitAction(1000)
.moveTo(middleX, y / 2).release().perform();
} catch (Exception e) {
Log.assertFail("bottom menu - Exception: " + e.getMessage());
}

I tried to perform y-10, y-1…
It always gives the same error
And swipe from top to bottom works correctly

ok. you making Swipe with IOSDriver but we are using AppiumDriver.

maybe this is why we did not meet issue.

Try with Appium driver. java:

((AppiumDriver) driver).swipe(x_start, y_start, x_end, y_end, duration);

thank you very much for your help but it’s still not working.
i think there is a progress because now i don’t get the error: point is not within the bounds of the screen.
what happens now is that the swipe is ignored. It is not performed.
the only thing i can think about is that its a bug since the code worked correctly before i upgraded the appium to 1.5.2 and the java-client to 4.0.0

i met similar issue today while automating another test. maybe helps you.

i have function that does swipe based on element (your case is base on window). in function i am using swipe by getting element size and dimension (similar to your window) and use actual min/max point values little smaller (for sure that i am inside element not on border).

i am trying to swipe Up without success.

after checking i see that on bottom there are buttons(control elements) in list and mine start_y point goes directly over it. Doing same manually on Simulator or Real device reproducing the same problem. Swipe cannot start when we start it over the control buttons on bottom.

i improved function with new variable “startPointShift” (when it is not NULL it is moving start point for this value).

after retrying swipe now with startPointShift = bottom buttons height swipe start working.

good luck

can you please share some of the code you performed so i will be able to better understand your suggestion?
thanks