2nd Chapter 3 "Monkeyrunner Source analysis" Know your test object: Notepad window Activity noteeditor Introduction (original)

Source: Internet
Author: User


Heaven Zhuhai Branch Rudder note : Originally this series is to prepare a book, details please see the earlier blog "to seek partners to write the deep understanding of Monkeyrunner" books. But for many reasons, there is no wish. So the draft is shared here, so mistakes are unavoidable. If necessary, please refer to the following, the forwarding of the word also keep the end of each article source and other information.


When we add and edit a diary, we move from noteslist to the activity of Noteeditor. The controls are the same when you add and edit them, but their title content will be different.



Let's take a look at the component name of Noteeditor this activity by Hierarchyviewer:



The package name that you can see from the noteeditor is the same as the noteslist, both "Com.example.android.notepad", because they are all the same app Notepad the activity below, and its activity name is "Com.example.android.notepad.noteEditor".



Let's take a look at the activity's interface, for example, if we click on the "Note2" journal above Noteslist, it will enter the editing interface of the diary:






The Activity window consists of two controls, the first is the title, is a TextView control, the second is the journal content, is an editable edittext control, we can modify the content inside. After entering the interface, the soft keyboard will automatically pop out for user input.



Let's take a look at the property content of the two controls in Uiautomatorviewer, and we'll start by looking at the title:


The same as you can see the title in our example is "Edit:" Note2 "", it is a TextView control, and we also got his resource-id and boundary coordinates. We can use this information to write Monkeyrunner test scripts in the future.



Finally, let's take a look at the diary of the Noteeditor activity. What are the properties of the edit control?



With the information provided by Uiautomatorviewer we can see that the control is a edittext editable control, and we can also get the property of the control in the lower right corner to help us write the Monkeyrunner test script.



Heaven Zhuhai Branch Rudder
Public Number: Techgogogo
Weibo: Http://weibo.com/techgogogo
Csdn:http://blog.csdn.net/zhubaitian



2nd Chapter 3 "Monkeyrunner Source analysis" Know your test object: Notepad window Activity noteeditor Introduction (original)


Related Article

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.