环境:
环境:iMac 10.11.3
jar:java-client-3.4.0.jar+selenium-java-2.5.3.jar+selenium-server-standalone-2.53.0.jar
设备:真机 iphone5s+9.2.1 已将被测 app 安装到手机
问题:
MAC 真机运行 appium 执行 click 时报错
org.openqa.selenium.WebDriverException: undefined status object (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 974 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'zhanxxxxxMac.local', ip: '10.xxxx.3.236', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.8.0_40'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities [{app=/xxxx/apps/ktplay_sdk_sample.app, networkConnectionEnabled=false, warnings={}, bundleId=com.xxxx.sxxtest, databaseEnabled=false, deviceName=Sxxxxx, platform=MAC, desired={app=/xxxxx/apps/ktplay_sdk_sample.app, platformVersion=9.2.1, bundleId=com.xxxx.xxxx, browserName=ios, unicodeKeyboard=true, udid=c0574e05465xxxxxxxf2c9a628, platformName=iOS, deviceName=xxxxx, platform=MAC, resetKeyboard=true}, platformVersion=9.2.1, webStorageEnabled=false, locationContextEnabled=false, browserName=ios, takesScreenshot=true, javascriptEnabled=true, unicodeKeyboard=true, udid=xxxxxxxx, platformName=iOS, resetKeyboard=true}]
Session ID: 115e47a8-bfdc-4bb3-92c2-65038c343638
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:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
at io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:44)
at io.appium.java_client.MobileElement.execute(MobileElement.java:1)
at io.appium.java_client.ios.IOSElement.execute(IOSElement.java:1)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85)
at com.xxxx.xxxxx.AppiumTest.testUIComputation(AppiumTest.java:74)
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:497)
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.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
代码
界面
无 web 相关
** 解决方法 **:
像 click,sendkeys 这些方法 在测试 ios 时都会报这个错,使用 IOSElement 的就没有问题,比如使用 tap 而不是 click,使用 setValue 而不是 sendKeys