Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes stale UITableView accessibility elements are matched after a table refresh. #237

Open
wearhere opened this issue Jul 23, 2014 · 2 comments
Labels

Comments

@wearhere
Copy link
Contributor

Reported by @lisbakke in Gitter:

when the table frequently refreshes data... i am seeing that... sometimes the [new] table cell is grabbed and sometimes it's not... so when I call elementWithAccessibilityLabel I may not be getting what I think I am getting

and

there is weirdness with table cells having labels, then reloading the table with new data and having the new cells have the same names as old ones.

Possibly related: in the past we've seen an issue where table views do not refresh their accessibility information after a reload. We put in a workaround here (see also 5a712ac).

@wearhere wearhere added the bug label Jul 23, 2014
@wearhere
Copy link
Contributor Author

@lisbakke, a couple of follow-up questions:

  1. It sounds like the old names work after a refresh, in the sense that if the first cell in the table was named "cell a1" before a refresh and "cell a2" afterward, you could tap on the first cell after the refresh by trying to tap "cell a1". Is that right?
  2. When you say "the new cells have the same names as old ones", do you mean that you actually could not reference the first cell (using the previous example) by "cell a2" after a refresh, only by "cell a1"?
  3. Is this a timing issue? Like if you wait for a little bit after refreshing the table to match a new cell, then do you succeed?

Also if you could provide a test case or more details about your situation, for us to reproduce, that would be great.

@lisbakke
Copy link

  1. I believe that you could try to tap "cell a1" afterwards, but it would fail. What we were doing is calling cell 1 "cell a1" then upon refresh, calling the New cell 1"cell a1". When we went to try to get "cell a1" it would visibly be there, but sometimes the test would fail and sometimes it would succeed. I did not, at the time, log the accessibility hierarchy, so I can't confirm if there was an Old (in addition to new) "cell a1" that was actually still in the hierarchy. But it seemed like what was happening was that we sometimes were getting the old "cell a1" and sometimes the new "cell a1".
  2. I was just saying that we recycled accessibility labels. The cell position in the table determined the name, regardless of reload. Cell 1 in old table was "cell a1" accessibility label, cell 1 in the refreshed data was also "cell a1". I assumed this should work, especially since these are reusable cells.
  3. I was using SLWaitUntilTrue isvalid isvisible istappable. The subliminal test would time out after 10 seconds -- even though the cell was reloaded and there the whole time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants