我是硒新手,正在尝试以下
File f = new File("/usr/bin/google-chrome");
System.setProperty("webdriver.chrome.driver", f.getAbsolutePath());
WebDriver driver = new ChromeDriver();
//wait = new WebDriverWait(driver, 30);
driver.get("http://www.google.com");
空的 chrome 选项卡已打开,但未加载 URL“www.google.com”。几秒钟后出现错误
exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:11037/status] to be available after 20002 ms
为什么它试图在“X”(更改)处连接本地主机而不是加载谷歌网页。
我怎样才能克服这个问题,Firefox 也出现了同样的问题。