How to get all descendants of an element using webdriver?

后端 未结 3 2032
你的背包
你的背包 2020-12-07 23:09

There is this element which has child elements, those child elements again have child elements and so on. I would like to get all elements that are descendants of the elemen

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 23:34

    Try this one:

    List childs = rootWebElement.findElements(By.tagName(".//*"));
    

提交回复
热议问题