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.

  1. Import the project PlanetenQuiz that is hosted here in GitHub.
  2. To run the App do a right click on the project and select Run As... > Android Application.
  3. Open a mgt-file of the test folder to have a look at a test suite.

Run Tests

  1. To run tests an emulator or device has to be started/connected. Make sure its screen is unlocked.
  2. Right-click on a mgt-file and select Run As .. > mgt Application
  3. An error will occur, cause the Run Configuration is not complete. Anyway it's the easiest way to create a Run Config.
  4. Click the menu Run > Run Configurations ...
  5. Select the created mgt Run Configuration.
  6. 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
  7. 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.