Refer to http://controlingquality.blogspot.com/2011/02/design-data-driven-framework-around.html
TestedCodeIs a simple calculator, code:/files/morebetter/Android code/androidcalculator.rar
1. Data-Driven Testing Architecture
First Value |
Second Value |
10 |
1.5 |
20 |
3 |
The first input box reads data from the first value.
The second input box reads data from second value.
Click multiply
Compare the test results with the expected results and write the results to the file.
2. Create a data source file
Format:
3. upload the data source file to the emulator.
Create the Res/raw/Files folder in the tested code. In this way, the Files folder can be uploaded to emulator.
Run the tested code using eclipse-run as-Android Application
Load ddms on Eclipse, click File exploer, and browse all emulator-5554 files
- Open/data/COM. calculator/files, Click Upload to device on the right side, and upload the CSV file to emulator.
4. Edit the test case. The code is/files/morebetter/Android code/androidcalculatortestapk.rar.
5. Run the test case
6. Write the test result to the file, which is stored under/data/COM. calculator/files.
7. Import the test results to the local computer.
As the author said, this is just a simple framework. You can modify it based on your own needs.