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?