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)