我建立我的第一個硒刮刀,和我得到的錯誤: 異常線程「main」 org.openqa.selenium.SessionNotCreatedException:無法創建新的遠程會話。所需的能力=能力[{ensureCleanSession = TRUE,browserName = IE瀏覽器,版本=,平臺= WINDOWS}],要求的能力=能力[{}]硒Internet Explorer的駕駛者希望功能錯誤
以下代碼:
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/");
我在做什麼錯?我嘗試了所有可以在Google上找到的解決方案。 –