<html xmlns:plm="http://www.plmxml.org/Schemas/PLMXMLSchema">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>View Health Report</title>
<head>
<body></body>
</html>
上記のようなHTMlがあり、iframe内に挿入されています。だから私は以下のようなセレンコードを持っています:
//get iframe
WebDriver frame = getFrame()// Brings iframe driver
WebElement html = frame.findElement( By.tagName("html") );// works fine I can see HTMl text from html.getText();
//now try to get title
WebElement title = html.findElement( By.tagName("title"));//title.getText() is always empty.
足りないものを教えてください。
試す title.getAttribute("innerHTML");
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加