Android Sample - TheScientist/MGT-Mobile-GUI-Testframework GitHub Wiki
Here on github an Android project with two MGT tests is provided. The App is a simple Quiz that asks you to for the number of moons of every planet. It also has a start activity that asks for your name and an end activity that presents the results. Just deploy it to the emulator to see how it works (well have a try, it's in German). Now let's get started.
- Import the project PlanetenQuiz that is hosted here in GitHub.
- To run the App do a right click on the project and select Run As... > Android Application.
- Open a mgt-file of the test folder to have a look at a test suite.
Run Tests
- To run tests an emulator or device has to be started/connected. Make sure its screen is unlocked.
- Right-click on a mgt-file and select Run As .. > mgt Application
- An error will occur, cause the Run Configuration is not complete. Anyway it's the easiest way to create a Run Config.
- Click the menu Run > Run Configurations ...
- Select the created mgt Run Configuration.
- There is a Properties field where you must add the following properties: buildAut=true // or false. This property states if the App to test should be build and installed before tests are executed androidSDKPath=C:\Path\to\Android\SDK //Needed for the android tools
- With the two properties set, click Run and some magic should happen.
A log file is place in the root of your Eclipse installation (next to eclipse(.exe)). Have a look in there or ask me if it doesn't work.