Cannot launch robotium test in Android Studio

155 views
Skip to first unread message

Sebastian M Cheung

unread,
Jun 29, 2015, 10:18:09 AM6/29/15
to robotium-...@googlegroups.com
App running fine, but later when adding robotium the setup:

Trying out the TweetLanes github, but when adding robotium


public class HomeActivityTest extends ActivityInstrumentationTestCase2<TwitterAuthActivity>{

private Solo solo;
private static final String LOG_TAG = "debugger";

public HomeActivityTest() {
super(TwitterAuthActivity.class);

}

@Override
public void setUp() throws Exception {
TwitterAuthActivity activity = getActivity(); <--- line 44. Why this activity cannot launch?
assertNotNull(activity);



Testing started at 01:01 ...
Installing com.tweetlanes.android.core.test
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.tweetlanes.android.core.test"
pkg: /data/local/tmp/com.tweetlanes.android.core.test
Success


Running tests
Test running started
java.lang.RuntimeException: Could not launch activity
at android.support.test.runner.MonitoringInstrumentation.startActivitySync(MonitoringInstrumentation.java:326)
at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:119)
at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:97)
at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:104)
at com.tweetlanes.android.core.HomeActivityTest.setUp(HomeActivityTest.java:44)
at junit.framework.TestCase.runBare(TestCase.java:132)
at junit.framework.TestResult$1.protect(TestResult.java:115)
at junit.framework.TestResult.runProtected(TestResult.java:133)
at android.support.test.internal.runner.junit3.DelegatingTestResult.runProtected(DelegatingTestResult.java:90)
at junit.framework.TestResult.run(TestResult.java:118)
at android.support.test.internal.runner.junit3.AndroidTestResult.run(AndroidTestResult.java:49)
at junit.framework.TestCase.run(TestCase.java:124)
at android.support.test.internal.runner.junit3.NonLeakyTestSuite$NonLeakyTest.run(NonLeakyTestSuite.java:63)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at android.support.test.internal.runner.junit3.DelegatingTestSuite.run(DelegatingTestSuite.java:103)
at android.support.test.internal.runner.junit3.AndroidTestSuite.run(AndroidTestSuite.java:63)
at android.support.test.internal.runner.junit3.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:54)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:228)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)
Caused by: java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=com.tweetlanes.android.core.test/com.tweetlanes.android.core.view.TwitterAuthActivity }
at android.app.Instrumentation.startActivitySync(Instrumentation.java:384)
at android.support.test.runner.MonitoringInstrumentation.access$101(MonitoringInstrumentation.java:83)
at android.support.test.runner.MonitoringInstrumentation$3.call(MonitoringInstrumentation.java:306)
at android.support.test.runner.MonitoringInstrumentation$3.call(MonitoringInstrumentation.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

Finish


Any idea?



naveed

unread,
Jun 30, 2015, 3:26:50 AM6/30/15
to robotium-...@googlegroups.com
Hi, 

Can you please share more details, how you setup project? how you are running project? any tutorials you are following? 

Naveed
Reply all
Reply to author
Forward
0 new messages