別の Android プロジェクトをテストするテスト プロジェクトをセットアップします。すべてが正常に機能しています。solo.clickOnView を呼び出すと、テストは正常に実行されます。ビューを更新しようとすると問題が発生します。たとえば、solo.enterText を呼び出して EditText を更新したいとします。
ロボティウム バージョン 3.6
String hello="Hello world"
solo.enterText(myEditText, hello);
myEditText は null 以外のオブジェクトであると確信しています。テストを実行すると、以下のメッセージが表示されます
エラーメッセージ
java.lang.NullPointerException
at android.app.Instrumentation.runOnMainSync(Instrumentation.java:338)
at com.jayway.android.robotium.solo.TextEnterer.setEditText(TextEnterer.java:52)
at com.jayway.android.robotium.solo.Solo.enterText(Solo.java:1404)
at com.darakok.test.TestMain.testDisplayBlackBox(TestMain.java:30)
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:520)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)