I'm facing a problem, where I'm unable to get the text of a span tag that has another span tag as a child:
<span class="abc">
<span class="def">Inner Span</span>
Outer Span
</span>
When I'm using
driver.findElement(By.cssSelector(".abc")).getText()
Selenium returns "Inner Span" as well as "Outer Span". I guess innerText is used here. But I only need the text "Outer Span" of the outer span with the class "abc".