谷歌居preSSO了java.lang.RuntimeException:无法启动意图意图行事{= android.intent.action.MAIN [英] Google Espresso java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN

查看:1364
本文介绍了谷歌居preSSO了java.lang.RuntimeException:无法启动意图意图行事{= android.intent.action.MAIN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来居preSSO UI测试。

我收到此错误,运行测试(ADT的Eclipse IDE)。

该应用程序已经开发并有很多的要求怎么回事,同时启动应用程序。这是不可能重写该应用。但我需要找到测试此UI的方式,即使有在各组分的加载的任何延迟。

 了java.lang.RuntimeException:无法启动意图意图行事{= android.intent.action.MAIN FLG = 0x14000000 CMP = com.xx.android / com.yy.core。 android.map.MapActivity} 45秒内。也许主线程没有在合理的时间量内消失闲置?有可能是动画或东西不断地重绘屏幕。或活动是做网络调用的创造?见threaddump日志。供大家参考最近一次事件队列是你的活动启动请求前的闲置是1390913271702和现在的最后一次排队去空闲时:1390913271767.如果这些数字是您的活动可能会占用事件队列中的相同。
        在com.google.android.apps.common.testing.testrunner.GoogleInstrumentation.startActivitySync(GoogleInstrumentation.java:277)
        在android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:119)
        在android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:97)
        在android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:104)
        在com.gulesider.android.test.UItest.setUp(UItest.java:25)
        在android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
        在android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
        在android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
        在com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner.onStart(GoogleInstrumentationTestRunner.java:167)
        在android.app.Instrumentation $ InstrumentationThread.run(Instrumentation.java:1799)


  1. 我有一个库项目被称为核心 - 它不会产生任何.apk文件

  2. 我也有堪称一Android项目AA,将进入核心。 - 这是AA.apk

  3. 现在,我已经创建了一个名为UItest测试项目

清单:

 <?XML版本=1.0编码=UTF-8&GT?;
    <清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
        包=com.AA.android.test
        安卓版code =1
        机器人:=的versionName1.0>
    <采用-SDK安卓的minSdkVersion =8
            机器人:targetSdkVersion =18/>
    <仪器仪表
      机器人:名字=com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner
      机器人:targetPackage =com.AA.android/>
    <应用
            机器人:allowBackup =真
            机器人:图标=@绘制/ ic_launcher
            机器人:标签=@字符串/ APP_NAME>
    <活动
                机器人:名字=com.core.android.map.MapActivity
                机器人:标签=@字符串/ APP_NAME>
                &所述;意图滤光器>
                    <作用机器人:名字=android.intent.action.MAIN/>
                    <类机器人:名字=android.intent.category.LAUNCHER/>
                &所述; /意图滤光器>
            < /活性GT;
            <使用库机器人:名字=android.test.runner/>
        < /用途>
    < /清单>

我的测试:

 公共类UItest扩展ActivityInstrumentationTestCase2< MapActivity> {
        公共UItest(){
            超(MapActivity.class);
        }        @覆盖
        公共无效设置()抛出异常{
            super.setUp();            getActivity();        }        公共无效testSearchBox(){            ES presso.onView(ViewMatchers.withId(R.id.menu_button_logo))执行(ViewActions.click());        }    }


解决方案

也许你有你的动画活动,其中块ES​​ preSSO执行中。你必须禁用它 - https://开头code .google.com / p / Android的测试套件/维基/ DisablingAnimations

I am new to Espresso UI testing.

I am getting this error while running tests (ADT Eclipse IDE ).

The app is already developed and there are lots of request going on while launching the app. it is not possible to rewrite the app. but i need to find the way to test this UI even if there is any delay in the loading of the components.

        java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=com.xx.android/com.yy.core.android.map.MapActivity } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1390913271702 and and now the last time the queue went idle was: 1390913271767. If these numbers are the same your activity might be hogging the event queue.
        at com.google.android.apps.common.testing.testrunner.GoogleInstrumentation.startActivitySync(GoogleInstrumentation.java:277)
        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.gulesider.android.test.UItest.setUp(UItest.java:25)
        at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
        at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
        at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
        at com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner.onStart(GoogleInstrumentationTestRunner.java:167)
        at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1799)

  1. I have one library project called "Core" - it will not generate any .apk
  2. Also i have one Android project called "AA" which will access "Core". - This is AA.apk
  3. Now i have created a test project called "UItest"

Manifest:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.AA.android.test"
        android:versionCode="1"
        android:versionName="1.0" >
    <uses-sdk android:minSdkVersion="8" 
            android:targetSdkVersion="18" />
    <instrumentation
      android:name="com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
      android:targetPackage="com.AA.android"/>
    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
    <activity
                android:name="com.core.android.map.MapActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <uses-library android:name="android.test.runner" />
        </application>
    </manifest>

My test:

    public class UItest extends ActivityInstrumentationTestCase2<MapActivity> {
        public UItest() {
            super(MapActivity.class);
        }

        @Override
        public void setUp() throws Exception {
            super.setUp();

            getActivity();

        }

        public void testSearchBox() {

            Espresso.onView(ViewMatchers.withId(R.id.menu_button_logo)).perform(ViewActions.click());

        }

    }

解决方案

Probably you have animation inside your activity, which blocks espresso execution. You have to disable it - https://code.google.com/p/android-test-kit/wiki/DisablingAnimations

这篇关于谷歌居preSSO了java.lang.RuntimeException:无法启动意图意图行事{= android.intent.action.MAIN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆