打開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);
}
發佈您的代碼。 – Barney
我正在通過bathc文件設置路徑java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver =「chromedriver.exe」-Dwebdriver.ie.driver =「IEDriverServer.exe」 – user6939
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