我刚刚将我的 Selenium 升级到 4.0.0。更新后,我无法打开 Chrome 或 Firefox。以下是详细信息
Chrome:96
Chrome 驱动程序:支持 96。从https://chromedriver.storage.googleapis.com/index.html?path=96.0.4664.45/下载
Selenium:4.0.0
这是打开浏览器的代码
System.setProperty("webdriver.chrome.driver", "<chromedriver location>");<br>
driver = new ChromeDriver();
浏览器打开片刻然后关闭。这是我得到的错误
AILED CONFIGURATION: @BeforeClass beforeClassSetup("chrome")
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'dkleinman.esri.com', ip: 'fe80:0:0:0:23:8798:b33c:2bf6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '16.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
如果我将 selenium 降级到 3.14(将 chrome 保持在 96),它工作正常