Using Selenium webdriver for Internet Explorer. Tests won't run

前端 未结 2 1613
孤街浪徒
孤街浪徒 2021-01-16 11:18

I\'m currently expanding my tests to cover Internet Explorer using Selenium webdriver for IE (IEDriverServer.exe).

My issue is that when I execute my tests using th

相关标签:
2条回答
  • 2021-01-16 11:53

    IE Selenium

    Use Desired Capabilities and disable the protection mode in IE-Browser

    // Tomcat:apache-tomcat-7.0.37\webapps\ROOT\iedriver32\IEDriverServer.exe
    
    String dreiverFromServer = "http://localhost:8088/iedriver32/IEDriverServer.exe"
    File ietmp = File.createTempFile("iedriver", null).setExecutable(true);
    FileUtils.copyURLToFile(new URL( dreiverFromServer ), ietmp);
    System.setProperty("webdriver.ie.driver", ietmp.getAbsolutePath());
                         (OR)
    System.setProperty("webdriver.ie.driver", "D:\\iedriver64\\IEDriverServer.exe");
    
    DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
    ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    ieCapabilities.setCapability("ensureCleanSession", true);
    ieCapabilities.setCapability("ignoreZoomSetting", true);
    ieCapabilities.setCapability("ignoreProtectedModeSettings", true);
    ieCapabilities.setCapability("ignore-certificate-error", true);
    ieCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    
    driver = new InternetExplorerDriver(ieCapabilities);
    

    enter image description here

    IE 11 to set a registry entry on the target computer so that driver can maintain a connection

    0 讨论(0)
  • 2021-01-16 12:04

    Internet explorer is very slow when you ran your test in fire fox its worked fine because firefox search is very fast add proper waits and increase time out to locate objects increase that time to 2 min = 120 sec

    C# example is

    InternetExplorerDriver driver = new InternetExplorerDriver(@"c:\path", options, TimeSpan.FromMinutes(2));
    
    0 讨论(0)
提交回复
热议问题