appium / java-client Goto Github PK
View Code? Open in Web Editor NEWJava language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
License: Apache License 2.0
Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
License: Apache License 2.0
would be a nice convenience, instead of having to do the whole regex dance.
Add a switchToNativeContext() as well.
I got some problems with getContextHandles .
I have this method
public void switchToHandle() {
for(String winHandle : driver.getContextHandles()){
log.info(winHandle);
driver.switchTo().window(winHandle);
}
driver = new AppiumDriver (new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
But my test crashed on the line with method driver.getContextHandles()
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.40.0', revision: '4c5c0568b004f67810ee41c459549aa4b09c651e', time: '2014-02-19 11:13:01'
System info: host: 'iosbuildagent.local', ip: '10.33.4.133', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.2', java.version: '1.7.0_51'
Driver info: driver.version: AppiumDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:567)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:76)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:87)
at io.appium.java_client.AppiumDriver.getContextHandles(AppiumDriver.java:471)
at resources.DriverController.switchToHandle(DriverController.java:417)
at tests.LoginTests.initScreens(LoginTests.java:67)
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.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:653)
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)
Caused by: java.lang.NullPointerException
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:282)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:546)
... 31 more
info: Pushing command to appium work queue: "au.getElementByName('Sign In')"
info: [INSTSERVER] Sending command to instruments: au.getElementByName('Sign In')
debug: Request received with params: {"using":"name","value":"Sign In"}
debug: Sending command to instruments: au.getElementByName('Sign In')
info: [INSTSERVER] Socket data received (61 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":{"ELEMENT":"0"}}
info: Responding to client with success: {"status":0,"value":{"ELEMENT":"0"},"sessionId":"70fb5f60-1759-4f4c-89ad-abac5a47fb7c"}
POST /wd/hub/session/70fb5f60-1759-4f4c-89ad-abac5a47fb7c/element 200 180ms - 109b
debug: Appium request initiated at /wd/hub/session/70fb5f60-1759-4f4c-89ad-abac5a47fb7c/element/0/click
info: Pushing command to appium work queue: "au.tapById('0')"
info: [INSTSERVER] Sending command to instruments: au.tapById('0')
debug: Request received with params: {"id":"0"}
debug: Sending command to instruments: au.tapById('0')
info: [INST] 2014-05-14 04:12:02 после полудня +0000 Debug: target.frontMostApp().elements()[0].elements()[4].tap()
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local backboardd[1417] : HID: The 'Rate Controlled' connection 'ScriptAgent' access to protected services is denied.
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : +[INNAuthSession sharedInstance]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNAuthSession init]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNKeychain init]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController init]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : +[INNAuthSession sharedInstance]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNAuthSession signIn:withFlags:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNKeychain objectForKey:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNAuthSession presentController:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : presentingViewController
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 --- last message repeated 1 time ---
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController viewDidLoad]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : +[INNAuthSession sharedInstance]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 --- last message repeated 2 times ---
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController viewWillAppear:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageTitleChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageUrlChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController setWebHidden:noInternetHidden:splashHidden:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController updateNavigationBar]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageTitleChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageUrlChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController hideNavigationBar]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController webView:shouldStartLoadWithRequest:navigationType:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNJsDispatcher webView:shouldStartLoadWithRequest:navigationType:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : shouldStartLoadWithRequest https://ru-m.4gametest.com/apps/20?platform=iOS&deviceId=2C3CE785-D76B-4D27-93B5-5FAEE5A3D24A&country=US&context=no_embryo,new_user
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController webViewDidStartLoad:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : webViewDidStartLoad
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageTitleChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:02 iosbuildagent.local tetris QA[1449] : -[INNWebViewController invalidateTimer]
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":"70fb5f60-1759-4f4c-89ad-abac5a47fb7c"}
POST /wd/hub/session/70fb5f60-1759-4f4c-89ad-abac5a47fb7c/element/0/click 200 436ms - 89b
debug: Appium request initiated at /wd/hub/session/70fb5f60-1759-4f4c-89ad-abac5a47fb7c/appium/app/strings
debug: Request received with params: {}
info: Responding to client with success: {"status":0,"value":{},"sessionId":"70fb5f60-1759-4f4c-89ad-abac5a47fb7c"}
GET /wd/hub/session/70fb5f60-1759-4f4c-89ad-abac5a47fb7c/appium/app/strings 200 2ms - 87b
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local profiled[1420] : (Note ) profiled: Service stopping.
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController webViewDidFinishLoad:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : webViewDidFinishLoad https://ru-m.4gametest.com/apps/20?platform=iOS&deviceId=2C3CE785-D76B-4D27-93B5-5FAEE5A3D24A&country=US&context=no_embryo,new_user
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageTitleChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController invalidateTimer]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController setWebHidden:noInternetHidden:splashHidden:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController updateNavigationBar]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageTitleChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController onPageUrlChanged:]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:03 iosbuildagent.local tetris QA[1449] : -[INNWebViewController hideNavigationBar]
debug: [IOS_SYSLOG_ROW ] May 14 20:12:20 iosbuildagent.local lsd[1437] : LaunchServices: Currently 0 installed placeholders: (
debug: [IOS_SYSLOG_ROW ] )
debug: [IOS_SYSLOG_ROW ] May 14 20:12:38 iosbuildagent.local mstreamd[1423] : (Note ) PS: Media stream daemon stopping.
debug: [IOS_SYSLOG_ROW ] May 14 20:12:38 iosbuildagent.local mstreamd[1423] : (Note ) AS: <MSIOSAlbumSharingDaemon: 0x10390be50>: Shared Streams daemon has shut down.
debug: [IOS_SYSLOG_ROW ] May 14 20:12:38 iosbuildagent.local mstreamd[1423] : (Warn ) mstreamd: mstreamd shutting down.
debug: Appium request initiated at /wd/hub/status
debug: Request received with params: {}
info: Responding to client with success: {"status":0,"value":{"build":{"version":"1.0.0","revision":"f0a00fab2335fa88cb355ab4dc43a9cd3f3236c0"}},"sessionId":"70fb5f60-1759-4f4c-89ad-abac5a47fb7c"}
GET /wd/hub/status 200 1ms - 198b
At the same time my simulator is alive.
Could you help me please with that ?
Ответить
I think that MobileElement should implement FindsByIosUIAutomation, FindsByAndroidUIAutomator and FindsByAccessibilityId
like AppiumDriver.
After upgrading java-client from version 1.1 to any higher version (last one I tried is 1.5), I can't create an AppiumDriver. I get the following error:
java.lang.NoSuchMethodError: org.openqa.selenium.remote.ErrorHandler.(Lorg/openqa/selenium/remote/ErrorCodes;Z)V at io.appium.java_client.AppiumDriver.(AppiumDriver.java:37)
The Selenium version I am using is 2.42.2.
Need a namedTextfield helper to access textfields inside table cells using accessibility labels.Thanks. Same as appium/ruby_lib#100
I have updated the java-client jar and tried to initialise PageFactory as mention below.
PageObject PageObject1 = PageFactory.initElements(new AppiumFieldDecorator(driver),PageObject.class);
But I am getting type mismatch error.
Is there something I am missing ???
Hi All & Jonahss,
In my app, please check the screenshot below.
The object "banana" boxed by red is can be dragged, and the upper red boxed area can put the draggable object into it, I call it drop slot/area.
My work now is drag "banana" draggable object into the drop slot/area.
In past, function "driver.swipe(sx, sy, ex, ey, duration)" can do it.
just set the [sx, sy] to the middle point of "banana"
and
set the [ex, ey] to the middle point of drop slot/area
and
set the duration greater than 1 second, swipe method can move the draggable object to the drop slot/area.
But now, I found that, swipe is can't do it.
How I can implement Drag and Drop in Appium Java-Client?
Add methods to query and set the input method (IME) in Android (spec). Five methods are there:
GET
/wd/hub/session/:sessionId?/ime/available_engines
GET
/wd/hub/session/:sessionId?/ime/active_engine
true
)
GET
/wd/hub/session/:sessionId?/ime/activated
POST
/wd/hub/session/:sessionId?/ime/activate
POST
/wd/hub/session/:sessionId?/ime/deactivate
by some reason driver fails to start with 1.2.0 version or above.
working correctly with 1.1.0
other libs in project:
pls suggest solution.
code:
capabilities = DesiredCapabilities.android();
capabilities.setCapability("automationName", "Appium");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "4.4.2");
capabilities.setCapability("appPackage", "some_package_name");
capabilities.setCapability("appActivity", ".some_app_activity");
fileName = ConfigProperties.getProperty("androidBuild");
File appDir = new File(userDir, fileName);
capabilities.setCapability("app", appDir.getAbsolutePath());
process = Runtime.getRuntime().exec("appium -q");
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Error:
java.lang.NoSuchMethodError: org.openqa.selenium.remote.ErrorHandler.(Lorg/openqa/selenium/remote/ErrorCodes;Z)V
after updating libs to:
error changes to (e.g. with 1.3.0 java client):
ava.lang.NoClassDefFoundError: com/google/gson/JsonParser
at io.appium.java_client.ComplexFind.(ComplexFind.java:16)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:46)
at com.cardola.tests.util.AppiumSetup.getDriver(AppiumSetup.java:117)
at com.cardola.tests.util.AppiumSetup.prepareDriver(AppiumSetup.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:260)
at org.testng.SuiteRunner.run(SuiteRunner.java:223)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039)
at org.testng.TestNG.runSuitesLocally(TestNG.java:964)
at org.testng.TestNG.run(TestNG.java:900)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:110)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonParser
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 28 more
Update pom.xml to selenium-java 2.42.2
with official version of Appium swipe method does not work.
have Android 4.4.2 phone
Example of not working code (made different duration but not working if same also):
((AppiumDriver) driver).swipe(point.x+size.getWidth(),point.y+size.getHeight()/2,
point.x,point.y+size.getHeight()/2,2000);
Working code as workaround:
((JavascriptExecutor) driver).executeScript("mobile: swipe", new HashMap<String, Double>() {{
put("touchCount", (double) 1);
put("startX", (double) gridViewContainer.get(0).getLocation().getX() +
gridViewContainer.get(0).getSize().width);
put("startY", (double) gridViewContainer.get(0).getLocation().getY() +
gridViewContainer.get(0).getSize().height / 2);
put("endX", (double) gridViewContainer.get(0).getLocation().getX());
put("endY", (double) gridViewContainer.get(0).getLocation().getY()
+ gridViewContainer.get(0).getSize().height / 2);
put("duration", 1.0);
}});
Appium logs:
Not working code logs:
2014-05-21T08:36:18.763Z - info: Pushing command to appium work queue: ["swipe",{"startX":1012,"startY":893,"endX":67,"endY":893,"steps":56}]
2014-05-21T08:36:18.763Z - debug: Request received with params: {"actions":[{"action":"press","options":{"y":893,"x":1012}},{"action":"wait","options":{"ms":2000}},{"action":"moveTo","options":{"y":893,"x":67}},{"action":"release","options":{}}]}
2014-05-21T08:36:18.767Z - info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"swipe","params":{"startX":1012,"startY":893,"endX":67,"endY":893,"steps":56}}
2014-05-21T08:36:18.767Z - info: [BOOTSTRAP] [info] Got command of type ACTION
2014-05-21T08:36:18.767Z - info: [BOOTSTRAP] [debug] Got command action: swipe
2014-05-21T08:36:18.769Z - info: [BOOTSTRAP] [info] Swiping from [x=1012.0, y=893.0] to [x=67.0, y=893.0] with steps: 56
2014-05-21T08:36:20.016Z - info: [BOOTSTRAP] [info] Returning result: {"value":true,"status":0}
2014-05-21T08:36:20.017Z - info: Responding to client with success: {"status":0,"value":true,"sessionId":"68a6b5a7-0739-4851-bee2-b00afec82625"}
Working code logs:
2014-05-21T08:36:24.174Z - info: Pushing command to appium work queue: ["swipe",{"startX":1012,"startY":893,"endX":67,"endY":893,"steps":28}]
2014-05-21T08:36:24.173Z - debug: Request received with params: {"args":[{"duration":1,"startX":1012,"touchCount":1,"startY":893,"endX":67,"endY":893}],"script":"mobile: swipe"}
2014-05-21T08:36:24.178Z - info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"swipe","params":{"startX":1012,"startY":893,"endX":67,"endY":893,"steps":28}}
2014-05-21T08:36:24.179Z - info: [BOOTSTRAP] [info] Got command of type ACTION
2014-05-21T08:36:24.180Z - info: [BOOTSTRAP] [debug] Got command action: swipe
2014-05-21T08:36:24.187Z - info: [BOOTSTRAP] [info] Swiping from [x=1012.0, y=893.0] to [x=67.0, y=893.0] with steps: 28
2014-05-21T08:36:24.916Z - info: [BOOTSTRAP] [info] Returning result: {"value":true,"status":0}
2014-05-21T08:36:24.916Z - info: Responding to client with success: {"status":0,"value":true,"sessionId":"68a6b5a7-0739-4851-bee2-b00afec82625"}
POST /wd/hub/session/68a6b5a7-0739-4851-bee2-b00afec82625/execute 200 744ms - 89b
Hello,
I'm trying to find a different way that sending in order the automate the back button.
Thus I tried driver.navigate().back() but that doesn't do anything.
I'm running the 1.4 of Java Client (But also tried it on 1.1).
A bunch of files in https://github.com/appium/java-client/tree/master/target don't need to be checked into version control (for example the .class files).
Currently AppiumDriver doesn't support page factory or objects?
Any workaround with this?
Thanks
I am using java client 1.4.0,I added gson dependency in the pom.xml:
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
run test case,but it display the error:
FAILED CONFIGURATION: @BeforeMethod setUp
java.lang.NoSuchMethodError: org.openqa.selenium.remote.ErrorHandler.<init>(Lorg/openqa/selenium/remote/ErrorCodes;Z)V
at io.appium.java_client.AppiumDriver.<clinit>(AppiumDriver.java:37)
at com.soundrecorder.test.SoundrecorderTest.setUp(SoundrecorderTest.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:653)
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)
things like platformName
, platformVersion
, deviceName
need to be added.
things like platform
, device
, need to be removed.
Hi,
when i am trying perform swipe action on chrome browser.
i am getting below error:
Proxied response received with status 404: "unknown command: session/dac5f1400d5fd5c1396e7010be002a6e/touch/perform
Full log is here:
Here is the full log.
info: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/element","method":"POST","json":{"using":"xpath","value":"//*[@id='Frm1IDE_imagegallery213756257059179_img' and @Index='1']"}}
debug: Request received with params: {"using":"xpath","value":"//*[@id='Frm1IDE_imagegallery213756257059179_img' and @Index='1']"}
debug: Proxying command to 127.0.0.1:9515
debug: Proxied response received with status 200: {"sessionId":"dac5f1400d5fd5c1396e7010be002a6e","status":0,"value":{"ELEMENT":"0.6035820669494569-6"}}
POST /wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/element 200 332ms - 124b
debug: Appium request initiated at /wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/element/0.6035820669494569-6/displayed
info: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/element/0.6035820669494569-6/displayed","method":"GET"}
debug: Request received with params: {}
debug: Proxying command to 127.0.0.1:9515
debug: Proxied response received with status 200: "{"sessionId":"dac5f1400d5fd5c1396e7010be002a6e","status":0,"value":false}"
GET /wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/element/0.6035820669494569-6/displayed 200 329ms - 73b
debug: Appium request initiated at /wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/touch/perform
info: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/touch/perform","method":"POST","json":{"actions":[{"action":"press","options":{"y":400,"x":250}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"y":4,"x":250}},{"action":"release","options":{}}]}}
debug: Request received with params: {"actions":[{"action":"press","options":{"y":400,"x":250}},{"action":"wait","options":{"ms":500}},{"action":"moveTo","options":{"y":4,"x":250}},{"action":"release","options":{}}]}
debug: Proxying command to 127.0.0.1:9515
debug: Proxied response received with status 404: "unknown command: session/dac5f1400d5fd5c1396e7010be002a6e/touch/perform"
POST /wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e/touch/perform 404 6ms - 71b
debug: Appium request initiated at /wd/hub/session/dac5f1400d5fd5c1396e7010be002a6e
info: Shutting down appium session...
debug: Request received with params: {}
info: Killing chromedriver
info: Chromedriver exited with code null
info: (killed by signal SIGTERM)
debug: executing: adb -s emulator-5554 shell "am force-stop com.android.chrome"
info: Cleaning up appium session
AppiumDriver could implement HasTouchScreen interface to bridge the gap between selenium and Appium Touch library
Currently, it is not possible to perform touch gestures when testing hybrid apps and using Selendroid automation back end to drive the tests. This is because the appiums Touch library is not compatible with the Selendroid interface.
Workaround is to subclass the AppiumDriver and implement HasTouchScreen interface and use the selenium WebDriver and selenium TouchActions to perform required actions.
This is the error stack I get:
FAILED: AndroidApp_ReturnUserLogsIn_ValidateMainPage
java.lang.NoClassDefFoundError: org/apache/http/impl/client/HttpClients
at io.appium.java_client.ComplexFind.(ComplexFind.java:15)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:46)
At this line:
driver = new AppiumDriver(url , capabilities);
I just upgraded to Appium 1.0, Selenium 2.41. The version of the java-client of Appium is 1.2.0.
Two methods needed, one to get
the network connection, the other to set
it.
The network connection is specified as a bitmask, the details of which are here. Feel free to make whatever structure would be idiomatic for the values.
Getting the connection (e.g., wd):
GET, /wd/hub/session/:sessionId?/network_connection
Setting the connection (e.g., wd):
POST, /wd/hub/session/:sessionId?/network_connection
with payload like "parameters": { "type": 1 }
complexFind must return an element. Currently a string is returned.
I expect the following method signature:
public WebDriver complexFind(String complex) {
Instead it's
public String complexFind(String[] complex) {
May be i m not doing it right, Please guide me.
((AppiumDriver) wd).swipe(729, 777, 233, 776, 1);
As mentioned in #22
Android 4.4.2
Code:
((AppiumDriver) driver).tap(1,539,893,1000); (where 539, 893 is valid point on screen)
Log:
2014-05-21T09:21:54.373Z - debug: Request received with params: {"actions":[[{"action":"press","options":{"y":893,"x":539}},{"action":"wait","options":{"ms":1000}},{"action":"release","options":{}}]]}
2014-05-21T09:21:54.379Z - info: [BOOTSTRAP] [info] Got command of type ACTION
2014-05-21T09:21:54.379Z - info: [BOOTSTRAP] [debug] Got command action: performMultiPointerGesture
2014-05-21T09:21:54.387Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiDevice" to enable field "mUiAutomationBridge"
2014-05-21T09:21:54.388Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiAutomatorBridge" to enable field "mInteractionController"
2014-05-21T09:21:54.388Z - info: [BOOTSTRAP] [debug] Finding methods on class: class com.android.uiautomator.core.InteractionController
2014-05-21T09:21:54.389Z - info: [BOOTSTRAP] [debug] Exception: java.lang.reflect.InvocationTargetException
2014-05-21T09:21:54.390Z - info: [UIAUTOMATOR STDOUT] java.lang.reflect.InvocationTargetException
2014-05-21T09:21:54.391Z - info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
2014-05-21T09:21:54.391Z - info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invoke(Method.java:515)
2014-05-21T09:21:54.392Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.392Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.handler.MultiPointerGesture.execute(MultiPointerGesture.java:43)
2014-05-21T09:21:54.393Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.393Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.AndroidCommandExecutor.execute(AndroidCommandExecutor.java:97)
2014-05-21T09:21:54.393Z - info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.runCommand(SocketServer.java:195)
2014-05-21T09:21:54.394Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.394Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.SocketServer.handleClientData(SocketServer.java:93)
2014-05-21T09:21:54.395Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.395Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.SocketServer.listenForever(SocketServer.java:137)
2014-05-21T09:21:54.396Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.396Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap.testRunServer(Bootstrap.java:17)
2014-05-21T09:21:54.397Z - info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
2014-05-21T09:21:54.398Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.398Z - info: [UIAUTOMATOR STDOUT] java.lang.reflect.Method.invoke(Method.java:515)
2014-05-21T09:21:54.399Z - info: [UIAUTOMATOR STDOUT] at junit.framework.TestCase.runTest(TestCase.java:168)
2014-05-21T09:21:54.400Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.400Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestCase.runBare(TestCase.java:134)
2014-05-21T09:21:54.407Z - info: [UIAUTOMATOR STDOUT] at junit.framework.TestResult$1.protect(TestResult.java:115)
2014-05-21T09:21:54.408Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.408Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestResult.runProtected(TestResult.java:133)
2014-05-21T09:21:54.409Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.409Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestResult.run(TestResult.java:118)
2014-05-21T09:21:54.409Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.410Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestCase.run(TestCase.java:124)
2014-05-21T09:21:54.412Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.412Z - info: [UIAUTOMATOR STDOUT] com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
2014-05-21T09:21:54.413Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.414Z - info: [UIAUTOMATOR STDOUT] com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
2014-05-21T09:21:54.415Z - info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
2014-05-21T09:21:54.417Z - info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
2014-05-21T09:21:54.418Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.419Z - info: [UIAUTOMATOR STDOUT] com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
2014-05-21T09:21:54.419Z - info: [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
2014-05-21T09:21:54.420Z - info: [UIAUTOMATOR STDOUT] at dalvik.system.NativeStart.main(Native Method)
2014-05-21T09:21:54.420Z - info: [UIAUTOMATOR STDOUT] Caused by:
2014-05-21T09:21:54.420Z - info: [UIAUTOMATOR STDOUT] java.lang.IllegalArgumentException: Must provide coordinates for at least 2 pointers
2014-05-21T09:21:54.422Z - info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.InteractionController.performMultiPointerGesture(InteractionController.java:689)
2014-05-21T09:21:54.422Z - info: [UIAUTOMATOR STDOUT] ...
2014-05-21T09:21:54.423Z - info: [UIAUTOMATOR STDOUT] 23 more
2014-05-21T09:21:54.423Z - info: [BOOTSTRAP] [info] Returning result: {"status":13}
2014-05-21T09:21:54.424Z - info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command."},"sessionId":"0e9637d1-49ce-43c8-a3de-d384f3afdd0c"}
POST /wd/hub/session/0e9637d1-49ce-43c8-a3de-d384f3afdd0c/touch/multi/perform 500 51ms - 176b
For iOS we have found that sometime Appium driver stops abruptly and got the root cause that it crashes whenever it clicks on a disabled 'Back button'.
Expected: it should not crash on clicking on a button if its in disabled state. It should fail with an exception.
Appium exception and logs are given below:
Exception :
java.lang.AssertionError: Element Back key not found. Original Error: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.60 seconds Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32' System info: host: 'NAG1-DMAC-26709', ip: '172.17.10.238', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.8.5', java.version: '1.6.0_65' Session ID: e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff Driver info: io.appium.java_client.AppiumDriver Capabilities [{platform=MAC, app=/Users/Glnagpur/Desktop/Appium_Checkout/FiOS-SanityTestAutomation/TestApp/VZFiOSMobile_New.app, javascriptEnabled=true, browserName=Mac, rotatable=true, udid=4afbda0275e921a0c327e6df5715d2081cc4e1f9, desired={newCommandTimeout=600, platformVersion=7.0, app=/Users/Glnagpur/Desktop/Appium_Checkout/FiOS-SanityTestAutomation/TestApp/VZFiOSMobile_New.app, platformName=iOS, deviceName=iPhone, browserName=Mac, device=iPad, rotatable=true, udid=4afbda0275e921a0c327e6df5715d2081cc4e1f9}, locationContextEnabled=false, newCommandTimeout=600, platformVersion=7.0, databaseEnabled=false, deviceName=iPhone, platformName=iOS, webStorageEnabled=false, device=iPad, warnings={}, takesScreenshot=true}] expected [true] but found [false] at reusableComponets.AppiumMethods.click_On_Element(AppiumMethods.java:108) at iOSTests.IphoneTests.test10_DRM_Player_Verification_MyLibraryScreen(IphoneTests.java:455) ... Removed 27 stack frames
Appium logs :
debug: Request received with params: {"using":"name","value":"TopBarBackButton"}
debug: Pushing command to appium work queue: "au.getElementByName('TopBarBackButton')"
debug: Sending command to instruments: au.getElementByName('TopBarBackButton')
debug: Sending command to instruments: au.getElementByName('TopBarBackButton')
debug: [INST] 2014-07-21 11:49:35 +0000 Debug: Got new command 49 from instruments: au.getElementByName('TopBarBackButton')
debug: [INST] 2014-07-21 11:49:35 +0000 Debug: evaluating au.getElementByName('TopBarBackButton')
debug: [INST] 2014-07-21 11:49:35 +0000 Debug: Lookup returned [object UIAButton] with the name "TopBarBackButton" (id: 16).
debug: [INST] 2014-07-21 11:49:35 +0000 Debug: evaluation finished
debug: [INST] 2014-07-21 11:49:35 +0000 Debug: Running system command #50: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"16"}}...
debug: Socket data received (39 bytes)
debug: Socket data being routed.
debug: Got result from instruments: {"status":0,"value":{"ELEMENT":"16"}}
debug: Responding to client with success: {"status":0,"value":{"ELEMENT":"16"},"sessionId":"e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff"}
info: <-- POST /wd/hub/session/e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff/element 200 1196.124 ms - 88 {"status":0,"value":{"ELEMENT":"16"},"sessionId":"e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff"}
debug: Appium request initiated at /wd/hub/session/e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff/element/16/click
info: --> POST /wd/hub/session/e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff/element/16/click {"id":"16"}
debug: Request received with params: {"id":"16"}
debug: Pushing command to appium work queue: "au.tapById('16')"
debug: Sending command to instruments: au.tapById('16')
debug: Sending command to instruments: au.tapById('16')
debug: [INST] 2014-07-21 11:49:36 +0000 Debug: Got new command 50 from instruments: au.tapById('16')
debug: [IOS_SYSLOG_ROW ] Jul 21 17:19:36 OS704 MobileGestaltHelper[76] : libMobileGestalt MobileGestalt.c:267: server_access_check denied access to question UniqueDeviceID for pid 1007
debug: [IOS_SYSLOG_ROW ] Jul 21 17:19:36 OS704 ScriptAgent[1007] : libMobileGestalt MobileGestaltSupport.m:167: pid 1007 (ScriptAgent) does not have sandbox access for re6Zb+zwFKJNlkQTUeT+/w and IS NOT appropriately entitled
debug: [IOS_SYSLOG_ROW ] Jul 21 17:19:36 OS704 ScriptAgent[1007] : libMobileGestalt MobileGestalt.c:528: no access to UniqueDeviceID (see rdar://problem/11744455)
debug: [INST] 2014-07-21 11:49:36 +0000 Debug: evaluating au.tapById('16')
debug: [INST] 2014-07-21 11:49:36 +0000 Debug: UIAButton.tap()
debug: [INST] 2014-07-21 11:49:36 +0000 Debug: UIAButton could not be tapped
debug: [INST] 2014-07-21 11:49:36 +0000 Debug: evaluation finished
debug: [INST] 2014-07-21 11:49:36 +0000 Debug: Running system command #51: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":13,"value":"elementId 16 could not be tapped"}...
debug: Socket data received (58 bytes)
debug: Socket data being routed.
debug: Got result from instruments: {"status":13,"value":"elementId 16 could not be tapped"}
debug: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"elementId 16 could not be tapped"},"sessionId":"e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff"}
info: <-- POST /wd/hub/session/e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff/element/16/click 500 1078.717 ms - 201
debug: Appium request initiated at /wd/hub/status
info: --> GET /wd/hub/status {}
debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":{"build":{"version":"1.2.0","revision":"e53f49c706a25242e66d36685c268b599cc18da5"}},"sessionId":"e4b4e1bd-e585-43ca-bbe6-0bc3168a90ff"}
I am using latest Appium 1.1.0, java-client 1.2.1 and swipe is not working. I am using below line for swiping.
driver.swipe(165, 263, 165, 400, 800);
Coordinates are there for sure on page. Also logs does not provide any error message. There is UI button on Appium inspector which says "swipe", Clicking on it also does not work. Please help if there is a work around.
Alternative was to use scrollTo, but scrollto is also not working as of now, It did not worked for me at least.
Hello,
implement scrolling to an element instead of using the deprecated method complexFind.
I can help with some guidance.
/wd/hub/session/:sessionId?/appium/device/pull_folder
expects {path: String path}
Returns a zip file of the contents of the folder. base63 encoded.
Hello!
Selenium 2.42.0 got released last week and I have problems running my tests since the upgrade. Any ideas?
I get the following exception:
java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.transformValues(Lcom/google/common/collect/ListMultimap;Lcom/google/common/base/Function;)Lcom/google/common/collect/ListMultimap;
at com.google.common.net.MediaType.toString(MediaType.java:668)
at org.openqa.selenium.remote.http.JsonHttpCommandCodec.encode(JsonHttpCommandCodec.java:194)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:152)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:81)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:127)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:43)
at com.acceptanceFW.Utils.SetUp.getIPadSimulatorDriver(SetUp.java:41)
at com.acceptanceFW.Utils.SetUp.getDriver(SetUp.java:21)
at com.acceptanceFW.BaseTest.setUp(BaseTest.java:70)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runners.Suite.runChild(Suite.java:127)
at org.junit.runners.Suite.runChild(Suite.java:26)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Kind regards,
Philipp
Hello,
why is the app automatically installed and launched when an AppiumDriver instance is being created? There are also two methods installApp(url) and launchApp(). It would be very useful when the app is only installed/launched, when calling these methods and not implicitly by the constructor.
When i execute driver.sendKeyEvent(66);
i get this error "org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (Original error: Command failed: remote object '/data/local/tmp/local/tmp/dump.xml' does not exist"
Appium Version 1.1
Appium Logs
Java client version 1.4.0
info: Responding to client with success: {"status":0,"value":true,"sessionId":"e069ca7b-2bb3-42b0-99ec-680eba4e612d"}
POST /wd/hub/session/e069ca7b-2bb3-42b0-99ec-680eba4e612d/element/16/value 200 2799ms - 89b
debug: Appium request initiated at /wd/hub/session/e069ca7b-2bb3-42b0-99ec-680eba4e612d/appium/device/keyevent
info: Pushing command to appium work queue: ["pressKeyCode",{"keycode":66,"metastate":null}]
debug: Request received with params: {"keycode":66}
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"pressKeyCode","params":{"keycode":66,"metastate":null}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: pressKeyCode
info: [BOOTSTRAP] [info] Returning result: {"value":true,"status":0}
info: Responding to client with success: {"status":0,"value":true,"sessionId":"e069ca7b-2bb3-42b0-99ec-680eba4e612d"}
POST /wd/hub/session/e069ca7b-2bb3-42b0-99ec-680eba4e612d/appium/device/keyevent 200 1234ms - 89b
debug: Appium request initiated at /wd/hub/session/e069ca7b-2bb3-42b0-99ec-680eba4e612d/element
info: Pushing command to appium work queue: ["dumpWindowHierarchy"]
debug: Request received with params: {"using":"xpath","value":"//android.widget.ListView[1]/android.widget.RelativeLayout[4]"}
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"dumpWindowHierarchy","params":{}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: dumpWindowHierarchy
info: [UIAUTOMATOR STDOUT] java.lang.NullPointerException
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.AccessibilityNodeInfoDumper.childNafCheck(AccessibilityNodeInfoDumper.java:200)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] com.android.uiautomator.core.AccessibilityNodeInfoDumper.nafCheck(AccessibilityNodeInfoDumper.java:180)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:104)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:129)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:129)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:129)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpNodeRec(AccessibilityNodeInfoDumper.java:129)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] com.android.uiautomator.core.AccessibilityNodeInfoDumper.dumpWindowToFile(AccessibilityNodeInfoDumper.java:89)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.UiDevice.dumpWindowHierarchy(UiDevice.java:768)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.DumpWindowHierarchy.dump(DumpWindowHierarchy.java:39)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.DumpWindowHierarchy.execute(DumpWindowHierarchy.java:62)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidCommandExecutor.execute(AndroidCommandExecutor.java:94)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.runCommand(SocketServer.java:170)
debug: transferPageSourceXML command: "/Users/gauri/Downloads/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb" -s BH905HF106 pull /data/local/tmp/local/tmp/dump.xml "/var/folders/54/4f2gmt9j0gd8h_v3grq2v7ww0000gn/T/11468-13162-mnzlxt.xml"
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.handleClientData(SocketServer.java:91)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.listenForever(SocketServer.java:135)
info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.Bootstrap.testRunServer(Bootstrap.java:17)
info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invoke(Method.java:525)
info: [UIAUTOMATOR STDOUT] at junit.framework.TestCase.runTest(TestCase.java:168)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] junit.framework.TestCase.runBare(TestCase.java:134)
info: [UIAUTOMATOR STDOUT] at junit.framework.TestResult$1.protect(TestResult.java:115)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] junit.framework.TestResult.runProtected(TestResult.java:133)
info: [UIAUTOMATOR STDOUT] at junit.framework.TestResult.run(TestResult.java:118)
info: [UIAUTOMATOR STDOUT] at junit.framework.TestCase.run(TestCase.java:124)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
info: [UIAUTOMATOR STDOUT] at
info: [UIAUTOMATOR STDOUT] dalvik.system.NativeStart.main(Native Method)
info: [BOOTSTRAP] [info] Returning result: {"value":false,"status":0}
warn: remote object '/data/local/tmp/local/tmp/dump.xml' does not exist
info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command. (Original error: Command failed: remote object '/data/local/tmp/local/tmp/dump.xml' does not exist\n)","killed":false,"code":1,"signal":null,"origValue":"Command failed: remote object '/data/local/tmp/local/tmp/dump.xml' does not exist\n"},"sessionId":"e069ca7b-2bb3-42b0-99ec-680eba4e612d"}
POST /wd/hub/session/e069ca7b-2bb3-42b0-99ec-680eba4e612d/element 500 215ms - 438b
debug: Appium request initiated at /wd/hub/session/e069ca7b-2bb3-42b0-99ec-680eba4e612d
info: Shutting down appium session...
debug: Request received with params: {}
debug: executing: "/Users/gauri/Downloads/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb" -s BH905HF106 shell "input keyevent 3"
info: [ADB] Pressing the HOME button
info: Stopping logcat capture
debug: Logcat terminated with code null, signal SIGTERM
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"shutdown"}
info: [BOOTSTRAP] [info] Got command of type SHUTDOWN
info: [BOOTSTRAP] [info] Returning result: {"value":"OK, shutting down","status":0}
info: [BOOTSTRAP] [info] Closed client connection
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [UIAUTOMATOR STDOUT] Time: 35.447
info: [UIAUTOMATOR STDOUT] OK (1 test)
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: Sent shutdown command, waiting for UiAutomator to stop...
info: UiAutomator shut down normally
info: Cleaning up android objects
info: Cleaning up appium session
info: Responding to client with success: {"status":0,"value":null,"sessionId":"e069ca7b-2bb3-42b0-99ec-680eba4e612d"}
DELETE /wd/hub/session/e069ca7b-2bb3-42b0-99ec-680eba4e612d
have still same problem as in #33 ticket with latest Appium and java client 1.3.0
in code: tap(1,x,y,1)
in logs:
2014-06-18T12:22:59.747Z - info: Pushing command to appium work queue: ["performMultiPointerGesture",{"actions":[[{"touch":{"x":540,"y":1140},"time":0.005},{"touch":{"x":540,"y":1140},"time":0.006}]]}]
2014-06-18T12:22:59.755Z - info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"performMultiPointerGesture","params":{"actions":[[{"touch":{"x":540,"y":1140},"time":0.005},{"touch":{"x":540,"y":1140},"time":0.006}]]}}
2014-06-18T12:22:59.746Z - debug: Appium request initiated at /wd/hub/session/321e5dd2-5718-40b0-b65f-faf18607f275/touch/multi/perform
2014-06-18T12:22:59.746Z - debug: Request received with params: {"actions":[[{"action":"press","options":{"y":1140,"x":540}},{"action":"wait","options":{"ms":1}},{"action":"release","options":{}}]]}
.....
2014-06-18T12:22:59.776Z - info: [UIAUTOMATOR STDOUT] Caused by: java.lang.IllegalArgumentException: Must provide coordinates for at least 2 pointers
2014-06-18T12:22:59.776Z - info: [UIAUTOMATOR STDOUT] at
2014-06-18T12:22:59.777Z - info: [UIAUTOMATOR STDOUT] com.android.uiautomator.core.InteractionController.performMultiPointerGesture(InteractionController.java:689)
2014-06-18T12:22:59.777Z - info: [UIAUTOMATOR STDOUT] ... 23
2014-06-18T12:22:59.777Z - info: [UIAUTOMATOR STDOUT] more
2014-06-18T12:22:59.777Z - info: [BOOTSTRAP] [info] Returning result: {"status":13}
2014-06-18T12:22:59.778Z - info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command."},"sessionId":"321e5dd2-5718-40b0-b65f-faf18607f275"}
POST /wd/hub/session/321e5dd2-5718-40b0-b65f-faf18607f275/touch/multi/perform 500 32ms - 176b
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)
I added the selenium 2.41.0 jar to the build path and also added the jar-client to the build path but i am still getting this error "The method findElementsByAccessibilityId(String) is undefined for the type Object"
When i use findElementsByAccessibilityId, any help would be appreciated
Hi,
I couldn't setLocation to android device nor iOS based. As I read setLocation is implemented into Appium. Are there any chance that this will be implemented?
How to setup "nativeWebTap" capability in Java test script?
I found that no variable under "MobileCapabilityType" is similar to "nativeWebTap".
---------> Java Code:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.1");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
---------> Java Code End
POST
to /wd/hub/session/:sessionId?/appium/device/open_notifications
with no data.
if equals()
returns true
for two WebElement objects, their hashcode()
should be the same.
(Though I'm pretty sure WebElement objects don't actually return true
on equals()
)
see: appium/appium#2404
Hi,
I got error when I got contexts in Java, detail below, could you kindly help to check it on this>
Java-Client version: 1.2.1
Java code:
Set contexts = driver.getContextHandles(); //Errors here
for(String context : contexts) //debug
System.out.println(context);
Error Log:
java.lang.Error: Unresolved compilation problem:
The method getContextHandles() of type AppiumDriver must override a superclass method
at io.appium.java_client.AppiumDriver.getContextHandles(AppiumDriver.java:492)
at com.BDemo.testRun(Demo.java:71)
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)
On WebRemoteDriver it is possible to swipe using percentages (values between 0 and 1) and on AppiumDriver it is not.
I'm using different Mobile devices and i cannot use the same coordinates for all of them.
What's my best solution here?
/**
Convenience method for swiping across the screen
@param startx starting x coordinate
@param starty starting y coordinate
@param endx ending x coordinate
@param endy ending y coordinate
@param duration amount of time in milliseconds for the entire swipe action to take
*/
public void swipe(int startx, int starty, int endx, int endy, int duration) {
TouchAction touchAction = new TouchAction(this);
//appium converts press-wait-moveto-release to a swipe action
touchAction.press(startx, starty).waitAction(duration).moveTo(endx, endy).release();
touchAction.perform();
}
When setting up my AppiumDriver class, I am getting the following error. Using v 1.2.1 and appium 1.0, selenium 2.42.
capabilities...
capabilities.setCapability("automationName", "Selendroid");
capabilities.setCapability("appActivity", "com.alpinemetrics.AlpineMetrics");
capabilities.setCapability("takesScreenshot", true);
capabilities.setCapability("version", "4.4");
capabilities.setCapability("app", this.AndroidAppLocation);
capabilities.setCapability(this.WebViewString, true);
capabilities.setCapability("device-orientation", "portrait");
java.lang.NoClassDefFoundError: com/google/gson/JsonParser
at io.appium.java_client.ComplexFind.(ComplexFind.java:16)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:46)
at com.alpinemetrics.MobileTestRunner.SetUpRemoteWebDriver(MobileTestRunner.java:191)
at com.alpinemetrics.AppiumTests.setUp(AppiumTests.java:28)
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:483)
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)
Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonParser
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 28 more
Seems like the device rotation is broken? (using this method)
May 05, 2014 2:09:37 PM org.openqa.selenium.remote.Augmenter extractRemoteWebDriver
WARNING: Augmenter should be applied to RemoteWebDriver instances or previously augmented instances only
java.lang.ClassCastException: io.appium.java_client.AppiumDriver cannot be cast to org.openqa.selenium.Rotatable
at com.dynatrace.acceptanceFW.HomeScreenNavigationTest.basicHomeScreenNavigationTest(HomeScreenNavigationTest.java:53)
See also: https://groups.google.com/forum/#!topic/appium-discuss/DrvbMoVWBJs
Kind regards,
Philipp
steps:
client 1.4.0 just fails to do this with e.g.
driver.tap(1,100,100,1000)
pop-up borders: [27,622][1053,1154]
So there is no way to tap outside client pop-up borders?
logs:
2014-06-19T11:21:26.107Z - info: Pushing command to appium work queue: ["element:touchDown",{"x":100,"y":100}]
2014-06-19T11:21:26.110Z - info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"element:touchDown","params":{"x":100,"y":100}}
2014-06-19T11:21:26.110Z - info: [BOOTSTRAP] [info] Got command of type ACTION
2014-06-19T11:21:26.110Z - info: [BOOTSTRAP] [debug] Got command action: touchDown
2014-06-19T11:21:26.112Z - info: [BOOTSTRAP] [debug] Performing TouchDown using element? false x: 100, y: 100
2014-06-19T11:21:26.112Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiDevice" to enable field "mUiAutomationBridge"
2014-06-19T11:21:26.113Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiAutomatorBridge" to enable field "mInteractionController"
2014-06-19T11:21:26.113Z - info: [BOOTSTRAP] [debug] Finding methods on class: class com.android.uiautomator.core.InteractionController
2014-06-19T11:21:26.106Z - debug: Request received with params: {"actions":[{"action":"press","options":{"y":100,"x":100}},{"action":"wait","options":{"ms":1000}},{"action":"release","options":{}}]}
2014-06-19T11:21:26.124Z - info: [BOOTSTRAP] [info] Returning result: {"value":true,"status":0}
2014-06-19T11:21:27.125Z - info: Pushing command to appium work queue: ["element:touchUp",{}]
2014-06-19T11:21:27.135Z - info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"element:touchUp","params":{}}
2014-06-19T11:21:27.135Z - info: [BOOTSTRAP] [info] Got command of type ACTION
2014-06-19T11:21:27.136Z - info: [BOOTSTRAP] [debug] Got command action: touchUp
2014-06-19T11:21:27.136Z - info: [BOOTSTRAP] [debug] Performing TouchUp using element? false x: 540, y: 888
2014-06-19T11:21:27.137Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiDevice" to enable field "mUiAutomationBridge"
2014-06-19T11:21:27.137Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiAutomatorBridge" to enable field "mInteractionController"
2014-06-19T11:21:27.137Z - info: [BOOTSTRAP] [debug] Finding methods on class: class com.android.uiautomator.core.InteractionController
2014-06-19T11:21:27.138Z - info: [BOOTSTRAP] [info] Returning result: {"value":"Failed to execute touch event","status":13}
2014-06-19T11:21:27.139Z - info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Failed to execute touch event"},"sessionId":"83f5b57b-e15f-43ad-9dc3-819815c2998f"}
POST /wd/hub/session/83f5b57b-e15f-43ad-9dc3-819815c2998f/touch/perform 500 1035ms - 226b
Now you may pass:
For backward compatibility
hide_keyboard {} ~ tapOutside
hide_keyboard {keyName: }
New:
hide_keyboard {strategy: , key: }
For instance
hide_keyboard {strategy: "pressKey", key: "Done"}
hide_keyboard {strategy: "tapOutside"}
I am starting appium process in code:
appium = new ProcessBuilder("appium");
appium.redirectErrorStream(true);
process = appium.start();
Problem:
after some time of test execution server just stop responding. it is always stops on same X line of code and it is does not matter what command it is.
if add some commands before X line then test will be stop on X-added_commands_number. It is just hanging without any error (i am starting test with intelliJ).
Workaround:
start appium manually in console or via UI Appium application
Another workaround (but this is not case):
is to make tests shorter and kill appium process with "process.destroy()"
It is look like there is some limit on test steps.... maybe logs buffer overflow...
sorry do not know is it more java-client or appium server issue. pls suggest.
Touches outside the bounds of the screen fail with this log entry:
{"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"}
It would be nicer if java-client returned a more useful error than the "unknown error" it currently returns.
In response to issue #15
When i execute this command driver.sendKeyEvent(66);
I get this error in eclipse
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (Original error: Command failed: remote object '/data/local/tmp/local/tmp/dump.xml' does not exist
It didn't work in previous versions, but I was hoping it would be fixed by now. I just updated to 1.4.0 and there's still a problem with using the installApp() method. This is the error I get:
org.openqa.selenium.WebDriverException: ERROR running Appium command: string is not a function
Command duration or timeout: 7 milliseconds
Build info: version: '2.42.0', revision: '5e824302019c86eae9c8c3ca9155e7307b410cf8', time: '2014-05-24 09:48:41'
System info: host: 'PC', ip: '172.18.1.14', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0'
Driver info: io.appium.java_client.AppiumDriver
Capabilities [{app=MdnFetcher.apk, appPackage=com.example.MdnFetcher, warnings={}, appWaitActivity=.MyActivity, databaseEnabled=false, version=, platform=XP, appActivity=.MyActivity, desired={app=MdnFetcher.apk, appPackage=com.example.MdnFetcher, appActivity=.MyActivity, newCommandTimeout=300, autoLaunch=false, platformVersion=4.4.2, appWaitActivity=.MyActivity, browserName=, platformName=Android, version=, platform=Windows}, newCommandTimeout=300, autoLaunch=false, platformVersion=4.4.2, webStorageEnabled=false, browserName=, takesScreenshot=true, javascriptEnabled=true, platformName=Android}]
Session ID: c9148407-5281-44f8-bea6-289392dc6ce3
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:76)
at io.appium.java_client.AppiumDriver.installApp(AppiumDriver.java:397)
I posted in appium issues forum but didn't get enough response after some time.
As I am relying on java-client, thought of posting to minimal audience.
Any help on this issue will be helpful.
appium/appium#2392
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.