0

I try to learn how to work with native Android application using Appium and Java.

I have a structure:

Class B contains:
class A: element_1
class A: element_2

I need to get all element that have class B and put them into a list.

How do I do list of child elements in Java using Appium for Android native application?

Fanthom
  • 1
  • 2

1 Answers1

1

This is how you can put all the elements in the list:

List<WebElement> el = driver.findElementsByClassName("classB");
Gaurav
  • 1,332
  • 11
  • 22
  • Thanks but it is right to use "WebElement" despite "MobileElement"? What is the difference? – Fanthom Mar 28 '16 at 18:50
  • @Fanthom : you can use either, keeping in mind that `MobileElement` is extended from `WebElement` – Naman Mar 29 '16 at 05:29