xiaofans / robotium

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

TextView cannot be cast to Button (getButton() method) #417

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Button button = solo.getButton(name);

What is the expected output? What do you see instead?
java.lang.ClassCastException: android.widget.TextView cannot be cast to 
android.widget.Button
at com.jayway.android.robotium.solo.Solo.getButton(Solo.java:1741)
at com.tecomgroup.handifox.steps.CommonSteps.clickOnButton(CommonSteps.java:35)
at 
com.tecomgroup.handifox.webServiceClient.TestManager.click(TestManager.java:211)
at 
com.tecomgroup.handifox.webServiceClient.TestManager.execute(TestManager.java:61
)
at main.testHandiFox(main.java:65)
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)

What version of the product are you using? On what operating system?
robotium-solo-4.0.jar, Android 4.0.4 (Samsung galaxy tab, GT-P5110)

Please provide any additional information below.
Robotium 4.0 works great, but I have to use the 3.6 version due to this issue.

Original issue reported on code.google.com by keymusic...@gmail.com on 15 Mar 2013 at 1:00

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. Unfortunately it's a bug that came with all the 
internal changes of 4.0. The fix will be included in the next release that is 
due in the beginning of April. 

Original comment by renasr...@gmail.com on 15 Mar 2013 at 1:25

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

Original comment by renasr...@gmail.com on 8 Apr 2013 at 4:14