I apologize if I'm repeating this question. I've been through a lot of answers on this site but I'm still not getting the tool-tip text. I can read the title if I don't use the Actions class to hover-over and display the tool-tip. However once I use the Actions class to display the tool-tip then title is always empty. I don't want to get the text before I hover-over, isn't the whole idea to read the tool-tip text that is displayed?
driver.get("https://jqueryui.com/tooltip/");
WebElement frame = driver.findElement(By.xpath("//iframe[@src='/resources/demos/tooltip/default.html']"));
driver.switchTo().frame(frame);
WebElement element = driver.findElement(By.id("age"));
Actions actions = new Actions(driver);
actions.moveToElement(element).perform(); (I've also tried clickAndHold method)
WebElement toolTip = driver.findElement(By.xpath("//*[@id='age']"));
// To get the tool tip text and assert
String toolTipText = toolTip.getAttribute("title");
System.out.println("toolTipText-->"+toolTipText);