Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Scrolling large lists #7

Open
Saboosh opened this issue Jul 19, 2010 · 4 comments
Open

Scrolling large lists #7

Saboosh opened this issue Jul 19, 2010 · 4 comments

Comments

@Saboosh
Copy link

Saboosh commented Jul 19, 2010

Hey fellas,
First off, great work on this project. My team is building a pretty sophisticated iphone app and the automated testing (and integration testing) we get by integrating iCuke is amazing. Thanks!

I would like to ask about scrolling large lists. We would like to click on every item in a list of 200+ items but we cannot seem to find a way to scroll through the list such that we can access each item in order, one at a time. My take on the current state of scrolling is that you need a label to scroll to, is that correct? If we do not know the labels to scroll to in advance is there a way to accomplish what we want?

BTW, I have folks here who would be very interested in contributing if you are looking for contributors.

@Saboosh
Copy link
Author

Saboosh commented Jul 19, 2010

I should mention that we are playing with a small workaround: We are overusing a field in UIWidgets called Accessibility Hint and have updated scroll_to in cucumber.rb to look for text in that field as well as the labels.
The reason for this is that we want to scroll to rows that we do not have complete control over the labels for (some labels are even duplicated) but we do have control over the hint field.

@robholland
Copy link

I'm not really sure how we'd implement that. What does the language look like in your cucumber steps?

@Saboosh
Copy link
Author

Saboosh commented Jul 19, 2010

We have not flushed it out yet. Infact, looking at it closer, our implementation will not work because it depends on the way icuke currently looks up data in the simulator which is via the screen. Its a problem since the label/hint we are targeting is offscreen.
Here is what our modified scroll_to uses:

while page.xpath(%Q{//*[contains(., "#{text}") or contains(@Label, "#{text}") or contains(@hint, "#{text}") or contains(@value, "#{text}")]}).empty?

We set the "hint" for each row and then just scroll_to that hint string:

scroll_to("row-100")

Unfortunately, as mentioned, this row is not in the screen XML because it is offscreen. Any recommendations for scrolling to an offscreen target?

@robholland
Copy link

At the moment no. I'll have a think about it.

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

No branches or pull requests

2 participants