Selenium WebDriver on IE11

試著忘記壹切 提交于 2019-11-27 19:11:05

It is a little bit tricky and annoying, but possible.

You already mentioned the IE settings that are needed. It also cache's the content between runs/usage and you would have to clear the cache and personal settings. I have found that the following helps ensure that the instance is clean when starting. These are options that will be passed into the IE instance when instantiating the WebDriver.

Local:

    var options = new InternetExplorerOptions();
    options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
    //Clean the session before launching the browser
    options.EnsureCleanSession = true;

Remote:

    capabilities = DesiredCapabilities.InternetExplorer();
    capabilities.SetCapability("ie.ensureCleanSession", true);

Perhaps this as well as the IE security settings you mentioned might work for you.

Microsoft has released the IE11 web driver

http://www.microsoft.com/en-us/download/details.aspx?id=44069

update for 2017:

  case "remote5555iexplorer" => {
    println(" load web-driver: remote5555iexplorer")

    val dc = DesiredCapabilities.internetExplorer()
    dc.setJavascriptEnabled(true)
     dc.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true)
    dc.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true)
    dc.setCapability(InternetExplorerDriver.ENABLE_ELEMENT_CACHE_CLEANUP, true)

    dc.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);

    remote = new RemoteWebDriver(new URL("http://localhost:5555/"), dc) 
    //remote = new InternetExplorerDriver(dc)

  }

iexplorer: 11.0.9.9600.17843 update version: 11.0.20

libraryDependencies += "org.seleniumhq.selenium" % "selenium-ie-driver" % "3.3.1"

webdriver: IEDriverServer.exe 3.2.0.0 (64-bit)

command for run webdriver: IEDriverServer.exe /LOG-LEVEL=DEBUG

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!