"Turn 1" Appium 1.6.3 in Xcode 8, IOS 10.2 (Simulator) test Environment Build Experience summary

Source: Internet
Author: User
Tags create directory appium

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
  1. Package com.conversant.cheersApptest;
  2. Import Io.appium.java_client.ios.IOSDriver;
  3. Import Io.appium.java_client.remote.MobileCapabilityType;
  4. Import Org.openqa.selenium.By;
  5. Import org.openqa.selenium.remote.DesiredCapabilities;
  6. Import java.net.MalformedURLException;
  7. Import Java.net.URL;
  8. Import Java.util.concurrent.TimeUnit;
  9. Import Junit.framework.TestCase;
  10. Public class AppCheersTest1 extends testcase{
  11. private Iosdriver WD;
  12. Public AppCheersTest1 () {
  13. }
  14. public void Test1 () throws interruptedexception{
  15. Desiredcapabilities capabilities = new Desiredcapabilities ();
  16. Capabilities.setcapability ("appium-version", "1.6");
  17. Capabilities.setcapability ("PlatformName", "IOS");
  18. Capabilities.setcapability ("platformversion", "10.2");
  19. Capabilities.setcapability ("devicename", "IPhone 7");
  20. Capabilities.setcapability ("Newcommandtimeout",60000);
  21. Capabilities.setcapability ("Launchtimeout",60000);
  22. Capabilities.setcapability (Mobilecapabilitytype.automation_name, "xcuitest");
  23. Capabilities.setcapability ("app", "/users/***/desktop/cheers_appium/cheersapp.app");
  24. try {
  25. WD =New Iosdriver (new URL ("Http://127.0.0.1:4723/wd/hub"), capabilities);
  26. } catch (Malformedurlexception e) {
  27. //TODO auto-generated catch block
  28. E.printstacktrace ();
  29. }
  30. Wd.manage (). Timeouts (). implicitlywait (timeunit.seconds);
  31. System.out.println ("**********************cheers Li Appium testing ******************************");
  32. Wd.close ();
  33. }
  34. }

(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

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.