Get multiple elements with same ID

Hello everyone,

I usually get an element as [in Ruby]:
element = wait{find_element(:id => "mySuperID")}

But I have to check the number of times it appears and I don’t want to make a loop which is going incrementing.
All the possible elements are in the screen, scroll is no needed.

Thank you!

Trying with find_elements (note the s), doesn’t return me anything, Just an empty array

element = wait{find_elements(:id => "mySuperID")}

1 Like

Is there no answer for that question? I’m still stuck with the same

Thank you all

Can you explain a bit more what are you trying to achieve?

I know that in the screen are (for example) 3 elements with id = SuperID
I want to get all of them in one call to count how many SuperElements are in the screen

I hope this explanation will be clear enough

Guys I really need this kind of functionality.

I am not a Ruby expert but still did some search and found that in most of the cases it is driver.find_elements…
Are you sure it is find_elements and not driver.find_elements?

Haven’t used Ruby so I can’t speak to the correct syntax, but for the Appium driver it looks like slipy12 already gave you the correct answer to use elements (plural) to get a list of all elements that match.

In general it’s always helpful if you provide your page XML for us to look at. You may not even have the id correct for your element which would cause both element (singular) and elements (plural) to fail to find anything.