The following code throws occasionally an org.openqa.selenium.WebDriverException
.
WebElement element = driver.findElement(by);
element.click();
(new WebDriverWait(driver, 4, 100)).until(ExpectedConditions.stalenessOf(element));
The page looks like this (by is a selector for <a></a>
)
<iframe name="name">
<html id="frame">
<head>
...
</head>
<body class="frameA">
<table class="table">
<tbody>
<tr>
<td id="83">
<a></a>
</td>
</tr>
</tbody>
</table>
</body>
</html>
</iframe>
The message is unknown error: unhandled inspector error: {"code":-32000,"message":"Cannot find context with specified id"}
. element
is part of an iframe
and the click can cause the content of the iframe
to reload. The exception is thrown while waiting. What does this exception mean and how could I fix it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…