Storm
Storm

Reputation: 758

selenium (java) findelements in findelements

i want to find some elements of one class ("class1) out of many elements of class2. is there a possibility?

e.g.: findElements(By.className("class2")).findElements(By.className(class1)) ?

Upvotes: 1

Views: 266

Answers (1)

Arran
Arran

Reputation: 25076

Yes, but this would be a CSS selector:

driver.FindElements(By.CssSelector("class2 > class1"));

By.className accepts a single class name, as identified by the method name.

Upvotes: 1

Related Questions