Taibai --- Fu Yan, Feifei, the first Android unit testing Instrumentation and irobotium, androidirobo.pdf
PS: It's too white --- falling Yan Feifei is purely fun (the sense of the screen of Tianya Mingyue game, the sense of combat, the collision is not satisfactory, but the profession is still good, used as the beginning ,, just make a narration ).
Unit Tests here are not applicable to games, whether instrumentation or irobotium. For more information about game automation, see the engine-based Automatic Object Recognition solution of wetest in the company or the sikuli solution. This is only applicable to applications in traditional industries. However, the basic idea is similar. It is to find the corresponding object and execute the corresponding method. The tested object here is a function in a specific class.
In general, there is always a monologue at the beginning of a story, but it is not so cool, and there is no xing secret scene ......
The background of the story is very simple, just like the autumn wind blowing through the trees, the yellow leaves are blown down by the wind is generally simple, direct. Here, you need to store the specified content to the file when you click Save file in the storage (non-sdcard) space of the machine itself. As a test with a pursuit of (xi) (xia), I want to directly make a white box for it and verify it ......
Required materials for the copy: eclipse + DDMS, an android mobile phone that has already been root (Be sure to root, no root, I am stuck)
Copy flushing, one of loading copies:
The final small boss that needs to kill the copy is here. Go to the copy room and view the copy scenario details:
Level is limited. You can only click the boss room first. Don't be surprised, don't abandon it. As long as you experience the fun, don't care too much about the details (si )~~
Click Copy to start preparation:
In the project under test, add the corresponding androidmainfest
Pay attention to the location of the kill. If the kill location is incorrect, everything will be wasted ~
<Uses-library android: name = "android. test. runner"/> --------- introduce the dependent libraries required for the android unit test.
Instrumentation android: name = "android. test. InstrumentationTestRunner" android: targetPackage = "com. example. file.pdf"
They correspond to the important materials required for the killing item to be used and the corresponding copy name.
The preparation is almost done. You can start to kill the boss. I can only see it later.
New to your class, used to test the method of the class under test. Note extends when new
It, otherwise you will find that after the white light, you will fall into the waves of little boss ~~~
Then, brush the brush, the knife starts to fall, the little boss will fall down, you can get a copy of the item: Android Instrumentation unit test little dagger. Attack 1-10 defense 1-10 additional attribute: mysterious item can be viewed
In the copy killing process, the small damage caused by the small boss is as follows:
1. Be sure to carry the corresponding items; otherwise, even the boss will be able to kill you (root android phone)
2. After you bring the item, remember to add the corresponding gem to the item (View/data/com. example. whether filepath/files is 777. You can see it in file explorer of DDMS, or add it by using adb shell. Check that the last files directory is displayed. If it does not have 777, in the end, you will kneel down and conquer more than 777)
3. the object to be tested and the class of the method to be tested can be placed under different packages, and can be imported.
Also, if you are not a warn person
No instrumentation runner found for the launch, using
For android. test. InstrumentationTestRunner, select properties of the project. If there are duplicate properties on the right, delete the copy and run it again.
Tips: What is irobotium In the title? What does it have to do with this? In fact, it doesn't have much to do with it. irobotium only uses its own solo class. Essentially, it seems that android. test. runner android. test. instrumentationTestRunner is no different from android)