Fanthom
Fanthom

Reputation: 1

How can I make a list that will contain all elements that have given xpath?

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?

Upvotes: 0

Views: 925

Answers (1)

Gaurav
Gaurav

Reputation: 1370

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

List<WebElement> el = driver.findElementsByClassName("classB");

Upvotes: 1

Related Questions