I have problem, here is html pseudocode:
<div class="content" id="ui6" role ="tabpanel">
<p> text </p>
<ul> <li> text2 </li>
<li> text3 </li>
</ul>
</div>
I want to get text, text2 and text3 and print them, but I can only manage to get "text".
Here is the code:
List<WebElement> sectionThreeText = driver.findElements(By.cssSelector("#ui6"));
for(WebElement e : sectionThreeText) {
System.out.println(e.getText());
}
I tried also find it by:
css = "#ui6 > p ul"
xpath = "//*[@id=ui6]"
xpath = "//*[@id=ui6]/*"
xpath = "//*[@id=ui6]/p | //*[@id=ui6]/ul"
I am out of ideas. Where I make mistake?