sangmingming / robotium

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

solo.searchButton(String text, boolean onlyVisible) is not working properly. #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Launch the contacts.
2.From menu-> manage contacts-> select an account which has no contacts
3.call the solo.searchButton(String text, boolean onlyVisible) api.

What is the expected output? What do you see instead?
Actual:
======
Returns true even though the button is not present.

Expected:
========
Should return false when button is not available.

What version of the product are you using? On what operating system?
Android2.3 and robotium 2.2

Please provide any additional information below.

Original issue reported on code.google.com by anandpai...@gmail.com on 8 Apr 2011 at 5:33

GoogleCodeExporter commented 9 years ago
Are you searching for something that was seen in the previous screen? 

Original comment by renasr...@gmail.com on 8 Apr 2011 at 7:42

GoogleCodeExporter commented 9 years ago
No i am searching in the current opened screen and have kept the delay to 
confirm that.

Original comment by anandpai...@gmail.com on 8 Apr 2011 at 10:23

GoogleCodeExporter commented 9 years ago
So you are searching for something in the current screen that is not there and 
you get true back? Are you sure it is not there? Have you tried onlyVisible = 
true?

Original comment by renasr...@gmail.com on 8 Apr 2011 at 12:00

GoogleCodeExporter commented 9 years ago
yes i have tried with the onlyVisible = true

Original comment by anandpai...@gmail.com on 8 Apr 2011 at 1:48

GoogleCodeExporter commented 9 years ago
The button was first available and then became unavailable?

Original comment by renasr...@gmail.com on 8 Apr 2011 at 3:07

GoogleCodeExporter commented 9 years ago
Yes the button was available and when deleted the contacts from listview and 
again launched manage contacts screen then the buttons are not available but 
was returning "true".

Original comment by anandpai...@gmail.com on 8 Apr 2011 at 3:57

GoogleCodeExporter commented 9 years ago
This is due to a bug in the Android platform. Sometimes old views are not 
cleaned up and there is no way to know that they are not showing. If you ask 
the view it self it will say that it is shown and it will behave like it is 
active even though it is not. Unfortunately there is nothing that can be done.

Original comment by renasr...@gmail.com on 10 Apr 2011 at 7:41

GoogleCodeExporter commented 9 years ago
can fix this problem by closing all the activities and again relaunching the 
activity.

Original comment by anandpai...@gmail.com on 10 Apr 2011 at 7:57

GoogleCodeExporter commented 9 years ago
Yes that should work. Anything that starts the garbage collector.

Original comment by renasr...@gmail.com on 10 Apr 2011 at 3:30

GoogleCodeExporter commented 9 years ago
How can i start the instrumented activity again in the same testcase as only 
once it can be launched with instruementation.

Original comment by anandpai...@gmail.com on 10 Apr 2011 at 8:35

GoogleCodeExporter commented 9 years ago
I am using 2.2 as well and I have asked it to find a fake button that should 
not be on there at all and it still returns a positive response. I have 
included the following code:
solo.searchButton("Help me Rhonda!",1, true);

There is no button with that string associated with it on the screen.  We are 
able to make solo.clickOnButton("Call") based on their string names.

Original comment by dadea...@gmail.com on 13 Apr 2011 at 2:48