The premise condition
- IOS 12.2
- MacOS Device System 10.14.5 (18F132)
- Xcode Version 10.2.1 (10E1001)
- Appium version V1.14.0
How Appium works
Appium is c/ S mode, Appium is based on webDriver protocol to add the extension of mobile device automation API. Webdriver is based on THE HTTP protocol. The first connection establishes a session and sends a JSON message via POST to inform the server of the relevant test information. Client after executing scripts generated based on the URL request under the WebDriver protocol, the server receives the request URL (similar to a remote command) and to forward the order to the testing machine, testing machine to receive orders, after parsing the command to perform the corresponding operation, and the implementation results back to the server, the server will perform again the results returned to the client.
Appium Environment Architecture (OSX)
1. Install Appium
With Appium Desktop, just download and install it. Appium Desktop download.
2. Install the required dependent libraries
Select different drivers according to the application platform under test. Here, test iOS on Xcode10 and select XCUITest Driver. This is an important step towards automated testing. The driver is also integrated into Appium Desktop and does not need to be installed separately, but the operating environment needs to be set up. Install the required dependency libraries, including:
- Brew Install node
- npm (brew install npm)
- carthage (brew install carthage)
- Brew Install LibiMobileDevice
- Brew install ios-deploy
To determine whether all dependencies were successfully installed, verify with appium-Doctor
- Appium-doctor (NPM install -g appium-doctor
- Run appium-doctor on the terminal.
To begin testing
1. Real machine test
- To start Appium Desktop, click Start.
- Click the search icon in the upper right corner to start a session.
- Edit the required properties
It can be added via the + button on the left of the figure, or edited directly from the JSON edit box on the right.
- AutomationName: Which automation engine to use. Appium (default) or Selendroid?
- PlatformName: Which mobile platform to use. IOS, Android, orFirefoxOS?
- DeviceName: Which device to start, real machine or emulator? IPhone Simulator etc…
- App: The absolute path of the application. Note that it must be an absolute path. This property can be left unchecked if appPackage and appActivity are specified. Also, this property conflicts with the browserName property.
- Udid: indicates the UDID of the real device. // This configuration can be ignored for emulators
In the real machine test, you need to specify uDID, xcodeOrgId, and xcodeSigningId. The UDID and device ID can be queried by running idevice_id -l. XcodeOrgId is the developer account ID, which can be viewed in xcode’s Account Management. XcodeSigningId assigns the value “iPhone Developer”. If the application under test has not been installed on the mobile phone, specify the installation package path through appName. Then click Start Session in the lower right corner.
FushiX Ceshi5 real Funline simulator
- After a successful startup, the edit screen will appear and you can start setting up the test automation steps.
- Start Recording: Recording, select Recording, your operation process will be recorded in the recorder in the form of script, recorder can also choose the script language you want, as well as simple script or executable script.
2. Script tests
- Open the terminal and switch to the folder where the script file resides
- Run the script file using the Python command line
- Status prompt under Appium during operation
- A script for a process under “XXXX” in appendix
Appendix:
Error Info XCUITest xcodeBuild exited with code ’65’ and Signal ‘null’ Provisioning Profile failed You need to manually configure WebDriverAgentRunner. Right-click Appium in the application Desktop->Contents->Resources->app->node_modules->appium->node_modules->appium-xcuitest- >WebDriverAgent Then run./Scripts/bootstrap.sh
Then open webDriverAgent. xcodeProj and configure the certificate management to make sure there are no red exclamation points. If you see the following error, change the app ID until the red exclamation point disappears. After the configuration is successful, the following information is displayed: 1. You must configure a unique certificate for the real machine, and do not use the certificate automatically generated by wildcard. 2
Run xcodebuild-project webDriverAgent. xcodeProj -scheme WebDriverAgentRunner -destination ‘id=’ test. The terminal will still report an error when running this code. You can debug the terminal using Command + U in Xcode if the following logs appear in the terminal, it indicates that the setting is successful
Then go back to Step 3 and delete the xcodeOrgId and xcodeSigningId attributes (the software needs to be removed, but the provisioning Profile cannot be started) and click Start Session again.
Refer to the link
GitHub — WebDriverAgent appium/appium-desktop
Appium — iOS automation test environment build Appium Desktop iOS real machine test environment build iOS real machine install WebDriverAgent Appium- iOS real machine Appium –XCUITest Driver Configure the ios server on the ios server. Install WebDriverAgent appium-desktop-1.0.0. DMG appium 1.6.4 (Server) Problems and Solutions Appium Restarts after the ios server app is started Xcode9.0+ APpium1.6.5 Real machine environment running APP and pit know how much