getText()
, getAttribute("textContent")
is not returning correct result.
This is the html tag with tag:
<span>
class="panel-title text-primary header-font ng-binding" ng-click="titleLink()" style="" xpath="1">Applied Configs: TEST, MSA TEST, MSACONFIGURABLE
</span>
Code trials:
driver.findElement(By.xpath("//*[contains(@name,'Applied Configs')]/div[1]")).getAttribute("textContent"));
or
driver.findElement(By.xpath("//*[contains(@name,'Applied Configs')]/div[1]")).getText();
Returning Applied Configs:
instead of complete Text Applied Configs: TEST, MSA TEST, MSACONFIGURABLE
.
I am not sure what mistake I am doing here.