我正在制作我的第一个Selenium刮刀,我收到错误: 线程" main"中的例外情况org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。 desired capabilities = Capabilities [{ensureCleanSession = true,browserName = internet explorer,version =,platform = WINDOWS}],required capabilities = Capabilities [{}]
以下代码:
import java.io.*;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class Logon {
static String driverPath = "C:/Users/2172633/Selenium/";
public WebDriver driver;
public void setUp() {
System.out.println("*******************");
System.out.println("launching IE browser");
System.setProperty("webdriver.ie.driver", driverPath+"IEDriverServer.exe");
driver = new InternetExplorerDriver();
driver.manage().window().maximize();
}
public static void main(String[] args) throws IOException {
Logon Logon = new Logon();
Logon.setUp();
DesiredCapabilities.internetExplorer();
}
public void login(String userName, String Password) throws IOException {
driver.navigate().to("https://www.kroger.com/");
答案 0 :(得分:1)
您是否在Selenium中安装了额外的Nuget软件包以使用IE? " Selenium.WebDriver.IEDriver"