austgl / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

Robotium does not support Android 3.2. #127

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Got the following on Honeycomb: 

java.lang.NoSuchFieldException: No field 'mWindowManager' in class 
android.view.WindowManagerImpl
    at java.lang.Class.findFieldByName(Class.java:---)
    at java.lang.Class.getDeclaredField(Class.java:---)
    at com.jayway.android.robotium.solo.ViewFetcher.getWindowDecorViews(ViewFetcher.java:464)
    at com.jayway.android.robotium.solo.DialogUtils.waitForDialogToClose(DialogUtils.java:39)
    at com.jayway.android.robotium.solo.Solo.waitForDialogToClose(Solo.java:627)
...

It's likely that the internals of WindowManagerImpl has changed, and will keep 
changing.

Is it possible at all to implement the features in robotium without using 
private APIs?

Original issue reported on code.google.com by Eyok...@gmail.com on 20 Jul 2011 at 5:34

GoogleCodeExporter commented 9 years ago
This is the only place where Robotium used private api:s and it is an absolute 
must. Without using this there is no possibility to access views in menus, 
context-menus, dialogs etc. 

Which version of Honeycomb did you experience this problem? 3.2? 

Original comment by renasr...@gmail.com on 21 Jul 2011 at 10:22

GoogleCodeExporter commented 9 years ago
I experienced this problem in 3.2

Original comment by Eyok...@gmail.com on 21 Jul 2011 at 10:35

GoogleCodeExporter commented 9 years ago
Ok. It is to bad they have changed the internal API in 3.2. We will have to see 
how it will look like in Ice Cream Sandwich and update accordingly. 

Original comment by renasr...@gmail.com on 21 Jul 2011 at 10:56

GoogleCodeExporter commented 9 years ago
I am using android 3.2 and robotium 2.3.
i get the following error when i try to execute the following snippet of code. 
This code was working before we upgraded to 3.2.

    public static void ResetApp(Solo solo) throws Exception {

        if (!solo.searchText("Set Up")) {
            // click on settings    
            solo.clickOnImageButton(4);
            // click on reset
            solo.clickOnText("Reset");
            // click on reset button
            solo.clickOnButton("Reset");
            // confirm action
            solo.clickOnText("Yes, proceed");
            // check to see if back at setup
            Assert.assertTrue(solo.searchText("Set Up"));
        }
    }

java.lang.RuntimeException: java.lang.NullPointerException
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:107)
at com.jayway.android.robotium.solo.Waiter.waitForText(Waiter.java:253)
at com.jayway.android.robotium.solo.Clicker.clickOnText(Clicker.java:254)
at com.jayway.android.robotium.solo.Solo.clickOnText(Solo.java:828)
at com.peel.android.utils.utils.ResetApp(utils.java:174)
at com.peel.android.test.PA78_OTA_CTV_ATV.testmain(PA78_OTA_CTV_ATV.java:52)
at java.lang.reflect.Method.invokeNative(Native Method)
at 
android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at 
android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at 
android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTes
tCase2.java:186)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at 
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:52
5)
at 
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1547)
Caused by: java.lang.NullPointerException
at 
com.jayway.android.robotium.solo.ViewFetcher.getNonDecorViews(ViewFetcher.java:1
88)
at 
com.jayway.android.robotium.solo.ViewFetcher.getAllViews(ViewFetcher.java:112)
at com.jayway.android.robotium.solo.ViewFetcher.getViews(ViewFetcher.java:232)
at 
com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.java:43
0)
at 
com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.java:41
7)
at com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:99)
at com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:93)
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:136)
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:105)
... 19 more

Original comment by w...@peel.com on 16 Aug 2011 at 7:48

GoogleCodeExporter commented 9 years ago
Issue 141 has been merged into this issue.

Original comment by renasr...@gmail.com on 17 Aug 2011 at 6:54

GoogleCodeExporter commented 9 years ago
Robotium looks great! Unfortunately we're developing a tablet-only application 
using 3.2. Trying to run the notepad test project on the 3.2 emulator and a 
Motorola Xoom produces the following exception:

08-31 14:29:46.724: INFO/TestRunner(518): ----- begin exception -----
08-31 14:29:46.744: INFO/TestRunner(518): java.lang.RuntimeException: 
java.lang.NullPointerException
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:107)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Waiter.waitForText(Waiter.java:292)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Clicker.clickOnText(Clicker.java:254)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Solo.clickOnText(Solo.java:830)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.test.NotePadTest.testRemoveNote(NotePadTest.java:78)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
java.lang.reflect.Method.invokeNative(Native Method)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
java.lang.reflect.Method.invoke(Method.java:491)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTes
tCase2.java:186)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
junit.framework.TestCase.runBare(TestCase.java:127)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
junit.framework.TestResult$1.protect(TestResult.java:106)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
junit.framework.TestResult.runProtected(TestResult.java:124)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
junit.framework.TestResult.run(TestResult.java:109)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
junit.framework.TestCase.run(TestCase.java:118)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:52
5)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1547)
08-31 14:29:46.744: INFO/TestRunner(518): Caused by: 
java.lang.NullPointerException
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.ViewFetcher.getNonDecorViews(ViewFetcher.java:1
88)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.ViewFetcher.getAllViews(ViewFetcher.java:112)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.ViewFetcher.getViews(ViewFetcher.java:232)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.java:43
0)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.java:41
7)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:99)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:93)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:136)
08-31 14:29:46.744: INFO/TestRunner(518):     at 
com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:105)
08-31 14:29:46.744: INFO/TestRunner(518):     ... 18 more
08-31 14:29:46.744: INFO/TestRunner(518): ----- end exception -----

Original comment by james.t....@gmail.com on 31 Aug 2011 at 2:34

GoogleCodeExporter commented 9 years ago
This has been fixed in Robotium 2.5

Original comment by renasr...@gmail.com on 31 Aug 2011 at 8:09

GoogleCodeExporter commented 9 years ago
Issue 234 has been merged into this issue.

Original comment by renasr...@gmail.com on 15 Mar 2012 at 6:41