0

I was getting the following error: Multiple elements were matched However it turned out that the scrolling page ID was multiple times matched. This means that I need something like this: await waitFor(element(by.id("someID")).toBeVisible()whileElement(by.id("anotherID")).atIndex(1).scroll(50, 'down')

I tried this, but get the following error: TypeError: global.waitFor(...).toBeVisible(...).whileElement(...).atIndex is not a function

So my question is, when there are two scroll elements with the same id, can I select one of them with the function atIndex? Or is there another solution for this?

Thanks in advance

camjan27
  • 31
  • 4

1 Answers1

0

Same issue experienced here. I was able to solve it using a function that scrolls the list until it meets the condition.

something like that:

await tryTap();
...
const tryTap = async() => {
        try { await element(by.id('someID')).tap(); } 
        catch (e) {
                await element(by.type("anotherID")).atIndex(1).scroll(50, "down");
                await tryTap();
        }
    }