Closed GoogleCodeExporter closed 9 years ago
You can use solo.clickOnView(solo.getView("id of your view");
Original comment by renasr...@gmail.com
on 24 Feb 2014 at 3:53
I tried it already and it failed .. here's the failure trace:
junit.framework.AssertionFailedError: View with id:
'com.softxpert.sds.R.id.addFolderAction' is not found!
at com.robotium.solo.Solo.getView(Solo.java:1990)
at com.robotium.solo.Solo.getView(Solo.java:1970)
at
com.example.android.apis.test.test.AddIconTest3.testRecorded(AddIconTest3.java:7
6)
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:192)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:54
5)
at
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1575)
also I tried to find the view by id as the following:
ImageButton imageButton = (ImageButton)
solo.findViewById("com.softxpert.sds.R.id.addFolderAction");
solo.clickOnImageButton(imageButton);
But, It caused a class cast exception
"com.android.internal.view.menu.ActionMenuItemView cannot be cast to
android.widget.ImageButton"
Original comment by glamour....@gmail.com
on 26 Feb 2014 at 7:07
Original issue reported on code.google.com by
glamour....@gmail.com
on 24 Feb 2014 at 8:03