Appium 1.6.3 in Xcode 8, IOS 10.2 (simulator) test Environment Building Experience Summary
About Appium 1.6.3 in Xcode 8, 10.2 of the problems on the iOS simulator, I almost give up, and finally run successfully, it is not easy, so write an article, for your reference, so that everyone less detours.
First, install the Appium
(1) Install the NODE-JS first and then install it via the NODE-JS command Appium
Download MacOS Installer (. pkg) installation in https://nodejs.org/en/download/, because it's simple, hassle free, don't configure environment variables, click Follow Wizard to finish.
After installation, at the command line Terminal npm-v, view the Node-js version, is currently 3.10.10
(2) Installation Appium
Command line terminal NPM install-g appium
We need to be patient when it takes a while to execute.
problems that may occur:It is recommended to terminate the installation (CONTROL+C) while the wait is stuck, and then try again. If not, install sudo npm install-g appium with higher privileges and can basically install successfully.
second, installation-related dependencies
(1) Installation homebrew(For homebrew Introduction, see Installing Homebrew)
Homebrew installation is very simple, open the terminal copy, paste the following command, enter, done (please rest assured that the original official installation method handling)
Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"
The following prompt indicates that the installation was successful:
==> Next steps:
-Run ' brew help ' to get started
-Further documentation:
http://docs.brew.sh
(2) Installation Carthage, installation via homebrew
Brew Install Carthage
(3) installation Webpack
NPM i-g Webpack
A very important, and webdriveragent related, no this will error: Unable to create new remote session
Installation Webpack Error:
NPM err! Darwin 16.4.0
NPM err! argv "/usr/local/bin/node" "/USR/LOCAL/BIN/NPM" "I" "-G" "Webpack"
NPM err! Node v6.10.1
NPM err! NPM v3.10.10
NPM err! Path/usr/local/lib/node_modules
NPM err! Code eacces
NPM err! Errno-13
NPM err! Syscall Access
NPM err! Error:EACCES:permission denied, access '/usr/local/lib/node_modules '
NPM err! At Error (native)
NPM err! {Error:EACCES:permission denied, access '/usr/local/lib/node_modules '
NPM err! At Error (native)
NPM err! errno:-13,
NPM err! Code: ' Eacces ',
NPM err! Syscall: ' Access ',
NPM err! Path: '/usr/local/lib/node_modules '}
NPM err!
NPM err! Please try running the This command again as Root/administrator.
NPM err! Darwin 16.4.0
NPM err! argv "/usr/local/bin/node" "/USR/LOCAL/BIN/NPM" "I" "-G" "Webpack"
NPM err! Node v6.10.1
NPM err! NPM v3.10.10
NPM err! Path npm-debug.log.2786948488
NPM err! Code eacces
NPM err! Errno-13
NPM err! Syscall Open
NPM err! Error:EACCES:permission denied, open ' npm-debug.log.2786948488 '
NPM err! At Error (native)
NPM err! {Error:EACCES:permission denied, open ' npm-debug.log.2786948488 '
NPM err! At Error (native)
NPM err! errno:-13,
NPM err! Code: ' Eacces ',
NPM err! Syscall: ' Open ',
NPM err! Path: ' npm-debug.log.2786948488 '}
NPM err!
NPM err! Please try running the This command again as Root/administrator.
NPM err! Please include the following file with any support request:
NPM err! /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/webdriveragent/npm-debug.log
The wrong meaning is that the/usr/local/lib/node_modules directory permission is denied
Workaround: Enter/usr/local/lib/node_modules execution: sudo chmod-r a+rwx. (Give this directory all files, folders Read and write executable permissions)
(4) Installation webdriveragent dependent
Entry directory: cd/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/webdriveragent/
Create directory: Mkdir-p resources/webdriveragent.bundle
Execution:./scripts/bootstrap.sh-d
This is the end of the dependent installation on the Mac side.
Third, IOS 10.2 simulator
Need to install iOS 10.2 iPhone 7 Simulator (this article is for 10.2 iOS simulator test, Xcode is 8.2.1).
iv. Appium Test started, based on Java.
(1) You need to download the latest Selenium-server-standalone-3.3.1.jar;java-client-5.0.0-beta6.jar and add the references in the Eclise project.
(2) Create a new unit test, such as:
[Java]View PlainCopy
- Package com.conversant.cheersApptest;
- Import Io.appium.java_client.ios.IOSDriver;
- Import Io.appium.java_client.remote.MobileCapabilityType;
- Import Org.openqa.selenium.By;
- Import org.openqa.selenium.remote.DesiredCapabilities;
- Import java.net.MalformedURLException;
- Import Java.net.URL;
- Import Java.util.concurrent.TimeUnit;
- Import Junit.framework.TestCase;
- Public class AppCheersTest1 extends testcase{
- private Iosdriver WD;
- Public AppCheersTest1 () {
- }
- public void Test1 () throws interruptedexception{
- Desiredcapabilities capabilities = new Desiredcapabilities ();
- Capabilities.setcapability ("appium-version", "1.6");
- Capabilities.setcapability ("PlatformName", "IOS");
- Capabilities.setcapability ("platformversion", "10.2");
- Capabilities.setcapability ("devicename", "IPhone 7");
- Capabilities.setcapability ("Newcommandtimeout",60000);
- Capabilities.setcapability ("Launchtimeout",60000);
- Capabilities.setcapability (Mobilecapabilitytype.automation_name, "xcuitest");
- Capabilities.setcapability ("app", "/users/***/desktop/cheers_appium/cheersapp.app");
- try {
- WD =New Iosdriver (new URL ("Http://127.0.0.1:4723/wd/hub"), capabilities);
- } catch (Malformedurlexception e) {
- //TODO auto-generated catch block
- E.printstacktrace ();
- }
- Wd.manage (). Timeouts (). implicitlywait (timeunit.seconds);
- System.out.println ("**********************cheers Li Appium testing ******************************");
- Wd.close ();
- }
- }
(3) Start Appium server. Command Terminal: Appium
Such as:
[Appium] Welcome to Appium v1.6.3
[Appium] Appium REST HTTP Interface listener started on 0.0.0.0:4723
(4) Run the test, you can see the effect in the simulator.
V. Summary
Finally, a lot of problems, are the permissions and the problem of dependency packages, these problems solved, natural appium 1.6.3 in the Mac Xcode8.2.1 and iOS 10.2 simulator can run smoothly.
There are some problems in the process:(1) executing the test in Eclipse, the simulator constantly restarts (2) The simulator starts up, it is not connected to the simulator (3) The app does not start in the simulator
If you follow the operation of my article, in general, there should be no problem.
The final explanation is: Xcode8 above, UI Automation was removed, and after Xcode 8, the app from Appium1.6.0 was tested based on the xcuitest of the Facebook Webdriver protocol.
This article is of great help to me, we can also refer to:
Org.openqa.selenium.SessionNotCreatedException:Unable to create new remote session [SOLVED]
"Turn 1" Appium 1.6.3 in Xcode 8, IOS 10.2 (Simulator) test Environment Build Experience summary