我正在尝试在 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"
这是创建的代码IEDriverInstance
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);
}