我正在尝试通过硒在angular7应用程序中阅读文本工具提示。但是获取文本返回空白,而javascript执行程序返回null。

但是获取文本返回空白,而javascript执行程序返回null。
这是空白
driver().get("https://vmware.github.io/clarity/documentation/v0.12/tooltips");
Wait(3000);
System.out.println(driver().findElement(By.xpath("(//span[@class='tooltip-content'])[2]")).getText());
Run Code Online (Sandbox Code Playgroud)
这将返回null
System.out.println(driver().findElement(By.xpath("(//span[@class='tooltip-content'])[2]")).getAttribute("value"));
String theTextIWant = ((JavascriptExecutor) driver()).executeScript("return arguments[0].innerHTML;",driver().findElement(By.xpath("(//span[@class='tooltip-content'])[2]")));
Run Code Online (Sandbox Code Playgroud)