I. First, configure the most basic environment
Knowledge preparation + Environment configuration for Android Automated Testing
(Click to view details)
Ii. Download athrun
- Select a location for storing code on the local machine dir
- Right-click dir
- SelectSVN checkout
- In the pop-up dialog box, the first itemURL of repositoryEnter the corresponding address in the input box below:
- Http://code.taobao.org/svn/athrun/trunk/android
- ClickOKDownload
- Waiting for download to complete
- The framework is the main code of the framework, and the agent is the auxiliary framework running on the PC. The example directory contains two apps, an android testing project that uses athrun to test the two apps. The tools directory contains some other auxiliary framework tools.
Iii. Import code into eclipse
- Run eclipse
- ClickFileOption
- ClickImport
- In the displayed dialog box, selectGeneralUnderExisting projects into Workspace
- ClickNext
- In the displayed dialog box, clickBrowseSelect the root directory of the downloaded project path
- Finish
- Repeat steps 2 to 7 to import all framework, agent, main_demo_app, cross_demo_app, and test_demo to eclipse.
4. Run the sample test project
- If a compilation error occurs after the project is imported, the compilation error is eliminated first, mostly because of Java build path. For details, refer to issues.
- Display the android labels that are helpful for debugging in Eclipse:
- SelectWindowsOption
- SelectShow View
- Select the required tag from the level-2 menu, as shown in figureDevices,Logcat
- Select the device to use
- Real Machine
- Simulator
- Note: To avoid the trouble, the simulator should select an SD card above 56 m, and the real machine should also insert the SD card. The default log4j log is recorded in the SD card. (It has been changed. If no SD card is available, it is stored on the mobile phone)
- Run main_demo_app and cross_demo_app
- Run test_demo. Note that most use cases only require the framework to run normally. However, some use cases (test methods in the virtualdevicetest class) must first run the agent on the PC side. Otherwise, the agent cannot run normally.
5. Use athrun to compile your own test project
- If you see this, congratulations, you will be out of the new hand village soon.
- If you have any questions when using athrun, do not hesitate to: Issues (Click here)
- If you want to develop your own game rules, join us now: Contact tazen (trademanager or email: taichan@taobao.com)
From the above example: Workshop.