webdriver.switchTo().defaultContent() triggers System.InvalidOperationException in IE9

StackOverflow https://stackoverflow.com/questions/9116682

  •  21-04-2021
  •  | 
  •  

質問

I'm using Selenium 2.15 to drive IE9. Overall, it's been working fine. I've got a weird scenario where a: driver.SwitchTo().DefaultContent() is triggering a System.InvalidOperationException (the message is "Unable to get browser (NoSuchDriver)"). I'm quite certain the browser is up and running, and has in fact driven to the content requested. The content in question is a single line HTML doc:

<div id='me'>simple page</div>

Is there any reason why SwitchTo().DefaultContent() would fail on such a page?

正しい解決策はありません

他のヒント

Aha, I figured it out. It's the known Selenium webdriver IE protected zone issue. The trick is, you have to UNcheck protected mode for all 4 zones. Then, implicitly, protected mode is disabled for "local machine" zone, which fixes the problem.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top