Web 应用程序无法使用 Firefox 启动

问题描述 投票: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. 检查您是否安装了火狐浏览器
  2. 使用 Boni Garcia WebDriverManager
  3. 将您的 Selenium 版本更新到最新
© www.soinside.com 2019 - 2024. All rights reserved.