Hello,
I thought I solved the problem below finally but unfortunatelly it
persists.
I will try to summarize the problem:
My application in test contains Setting screen. There are many
records and some of them have checkbox. Those checkboxes don't
have any text associated with them so it is not possible to use
"solo.isCheckBoxChecked(String text)" method.
When I access the screen I go through all views and select
checkbox views. I get all checkboxes which are visible on the
screen. Then I expect that the order, I found them in list of
views, is the same as they are displayed on screen so I use
"solo.isCheckBoxChecked(int index)"
When I reach the last visible record I do "solo.scrollDown()".
Now I use the same routine as when I came to the screen to get all
views and identified visible checkboxes.
The routine returns some checkboxes but some even those which
were visible on the first screen but after scrolling down they are
not visible. Then when application reaches the checkbox it ends up
with exception "Checkboxes are not found". The reason is that in
meanwhile Android somehow removed those object which are no longer
visible and previously valid indexes are now invalid.
I tried to sleep for 30 seconds and it did not help.
I tried to identified checkboxes as the second last thing before I
called "solo.isCheckBoxChecked(int index)" and even then if fails
with the exception above.
I can think of two possible causes
1) Changes in views are not reflected quickly enough even if I try
to wait for them.
2) isCheckBoxChecked(int index) somehow refresh memory or
identifies checkboxes in different way - for example my code
identifies 3 but solo.isCheckBoxChecked identifies only 2 ...
Any idea what I could change to make this thing working?
Thanks!
Vladimir
On 05/17/2013 08:18 AM, Vladimir Marek wrote:
Hi Renas,
I tried the approach below but the value of isChecked() does not
change even after a minute. "cb" still refers to original value
and not the new one.
Any idea what might be wrong?
Thanks,
Vladimir