sangmingming / robotium

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

clickOnButton doesn't work #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I got an error  'Click can not be completed!' at clickOnButton(String) function 
when I try to click a 'OK' button generated by EditTextPreference( 
http://developer.android.com/reference/android/preference/EditTextPreference.htm
l ).

Is there any way how to solve it?

The test was done on an Android 2.2 real device, and I followed the  'Why do 
text and button clicks get wrong?' instruction. The verison of robotium is 2.4

Thank you in advance.

Original issue reported on code.google.com by kyu....@gmail.com on 5 Aug 2011 at 7:28

GoogleCodeExporter commented 9 years ago
What happens is that you get a security exception. A security exception is 
thrown when trying to interact with a component that does not belong to the 
application under test. 

The changes described in 'Why do text and button clicks get wrong?' results in 
the right coordinates given back by the views for high density screens. When 
wrong coordinates are given back many times Robotium tries to click on a 
coordinate that is outside of the application under test. 

In your case either you need to redo the steps in 'Why do text and button 
clicks get wrong?' or make sure that the OK button is run in the same process 
as the rest of the application under test. 

Original comment by renasr...@gmail.com on 5 Aug 2011 at 8:25

GoogleCodeExporter commented 9 years ago

I rechecked the instruction guide about button click issue and process that you 
mentioned above, but nothing seems  to be wrong. 
I run the test application with medium density device, but the result was no 
good.

While testing many times, I found that the clickOnButton() function does not 
work when virtual keyboard is on screen. Once the virtual keyboard disappeared 
by calling goBack() the button works well.

Is there any guide that I should know about virtual keyboard ?

Original comment by kyu....@gmail.com on 5 Aug 2011 at 9:19

GoogleCodeExporter commented 9 years ago
The virtual keyboard belongs to another application and therefore you are not 
allowed to interact with it. Unfortunetely there is no way to check if the 
keyboard is up or not so that logic can not be built into Robotium. 

Original comment by renasr...@gmail.com on 5 Aug 2011 at 9:56