Selenium:无法使用 FireFox 启动 Web 应用程序

问题描述 投票:0回答:1

我给出了以下代码来使用 Firefox 启动应用程序

System.setProperty("webdriver.gecko.driver",
"C:/Work/Assessment/Automation/Test_2/src/main/resources/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://google.com");

我收到以下错误:

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

我想用firefox浏览器启动应用程序


java selenium-webdriver selenium-firefoxdriver webdrivermanager-java
1个回答
0
投票
  1. 检查您是否安装了firefox浏览器
  2. 使用 bonigracia webdriver 管理器
  3. 将您的 selenium 版本更新到最新
© www.soinside.com 2019 - 2024. All rights reserved.