Transplant MonkeyRunner's image comparison and sub-graph acquisition functions, and transplant monkeyrunnerIf your target test app has a lot of imageviews, the comparison function of monkeyrunner is displayed. Several other popular frameworks, such as Robotium, UIAutomator, and Appium, provide two fewer functions:
Obtain subgraphs
Image Comparison
Since the MonkeyRunner developed by Google has been prevalent for so long and the result verification
communicate?The server and the device use port 4723 to communicate by default, the bottom call Uiautomator tool, At the time of testing, the server will throw a jar package to the device is Appiumbootstrap.jar, will start the package, will be launched on the phone after the creation of a socket service, exposing the port is 4723, compared to the socket service, the Appium server is a client;Server 4723 can be modified, not on the device, the server r
maintain subsequent communication with the client based on the capabilities instructions provided by the client3. Check if the Android phone is ready with the "ADB Devices" command4. Use the tool "AAPT dump badging notepad.apk" to obtain NotePad PackageName and launchable activityname, note that the example code does not specify this two capabilities5. Android phone Shell invoke command to get the machine's API level has exceeded: "Adb.exe-s ht21atd05099 shell Getprop ro.build.version.sdk"6. Ex
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 tes
Android Automated Test explorationObjectiveGenerally speaking, after we have developed the product, it is up to the Test team or ourselves to point it out, basically without a problem and start on the line. However, over time, the functionality of a product becomes more and more powerful. At this point, in order to guarantee the quality of the product, we need to go through all the processes in each test. However, this is difficult and complex for a large product. Because our own manual testing
', U ' low ': U ' \u4f4e\u6e29 1\u2103 '}], U ' Ganmao ' : U ' \u663c\u591c\u6e29\u5dee\u8f83\u5927\uff0c\u8f83\u6613\u53d1\u751f\u611f\u5192\uff0c\u8bf7\u9002\u5f53\ U589e\u51cf\u8863\u670d\u3002\u4f53\u8d28\u8f83\u5f31\u7684\u670b\u53cb\u8bf7\u6ce8\u610f\u9632\u62a4\u3002 ', u ' Wendu ': U ' 3 ', U ' AQI ': U ' '}, u ' desc ': U ' OK '} data type: In the actual work, the serialization or deserialization may be a form of a file, it is not as simple as the write down to implement this part, the
name. Or wait for Appium's later stable inspector to be released to see if the control's name can be obtained.This method after Appium1.0 in fact is outdated and to be replaced by Findelementbyaccessibilityid, do not know why can still call, guess is Appium team want to retain a certain compatibility to smooth over it. Please view: https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/migrating-to-1-0.md2. findElementByAndroidUIAutomator2.1 Example el = Driver.findelemen
above the name of the control is equal to text. If it does not work, you have to give up the name. Or wait for Appium's later stable inspector to be released to see if the control's name can be obtained.This method after Appium1.0 in fact is outdated and to be replaced by Findelementbyaccessibilityid, do not know why can still call, guess is Appium team want to retain a certain compatibility to smooth over it. Please view: https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/m
: String that represents the resource ID of the object
-android uiautomator: string, which is the Uiautomator locator (Android only)
TODO: specifically describe
-ios uiautomation: string, which is UIAutomation locator (ios-only)
TODO: Indicate whether the server needs to indicate that it supports these policies.
If you are using Webdriver mode or a platform that uses HTML,
to see if the control's name can be obtained. 2.2 How to get uiautomator parametersUiautomator get controls in a variety of ways, all through the Uiselector object to find, such as using the text of the view of the current window to find the control, not to do this, and then another article to describe the way uiautomator get control, You can apply it directly to it.3. findElementByClassName3.1 Example?
using appium test app Automation to find elements is cumbersome, no selenium find Web page elements convenient,And the limitations are relatively high, use is not too flexible.So here are some of the methods we usually use to find elements (for example, a hammer phone).There are two tools you can use to find elements: Android SDK Bring your own Uiautomator Viewer ; Appium Latest Version 1.0.2 . Recommended Use Uia
ObjectiveAndroid has more than 2 years of automation capabilities, the use of functional automation framework has robotium, Uiautomator, Appium. Recently, research the automation case reuse scheme, researched the automation framework of appium, and applied it to the standard of Bank one account, this article introduces the Android function Automation combat experience based on appium in detail. The main contents include the following aspects:
There's always been a wish to use Python to do an Android automated function test, in one step, before using Monkeyrunner, but found that the use of the control ID is very limited, especially the content of the ID is not easy to distinguish
With Repeatability, and later found Uiautomator can Resorceid, text, PackageName and other elements to locate, but also found Xiaochong the great god about Uiautomator p
control is equal to text. If it does not work, you have to give up the name. Or wait for Appium's later stable inspector to be released to see if the control's name can be obtained. 2.2 How to get uiautomator parametersUiautomator get controls in a variety of ways, all through the Uiselector object to find, such as using the text of the view of the current window to find the control, not to do this, and then another article to describe the way
the name of the control on Android is equal to text. If the problem persists, You have to discard the name. Or wait for the stable inspector release of Appium to check whether the control name can be obtained.
VcD4KPHA + kernel + rbn9yrG2 + kernel/rysdBcHBpdW3NxbbTz + kernel + Mi4xIMq + wP08L2gyPgo8cD48L3A + kernel "brush: java;"> el = driver. findElementByAndroidUIAutomator ("new UiSelector (). text (\ "Add note \") "); assertThat (el. getText (), similar to ("Add note "));
2.2 how t
their own test extensions, flexibility.The Monkeyrunner tool provides APIs that can be used to control Android devices or emulators. You can write Python scripts to install Android apps, run apps, send analog keys, gestures, and so on, so you can do things that you can do in your device, Monkeyrunner.Many people on the net have shared the Monkeyrunner recording script and playback script, can download down, directly into the Android SDK Platform-tools directory, through the command Monkeyrunner
IntroducedAppium is an open-source, cross-platform testing framework that can be used to test native and hybrid mobile applications. Appium supports iOS, Android and Firefoxos platform testing. Appium uses Webdriver's JSON wire protocol to drive the UIAutomation Library of the Apple system and the Uiautomator framework of the Android system .Characteristics:
Cross-architecture
Cross-device
Cross-language
Cross App
Do not rely
='小说']Toast Prompt Message judgment
1. View Appium v1.7 version official documentation2.1.7 of the current Android version can support: Espresso, UiAutomator2, Uiautomator, selendroid four drive modesUiAutomator2 is now the most stable.
Second, toast positioning1. First look at what the toast looks like, such as the pop-up message "Press again to exit", this is toast.
2. To locate a toast prompt:Need:
webdriver supported languages when using Appium in a framework.
The Appium server is hosted on the node server. You can start the Appium server by triggering a set of node commands. Using Appium Standalone Application as a server (downloaded from the Appium Web site), the Inspector tool provides the ability to find/identify/operate on all of the app's locators.
Advantages:
Supports multiple languages.
No access to source code is required.
Cross-platform Scripting development.
Large commun
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.