Appium + Robotframework for automated testing of Android applications-3: an essential tool introduction, appuim
Everything is ready. Now we are about to write a test script.
However, an important problem has not been solved. We know that the RobotFramework mainly relies on the element id, name, or xpath in web pages to locate the elements on the page. We rely on the browser plug-in firepath to achieve this, but in Android applications, how to locate the elements on the page? Now, this key tool should be available, which is uiautomatorviewer. bat, which is located in the directory of % ANDROID_HOME % \ tools and double-click to run it.
If the simulator has not been started, start it up. When the simulator is started and the standby interface of the mobile phone appears, operate the simulator. Open the calculator, click number 6, and then click the multiplication number, click uiautomatorviewer. device Screenshot, the second icon in the upper left corner of bat, can be clicked on the simulator, but what's more amazing is that when we move the cursor to the element in, the attribute of the element is automatically displayed on the right, as shown in.
The resource-id, text, class attributes and resource-id attributes are often used in AppiumLibrary (which will be introduced later, isn't id frequently used in RobotFramework? Note: resource-id can be viewed only when the application version is set to 4.3 or later.
With this easy-to-use tool, it will be much easier to write code scripts.
To be continued, please stay tuned...
This article is copyrighted by the green tree. You are welcome to repost it, but please indicate the author and the source. It is strictly prohibited for any commercial use. Otherwise, you will be responsible for the consequences!