Comments (16)
It might be that the points you have chosen are off the screen. I'm working on better error handling.
You can use the following to get the size of the emulator screen:
driver.manage().window().size()
from java-client.
Hello Jonahss,
no method "size()" under "driver.manage().window()"
could you advise?
from java-client.
Hello Jonahss,
I got the method, it should be
driver.manage().window().getSize();
from java-client.
Hello Jonahss,
My swipe code as below, but it doesn't swipe the screen in iOS 7.x simulator (iPhone),
could you advise how to correct it?
int Y = driver.manage().window().getSize().getHeight(); // Y = 568
int X = driver.manage().window().getSize().getWidth(); // X = 320
int sX = (int) (X * 0.8); // sX = 256
int sY = (int) (Y * 0.5); // sY = 284
int eX = (int) (X * 0.2); // eX = 64
int eY = sY; // eY = 284
int duration = 1200;
driver.swipe(sX, sY, eX, eY, duration);
from java-client.
What happens when you lower the duration? Maybe duration is being interpreted as seconds rather than ms.
What error do you experience?
Can you provide a copy of the Appium server logs?
from java-client.
Dear Jonah,
it is no error when perform swipe gesture and the appium log below (I set
duration to "800"), please help to check it.
info: [INSTSERVER] Got result from instruments:
{"status":0,"value":{"width":320,"height":568}}
info: Responding to client with success:
{"status":0,"value":{"width":320,"height":568},"sessionId":"ce20d066-18a1-43ba-af16-529f87097879"}
GET
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/window/current/size 200
116ms - 126b
debug: Appium request initiated at
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/touch/perform
debug: Request received with params:
{"actions":[{"action":"press","options":{"y":284,"x":256}},{"action":"wait","options":{"ms":800}},{"action":"moveTo","options":{"y":284,"x":64}},{"action":"release","options":{}}]}
info: Pushing command to appium work queue: "au.dragApp(256,284,64,284,0.8)"
debug: Sending command to instruments: au.dragApp(256,284,64,284,0.8)
info: [INSTSERVER] Sending command to instruments:
au.dragApp(256,284,64,284,0.8)
info: [INST] 2014-05-10 13:44:50 +0000 Debug:
target.dragFromToForDuration({x:"256", y:"284"}, {x:"64", y:"284"}, "0.8")
info: [INSTSERVER] Socket data received (50 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":null}
info: Responding to client with success:
{"status":0,"value":null,"sessionId":"ce20d066-18a1-43ba-af16-529f87097879"}
POST /wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/touch/perform
200 1768ms
- 89b
debug: Appium request initiated at
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879
debug: Request received with params: {}
2014-05-10 2:14 GMT+08:00 Jonah [email protected]:
What happens when you lower the duration? Maybe duration is being
interpreted as seconds rather than ms.
What error do you experience?
Can you provide a copy of the Appium server logs?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-42696715
.
from java-client.
Try a duration of "0.8" and see if that does it
On May 10, 2014, at 2:50 PM, ansonliao [email protected] wrote:
Dear Jonah,
it is no error when perform swipe gesture and the appium log below (I set
duration to "800"), please help to check it.info: [INSTSERVER] Got result from instruments:
{"status":0,"value":{"width":320,"height":568}}info: Responding to client with success:
{"status":0,"value":{"width":320,"height":568},"sessionId":"ce20d066-18a1-43ba-af16-529f87097879"}GET
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/window/current/size 200
116ms - 126bdebug: Appium request initiated at
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/touch/performdebug: Request received with params:
{"actions":[{"action":"press","options":{"y":284,"x":256}},{"action":"wait","options":{"ms":800}},{"action":"moveTo","options":{"y":284,"x":64}},{"action":"release","options":{}}]}info: Pushing command to appium work queue: "au.dragApp(256,284,64,284,0.8)"
debug: Sending command to instruments: au.dragApp(256,284,64,284,0.8)
info: [INSTSERVER] Sending command to instruments:
au.dragApp(256,284,64,284,0.8)info: [INST] 2014-05-10 13:44:50 +0000 Debug:
target.dragFromToForDuration({x:"256", y:"284"}, {x:"64", y:"284"}, "0.8")info: [INSTSERVER] Socket data received (50 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":null}
info: Responding to client with success:
{"status":0,"value":null,"sessionId":"ce20d066-18a1-43ba-af16-529f87097879"}POST /wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/touch/perform
200 1768ms
- 89b
debug: Appium request initiated at
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879debug: Request received with params: {}
2014-05-10 2:14 GMT+08:00 Jonah [email protected]:
What happens when you lower the duration? Maybe duration is being
interpreted as seconds rather than ms.
What error do you experience?
Can you provide a copy of the Appium server logs?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-42696715
.—
Reply to this email directly or view it on GitHub.
from java-client.
Hello Jonathan,
I will try it this night.
But I would like to know that duration it is not in ms?
Thanks for your reply.
Jonathan Lipps [email protected]于2014年5月12日星期一写道:
Try a duration of "0.8" and see if that does it
On May 10, 2014, at 2:50 PM, ansonliao <[email protected]javascript:_e(%7B%7D,'cvml','[email protected]');>
wrote:Dear Jonah,
it is no error when perform swipe gesture and the appium log below (I
set
duration to "800"), please help to check it.info: [INSTSERVER] Got result from instruments:
{"status":0,"value":{"width":320,"height":568}}info: Responding to client with success:
{"status":0,"value":{"width":320,"height":568},"sessionId":"ce20d066-18a1-43ba-af16-529f87097879"}
GET
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/window/current/size
200
116ms - 126bdebug: Appium request initiated at
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/touch/performdebug: Request received with params:
{"actions":[{"action":"press","options":{"y":284,"x":256}},{"action":"wait","options":{"ms":800}},{"action":"moveTo","options":{"y":284,"x":64}},{"action":"release","options":{}}]}
info: Pushing command to appium work queue:
"au.dragApp(256,284,64,284,0.8)"debug: Sending command to instruments: au.dragApp(256,284,64,284,0.8)
info: [INSTSERVER] Sending command to instruments:
au.dragApp(256,284,64,284,0.8)info: [INST] 2014-05-10 13:44:50 +0000 Debug:
target.dragFromToForDuration({x:"256", y:"284"}, {x:"64", y:"284"},
"0.8")info: [INSTSERVER] Socket data received (50 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments:
{"status":0,"value":null}info: Responding to client with success:
{"status":0,"value":null,"sessionId":"ce20d066-18a1-43ba-af16-529f87097879"}
POST /wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879/touch/perform
200 1768ms
- 89b
debug: Appium request initiated at
/wd/hub/session/ce20d066-18a1-43ba-af16-529f87097879debug: Request received with params: {}
2014-05-10 2:14 GMT+08:00 Jonah <[email protected]javascript:_e(%7B%7D,'cvml','[email protected]');>:
What happens when you lower the duration? Maybe duration is being
interpreted as seconds rather than ms.
What error do you experience?
Can you provide a copy of the Appium server logs?—
Reply to this email directly or view it on GitHub<
https://github.com/appium/java-client/issues/21#issuecomment-42696715>
.—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-42813508
.
from java-client.
Hello Jonathan,
can't set duration of "0.8" as duration default to "int" as agrument.
from java-client.
It is not working for me either. Using AppiumDriver.
calling simply by driver.swipe(185, 130, 185, 445, 800)// 800 is ms., Coordinates are there in app.
appium sends the commands to the instruments with 0.8 s, and in response receives status 0 and value null.
from java-client.
@vikas2453 Can you open a new issue, this one is old.
Are you using the newest version of java-client?
In the new issue, please post the full Appium logs.
from java-client.
there is also a scale factor between screen size (returned by appium) and size of a screenshot. Does that correlate with the problem? What is the correct coordinate system making taps etc.?
from java-client.
is there any way to check whether swipe() has happened or not ?
Actually i have to swipe pages , but i don'y know how many pages i'll be having . So , i was wondering is there any way to check when to stop swiping or in my case when we have reached at the end of page such that no more swipe needed ?
Thanks
from java-client.
@rahulLiving You can definitely check the title, or some other defining characteristic of each page (like a label or page number) until you get to the end.
from java-client.
Yeah but that is not the case in my scenario, i was wondering something like if swipe() returns something on the swipe of page happened or not. I guess there is no such thing to detect it , swipe return type looks void. It would have been great to catch exception or anything like that which says something like no more swipe() can be done.
Thanks for your quick response Jonashss :)
from java-client.
Hmmm, yeah most Selenium commands don't really return anything, since it's up to you to detect whether the swipe happened the way you wanted it to.
from java-client.
Related Issues (20)
- Failed resolution of: Ljava/net/http/HttpClient; HOT 5
- Not able to run mobile app tests using mvn clean test command and seen errors java. lang. NoClassDefFoundError: org/openqa/selenium/remote/RemoteWebElement & java. lang. NoClassDefFoundError: io/appium/java_client/proxy/HasMethodCallListeners. HOT 13
- bug: AppiumFieldDecorator: Memory leak after moving from java-client 8.5.0 to 8.5.1 .... 9.1.0 HOT 11
- Change default strategy for @HowToUseLocators programatically HOT 5
- bug: IllegalAccessError when starting AndroidDriver in Appium 9.1.0 HOT 4
- The import io.appium.java_client.android.AndroidElement cannot be resolved HOT 1
- How to start an Activity using mobile: startActivity with OptionalIntentArguments? HOT 6
- InvalidArgumentError: Both latitude and longitude should be set HOT 3
- I can't get any appium tests to run HOT 2
- bug: BaseActivateApplicationOptions setting does not take effect HOT 1
- org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure HOT 12
- bug: BaseActivateApplicationOptions setting does not take effect
- bug: BaseActivateApplicationOptions setting does not take effect HOT 1
- io.appium.uiautomator2.common.exceptions.NoSuchDriverException
- Do you plan to provide an extended Driver like UiAutomator2Options?
- getImagesSimilarity(byte[] base64image1, byte[] base64Image2) is not supported by the mapped resource HOT 3
- org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. HOT 2
- IOSFindBy & AndroidFindBy with parametrs HOT 1
- Unable to find Element in PageFactory
- Appium compatibility issue: Need appium version that is compatible with Selenium 4.18.1 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-client.