I am trying to get the text/content on the tooltip/help text. I am using selenium java.
Expected Result: To get the text so that I can verify by assertEquals
Actual Result: Not getting the text. It is getting null values. No error as such
HTML CODE:
<lightning-primitive-bubble class="slds-popover slds-popover_tooltip slds-nubbin_bottom-left slds-fall-into-ground" role="tooltip" id="salesforce-lightning-tooltip-bubble_8869b6bc-5567-f877-4ce1-037d1eaa3c37" style="position: fixed; min-width: 75px; z-index: 9104; left: 421px; right: auto; top: 114px;" data-position-id="lgcp-1000014"><div class="slds-popover__body">When did the current support plan begin?</div></lightning-primitive-bubble>
Mouse hover is done successfully. Only the text of the help text is not retrieved in the output Here is my code
String help = driver.findElement(By.xpath("(//lightning-primitive-bubble/div)[1]")).getText();
System.out.printf("Help text >", help);
I have tried multiple things like I have tried full xpath, absolute xpath, css selector, etc. Also tried multiple methods .getText(); .getAttribute("innerText"), .getAttribute("textContent"),etc.
Referred following link Unable to extract the text using gettext in Selenium WebDriver and also unable to click it
Can someone please help me to get the text