0

打開IE瀏覽器,我試圖運行在IE我的自動化腳本,下載IE的驅動程序,並給予在路徑,但由於某種原因,它的不開放和得到錯誤無法通過硒

org.openqa.selenium.SessionNotCreatedException :無法創建新的遠程會話

我通過批處理文件

java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver="chromedriver.exe" -Dwebdriver.ie.driver="IEDriverServer.exe" 

這裏是代碼創建0123設置路徑

else if (AutomationConstants.BROWSER_TYPE.equalsIgnoreCase("IE")) 
{ 
    Browser ie = new IEBrowser(); 
    System.out.println(ie); 

    try 
    { 
     webDriver = new RemoteWebDriver(new URL(SeleniumProperties.getHost()), ie.getCapabilities()); 
    } catch (MalformedURLException mue) 
    { 
     LOGGER.error(mue); 
    } 
} 

private static final String NAME = "IE"; 
private static DesiredCapabilities capabilities; 
static 
{ 
    capabilities = new DesiredCapabilities(); 
    capabilities = DesiredCapabilities.internetExplorer(); 
    capabilities.setPlatform(Platform.WINDOWS); 
    capabilities.setVersion("11"); 
    capabilities.setJavascriptEnabled(true); 
    capabilities.setCapability("acceptSslCerts", true); 
} 
/** * */ 
public IEBrowser() 
{ 
    super(NAME, capabilities); 
} 
+0

發佈您的代碼。 – Barney

+0

我正在通過bathc文件設置路徑java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver =「chromedriver.exe」-Dwebdriver.ie.driver =「IEDriverServer.exe」 – user6939

+0

else if( AutomationConstants.BROWSER_TYPE.equalsIgnoreCase(「IE」)){ Browser ie = new IEBrowser(); System.out.println(ie); webDriver = new RemoteWebDriver(新的URL(SeleniumProperties.getHost()),ie.getCapabilities()); } catch(MalformedURLException mue){ LOGGER.error(mue); } – user6939

回答

0

請嘗試以下解決方案:

要解決此問題,名稱iexplore.exe並在以下關鍵的 值0(32位Windows)創建DWORD值:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE 

對於64位Windows安裝中,以下主要應該用於:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE