Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI Testing tool android from ADT21

Tags:

Trying to get the android UI Testing that comes as part of ADT21 (http://developer.android.com/tools/testing/testing_ui.html) to work currently and I seem to be running into some issues.

After creating a test we have to set it up as a uitest-project, the web page tells us the command is:

<android-sdk>/tools/android uitest-project -n <name> -t 1 -p <path> 

But this appears to be incorrect and it should be:

<android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path> 

But on running this I get the error:

Error: UI test projects can only target API 16 and above 

Which i assume related to the -t parameter, i have then since tried all the values from 1 to 18 (a version of android that doesn't even exist yet) and it gives me the same error. Anyone figured it out? I assume it is going to be something simple.

like image 662
Paul Harris Avatar asked Nov 15 '12 12:11

Paul Harris


People also ask

What is UI testing in Android?

Note: UI test is the term used for any test that verifies the correct behavior of a UI. They are usually instrumented tests that run on a device or emulator and check through instrumentation that the app behaves correctly. However, you can also create UI tests that are local tests.

What is Android UI Automator?

UI Automator is a UI testing framework suitable for cross-app functional UI testing across system and installed apps.

Why UI testing is important in Android?

UI Testing is one of the most critical parts of the Android development process. It helps ensure that your Android app has a smooth and error-free user interface, which translates to a better experience for your users. It can be performed manually or automated.


1 Answers

The answer was really simple. Examples shows you 1, what the -t actually wants is a target but the id is dependant on the results of running the command:

android list targets 

This command will give you a list of targets you can use with IDs dependant on what you have installed on your system.

For example on my system i got:


id: 37 or "android-16"  Name: Android 4.1.2  Type: Platform  API level: 16  Revision: 3  Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in  ABIs : armeabi-v7a, mips, x86 

So i use the command

android create uitest-project -n <name> -t 37 -p <path> 
like image 136
2 revs, 2 users 98% Avatar answered Oct 02 '22 02:10

2 revs, 2 users 98%