-1

I have an element on my webpage which I call base element. I'm looking for all children with a certain tag of base. In pure Selenium & Java I would do something like:

WebElement base = driver.findElement(...);
List<WebElement> children = base.findElements(By.tagName("button"));

How can I do this in Selenide?

1 Answer 1

1

In selenide, you can $$ to get child elements from the parent element.

SelenideElement base = $(.....);

//if you want to use the class name
ElementsCollection children = base.$$('child className');

//if you want to use tagName then
ElementsCollection children = base.$$(By.tagName('child tagname'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.