Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebElement.findElements(By.className()) on a parent object returns all classes on dom that match #164

Closed
aaronmagi opened this issue Jul 6, 2016 · 1 comment

Comments

@aaronmagi
Copy link

WebElement linearLayouts = driver.findElementByXPath("//android.widget.LinearLayout[@index='1']");
List<WebElement> views = linearLayouts.findElements(By.className("android.widget.TextView"));

System.out.println(views.size());

I would expect to only get back the 2 elements for the TextViews in the tree attached. Instead all the elements with that class in the document are returned?

tree lg

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

No branches or pull requests

2 participants