Http://blog.sina.com.cn/s/blog_60c53af50102v3sb.html
Appium-automation for mobile apps one. Appium Architecture Introduction Official website: Www.appium.io by Saucelab Company presided. and is described in detail at Google's GATC2013. Appium is an HTTP Server written by the Nodejs Express framework. Appium not it?? To create a new test framework is to integrate the existing excellent framework into the Selenium Webdriver protocol (jsonwireprotocol/restful Web service). Make this frame full of?? 's needs. Appium start? After the dynamic test, start the server on the device under test, listen to it? Appium server's instructions. Different platforms (such as ios,android) have different transport and exchange types. Appium a pile program "intrusion" platform, to accept instructions, to complete the test script run. Features: 1. Cross-platform, native hybrid WebView (H5) 2. Cross device, Android IOS 3. Across apps, you can interact with multiple apps 4. Do not rely on the app open source code (reservation comments). , Android Uiautomator support for H5 requires code support, not in detail here) 5. Supports Selenium webdriver/selenium Grid 6. Cross-language, Java python ruby Nodejs 7. Open Source two. Appium operating mode on Android 1. Schematic diagram:
On the Android side, Appium is based on Webdriver, and uses bootstrap.js, and finally uses Uiautomator commands to implement automated testing of the app. Uiautomator test Framework is the Android SDK? Comes with the app UI Automation test Java library. In addition, due to the limited support of Uiautomator to H5, Appium introduced chromedriver for H5-based automation. 2. Main principle: 1. Webdriver on the left Script is our selenium test scripts 2. The middle is the Appium service, Appium on this side a server (4723 port), similar to the Seleniumwebdriver test framework, Appium? Support for standard Webdriver Jsonwireprotocol. A set of Web services is provided here, Appium server receives the Web driver standard request, parses the request content, and responds to the action with the corresponding framework. such as: The script sends a click Button request to Appium server,3. Appium server forwards the request to the middleware Bootstrap.jar, which is written in Java and installed on the phone. Bootstrap receives the Appium command (4724 Port), which is finally achieved by tuning the command with Uiautomator. 4. The result of the last practice line is returned by Bootstrap to Appium Server5. In addition, Appium also used Chromedriver to support testing based on H5 (WebView). Two. Appium working mode on iOS 1. Architecture diagram:
Simple diagram:
On the iOS side, Appium also makes use of Webdriver's set of protocols. Unlike the Android-side test framework, Appium iOS encapsulates Apple's instruments framework, primarily with UI Automation in instrument (Apple's Automated test framework) and then on the device. Into the bootstrap.js to monitor the line. 2. Main principle 1. The Webdriver script on the left is the Selenium test script 2. The middle is the Appium service, appium on this side? A server (4723 port), similar to the Seleniumwebdriver test framework, Appium? Support for standard Webdriver Jsonwireprotocol. A set of Web services is provided here, Appium server receives the Web driver standard request, parses the request content, and responds to the action with the corresponding framework. such as: The script sends a click Button request to Appium server,3. Appium Server call Instruments.js to start? A socket server, at the same time separate? sub-process transport line Instruments.app, will Bootstrap.js (a uiautomation script) note? into device? To interact with the outside world. 4. For the operation of H5, use IOS webkit Debug Proxy to implement http://appium.io/slate/en/v1.0.0/?java#ios-supporthttps://github.com/ Google/ios-webkit-debug-proxy three. Automated test script Example 1) installation configuration Appium operating Environment reference: http://appium.io/slate/en/master/?java# Running-appium-on-mac-os-xhttp://appium.io/slate/en/master/?java#running-appium-on-windows 2) Android & iOS example http://blog.sina.com.cn/s/blog_60c53af50102v3sc.html
Appium Architecture Analysis