Skip to main content
Corrected question heading, added tag #selenium-webdriver, #webdriver
Link
undetected Selenium
  • 194.5k
  • 44
  • 304
  • 387

How to fix anunknown error: unhandled inspector error?: "Cannot find context with specified id"

added 495 characters in body
Source Link
user3561614
  • 1.1k
  • 1
  • 12
  • 20

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?

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 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. What does this exception mean and how could I fix it?

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?

Source Link
user3561614
  • 1.1k
  • 1
  • 12
  • 20

How to fix an unhandled inspector error?

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 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. What does this exception mean and how could I fix it?