sangmingming / robotium

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

Solo.searchFor finds items which do not exist in current activity #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Activity A launches Activity B with text view "searching"
2.Activity B - finishes
3.Solo.searchFor(searching) returns true

What is the expected output? What do you see instead?
Solo.searchFor(searching) returns true

What version of the product are you using? On what operating system?
latest - source downloaded and build on 03-Apr-2011.

Please provide any additional information below.
Tried to debug the source and I could see that the view Fetcher brought views 
from Activity B - I am pretty sure it worked before so it might be my bad.
Tried the visible flag and i'm getting same results...

Original issue reported on code.google.com by yair.oha...@gmail.com on 3 Apr 2011 at 7:59

GoogleCodeExporter commented 9 years ago
Unfortunately there is not much that can be done about which views are 
available to Robotium. It gets them from the platform. So if that TextView is 
still alive when searchText is done then it will return true. Many times it 
takes a while for old TextViews to be garbage collected.

Original comment by renasr...@gmail.com on 4 Apr 2011 at 6:00

GoogleCodeExporter commented 9 years ago
OK , i thought views are retrieved from the current activity.
Isn't there a way to mention search for only on views from current activity ?
any other workaround (sleeping to 5 seconds will solve it ?)

Original comment by yair.oha...@gmail.com on 4 Apr 2011 at 6:36

GoogleCodeExporter commented 9 years ago
No, that is not possible. Usually a sleep will solve the problem as views will 
be garbage collected when they are not used anymore. 

Original comment by renasr...@gmail.com on 5 Apr 2011 at 10:43