Robotframework Appium enables automated testing of Android APK

Source: Internet
Author: User

Robotframework+appium achieve on android APK of automated testing

1. First, the Automation script passes the command to the Appium client through Robotframework;

2. Then the "Appium client" sends the received command to the "Appium server";

3. The "Appium server" translates the code commands in the script into commands recognized by the phone simulator and sends the "ADB" to the "simulator" to control the applied software being tested.

Then excerpt from a network of appium theoretical knowledge:

Summary of Appium principle

API interface calls Selenium interface, Android bottom with Android instrumentation (api2.3+ by binding another independent Selendroid project), Uiautomator interface (api4.2+ ), iOS UIAutomation interface with iOS underlying.

Client/serverarchitecture

Appium The server is written in node. js, and installing node. JS can be used directly with the NPM command or the Dmg,server-side function: Listen to a port, receive commands sent by the client, translate the command into a mobile device understandable form, send it to the mobile device, and then move After the device executes the command, it returns the execution result to Appium server,appium and returns the execution result to the client.

The client is actually the device that initiates the command, generally is the machine that executes the code, the machine that executes the Appium test code, can interpret the client as code, the code can be Java, Python, Ruby, JS, As long as the implementation of the Webdriver standard protocol is possible.

Cross-language: As long as support selenium Webdriver API and this language-related client libraries can. Server on any machine, even cloud servers (Appium and webdriver are inherently suitable for cloud testing).

Session

Session is a conversation, in Webdriver/appium, all your work is always after the session start can be done. In general, by post/session this URL, and then passed in desired capabilities can open the session.

When the session is opened, a globally unique SessionID is returned, and almost all requests must be brought with the session ID, since the seesion ID represents the browser you opened or the emulator for the mobile device.

Think further, since session ID is globally unique, it becomes possible to start multiple sessions on the same machine, which is the specific theoretical basis that selenium gird relies on.

Desired capabilities

Desired capabilities carries some configuration information. In essence, this is an object in the form of Key-value. You can think of it as a dictionary in Map,python in Java, a hash in Ruby, and a JSON object in JS. In fact desired capabilities is a JSON object when it is transmitted.

The most important role of desired capabilities is to tell the server the context of this test. Do you want to do a browser test or a mobile test this time? If it's a mobile test, Android or iOS, what app do we test if we test Android? Server of these questions desired capabilities must answer, otherwise the server does not buy, nature will not be able to complete the mobile app or browser launch.

Appium clients

The native Webdriver API was designed for Web-side, and Appium officially provided a set of Appium clients that could test their app for different language developers, and typically use these client libraries to replace native Webdriver libraries when testing. As a client, the native Webdriver has been extended to some mobile terminals.

Robotframework Automated test Case Examples:

Robotframework Appium enables automated testing of Android APK

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.