This is the salesforce application.
I want to get the below attributes value from the <a>
tag
Href
Title
HTML Code
<one-app-nav-bar-item-root one-appnavbar_appnavbar="" data-id="home" data-assistive-id="operationId" aria-hidden="false" draggable="true" class="navItem slds-context-bar__item slds-shrink-none slds-is-active" role="listitem" xpath="1">
<a href="/lightning/page/home" title="Home" tabindex="0" draggable="false" aria-describedby="operationId-14" class="slds-context-bar__label-action dndItem" style="">
<span class="slds-truncate">Home</span>
</a></one-app-nav-bar-item-root>
Selenium code (groovy scripting language)
for(int i:(1..size)){
WebElement getHref = driver.findElement(By.xpath("//one-app-nav-bar-item-root[${i}]//a[1]"))
println getHref.getAttribute("href")
println getHref.getAttribute("title")
}
output
null
null
NOTE: When I execute the above code in FireFox, I'm getting my expected result