Poppy
Poppy

Reputation: 3092

Running Robotium Test Suite from command line

can anyone please suggest me the way to run a robotium test suite in command line.

adb shell am instrument -w com.package/android.test.InstrumentationTestRunner

This runs all the test cases in that package, but in my app, the tests inside should get executed sequentially. Is there a way to run test suite or individual test cases sequentially from command line?

Upvotes: 2

Views: 2952

Answers (3)

bhardwaj
bhardwaj

Reputation: 41

To run test sequentially

am instrument -w -e class_name#method name package-name/runner

e.g.

am instrument -w -e class com.example.test.class1#test1 com.example.test/android.test.InstrumentationTestRunner`

refer: http://developer.android.com/tools/testing/testing_otheride.html#RunTestsCommand

Yyou can try to run multiple test this way but a better approach is to create a test suite which ensures the sequential execution(order in which you have added the test)

to execute a test suite

adb shell am instrument -w -e class class_name package_name/runner

E.g.

adb shell am instrument -w -e class com.example.test.class1 com.example.test/android.test.InstrumentationTestRunner

Upvotes: 3

ZeroInputCtrl
ZeroInputCtrl

Reputation: 169

I noticed that in robotium tests are ran based off of their name in order. So if you want them sequential you can do

    public void test1*test case 1*
    {..}

    public void test2*test case 2*
    {..}

and so on, of course replacing the '*' text with what you want the test case called. Hope this helps ^.^

Upvotes: 0

Neha
Neha

Reputation: 29

If your package name is com.package.test and test class name is test1,you can run the class individually using: adb shell am instrument -e class com.package.test.test1 -w com.package.test/android.test.InstrumentationTestRunner

Upvotes: 0

Related Questions