Re: NullpointerException while testing APK

177 views
Skip to first unread message

Renas Reda

unread,
Feb 11, 2013, 2:33:11 AM2/11/13
to Robotium Developers
Hi,

You need to use Robotium 3.6 for Android 4.2.

/Renas


On Feb 9, 5:01 pm, Salut <karthik.krishnag...@gmail.com> wrote:
> Hi All,
>
> I am trying to test my APK installed on my emulator (I dont have source
> code). I used re-sign.jar and deployed the APK on emulator.
>
> While running the tests i am receiving the following error. Can someone
> guide me about the root cause of this. Or let me know if i missed any steps
> in deploying the APK in case i dont have source code mapped.
>
> Version of Jars that i am using:
>
> robotium-solo-3.4.1.jar
> android-support-v4.jar
>
> with Android 4.2
>
> Test method:
> ----------------------
>
> public void testCanOpenSettings(){
>         if (solo.waitForText("I Agree")) {
> solo.clickOnButton(0);}
>
>         }
>
> Error:
> --------
>
> 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:328)
> at com.jayway.android.robotium.solo.Waiter.waitForText(Waiter.java:302)
> at com.jayway.android.robotium.solo.Waiter.waitForText(Waiter.java:258)
> at com.jayway.android.robotium.solo.Solo.waitForText(Solo.java:205)
> at
> com.calculator.test.ReallyBlackboxTest.testCanOpenSettings(ReallyBlackboxTe st.java:35)
> at java.lang.reflect.Method.invokeNative(Native Method)
> at
> android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java :214)
> at
> android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:1 99)
> at
> android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentati onTestCase2.java:192)
> at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
> at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
> at
> android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.ja va:555)
> at
> android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java: 1661)
> Caused by: java.lang.NullPointerException
> at
> com.jayway.android.robotium.solo.ViewFetcher.getNonDecorViews(ViewFetcher.j ava:163)
> at
> com.jayway.android.robotium.solo.ViewFetcher.getAllViews(ViewFetcher.java:8 5)
> at
> com.jayway.android.robotium.solo.ViewFetcher.getViews(ViewFetcher.java:194)
> at
> com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.ja va:312)
> at
> com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.ja va:299)
> at com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:101)
> at com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:94)
> at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:190)
> at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:105)
> ... 19 more

Renas

unread,
Mar 6, 2013, 11:05:56 AM3/6/13
to robotium-...@googlegroups.com
Hi Valentin,

Thanks for reporting this. Please submit this issue in the issue tracker. 


/Renas

On Wed, Mar 6, 2013 at 5:02 PM, Valentin Pistol <valenti...@gmail.com> wrote:
HI Renas,

I am seeing the same problem as the OP, this time I'm using Robotium 4.0 and Android 2.3.4 (API 10):

public void testLogin() {
  if (solo.waitForText("Log in")) {
      solo.clickOnButton(0);
  }
}

java.lang.RuntimeException: java.lang.NullPointerException
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:127)
at com.jayway.android.robotium.solo.Waiter.waitForText(Waiter.java:383)
at com.jayway.android.robotium.solo.Waiter.waitForText(Waiter.java:353)
at com.jayway.android.robotium.solo.Waiter.waitForText(Waiter.java:312)
at com.jayway.android.robotium.solo.Solo.waitForText(Solo.java:211)
at com.jayway.test.tumblr.RobotTumblr.testLogin(RobotTumblr.java:38)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.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:529)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1448)
Caused by: java.lang.NullPointerException
at com.jayway.android.robotium.solo.ViewFetcher.getNonDecorViews(ViewFetcher.java:159)
at com.jayway.android.robotium.solo.ViewFetcher.getAllViews(ViewFetcher.java:83)
at com.jayway.android.robotium.solo.ViewFetcher.getViews(ViewFetcher.java:189)
at com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.java:308)
at com.jayway.android.robotium.solo.ViewFetcher.getCurrentViews(ViewFetcher.java:295)
at com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:117)
at com.jayway.android.robotium.solo.Searcher$1.call(Searcher.java:106)
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:203)
at com.jayway.android.robotium.solo.Searcher.searchFor(Searcher.java:125)
... 19 more



On Monday, February 11, 2013 2:33:11 AM UTC-5, Renas Reda wrote:
Hi,

You need to use Robotium 3.6 for Android 4.2.

/Renas

--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotium-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages