Summary of Some Problems in testing ios applications using the appium tool in java

Source: Internet
Author: User
Tags appium

Summary of Some Problems in testing ios applications using the appium tool in java

Question 1

Version 1.3.7 seems to have a bug. You need to replace this file and go to the installation directory of apium to modify the node_modules/appium/node_modules/node-idevice file. Otherwise, the following error occurs. I don't know when to fix this bug ..

Org. openqa. selenium. SessionNotCreatedException: A new session cocould not be created. (Original error: cocould not initialize ideviceinstaller; make sure it is installed and works on your system) (WARNING: The server did not provide any stacktrace information)

Question 2

Running in java code always reports an error.

Org. openqa. selenium. sessionNotCreatedException: A new session cocould not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 924 milliseconds
Build info: version: '2. 41.0 ', revision: '3192d8a6c4449dc285928bas02d4779344f5423c58', time: '2017-03-27 11:29:39'
System info: host: 'appledemacbook. local', ip: '10. 209.95.157 ', OS. name: 'mac OS x', OS. arch: 'x86 _ 64', OS. version: '10. 9.5 ', java. version: '1. 8.0 _ 25'
Driver info: io. appium. java_client.ios.IOSDriver
At sun. reflect. NativeConstructorAccessorImpl. newInstance0 (Native Method)
At sun. reflect. nativeconstruct%cessorimpl. newInstance (nativeconstruct%cessorimpl. java: 62)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 408)
At org. openqa. selenium. remote. ErrorHandler. createThrowable (ErrorHandler. java: 204)
At org. openqa. selenium. remote. ErrorHandler. throwIfResponseFailed (ErrorHandler. java: 156)
At org.openqa.selenium.remote.RemoteWebDriver.exe cute (RemoteWebDriver. java: 599)
At io.appium.java_client.AppiumDriver.exe cute (AppiumDriver. java: 180)
At org. openqa. selenium. remote. RemoteWebDriver. startSession (RemoteWebDriver. java: 240)
At org. openqa. selenium. remote. RemoteWebDriver. (RemoteWebDriver. java: 126)
At org. openqa. selenium. remote. RemoteWebDriver. (RemoteWebDriver. java: 153)
At io. appium. java_client.AppiumDriver. (AppiumDriver. java: 109)
At io. appium. java_client.ios.IOSDriver. (IOSDriver. java: 23)
At com. sina. lepai. testcase. BaseTestCase. setUp (BaseTestCase. java: 22)
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. 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. 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)


Java. lang. NullPointerException
At com. sina. lepai. testcase. BaseTestCase. tearDown (BaseTestCase. java: 27)
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. 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. RunAfters. evaluate (RunAfters. java: 33)
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)

The reason is that this cannot be opened. I am crying.

If inspector is enabled and then java code is opened, an error is returned. You can only open one.

Question 3

I tried to write

 

driver.launchApp();

 

This error occurs again...

Org. openqa. selenium. WebDriverException: Unable to launch the app: Error: Trying to start a session but instruments is still around und (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 35 milliseconds
Build info: version: '2. 41.0 ', revision: '3192d8a6c4449dc285928ba02444479344f5423c58', time: '2017-03-27 11:29:39'
System info: host: 'appledemacbook. local', ip: '10. 209.95.157 ', OS. name: 'mac OS x', OS. arch: 'x86 _ 64', OS. version: '10. 9.5 ', java. version: '1. 8.0 _ 25'
Driver info: io. appium. java_client.ios.IOSDriver
Capabilities [{app = zjq. sina. lepai, networkConnectionEnabled = false, warnings = {}, databaseEnabled = false, deviceName = iPhone 4S, platform = MAC, desired = {app = zjq. sina. lepai, appium-version = 1.0, platformVersion = 8.1.2, platformName = iOS, deviceName = iPhone 4S}, appium-version = 1.0, platformVersion = 8.1.2, webStorageEnabled = false, locationContextEnabled = false, browserName = iOS, takesScreenshot = true, javascriptEnabled = true, platformName = iOS}]
Session ID: 8251d069-f861-4281-a354-e954777b5423
At sun. reflect. NativeConstructorAccessorImpl. newInstance0 (Native Method)
At sun. reflect. nativeconstruct%cessorimpl. newInstance (nativeconstruct%cessorimpl. java: 62)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 408)
At org. openqa. selenium. remote. ErrorHandler. createThrowable (ErrorHandler. java: 204)
At org. openqa. selenium. remote. ErrorHandler. throwIfResponseFailed (ErrorHandler. java: 156)
At org.openqa.selenium.remote.RemoteWebDriver.exe cute (RemoteWebDriver. java: 599)
At io.appium.java_client.AppiumDriver.exe cute (AppiumDriver. java: 180)
At io.appium.java_client.AppiumDriver.exe cute (AppiumDriver. java: 185)
At io. appium. java_client.AppiumDriver.launchApp (AppiumDriver. java: 233)
At com. sina. lepai. testcase. BaseTestCase. first (BaseTestCase. java: 32)
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. 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)

A newbie is really sorry .. The problems and solutions will be updated continuously.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.