Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: Error creating bean with name 'firefoxDriver' defined in class path resource #13904

Open
H-Lo opened this issue May 3, 2024 · 6 comments
Labels
C-java I-defect I-issue-template Applied to issues not following the template, or missing information. needs-triaging

Comments

@H-Lo
Copy link

H-Lo commented May 3, 2024

What happened?

Upgraded from 4.19.1 to 4.20.0 and now I'm getting an exception about FireFox web driver.
Previously everything was working fine.
I can see it's about a proxy, but I don't know what to do with it.

OS:
Windows 11 Pro 23H2
OS build 22631.3447
Windows Feature Experience Pack 1000.22688.1000.0

IDE:
Spring Tool Suite 4
Version: 4.22.0.RELEASE
Build Id: 202403071427

Java:
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)

Spring Boot:*
spring-boot-starter-parent
3.2.5

Selenium:
selenium-java
4.20.0

Firefox web driver

@WebdriverScopeBean
@ConditionalOnProperty(name = "browser", havingValue = "firefox")
@Primary
public WebDriver firefoxDriver() {
	final FirefoxOptions firefoxOptions = new FirefoxOptions();
	final Proxy proxy = new Proxy();
	proxy.setAutodetect(false);
	proxy.setNoProxy("no_proxy-var");
	firefoxOptions.setCapability("proxy", proxy);
	return new FirefoxDriver(firefoxOptions);
}

How can we reproduce the issue?

Upgrade from 4.19.0 to 4.20.0 and try to run any unit test with given FireFox web driver configuration.

Relevant log output

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'firefoxDriver' defined in class path resource [com/thevegcat/selenium/configuration/WebDriverConfig.class]: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'firefoxDriver' threw exception with message: Unable to obtain: geckodriver, error Command failed with code: 2, executed: [--browser, firefox, --proxy, --language-binding, java, --output, json]
error: a value is required for '--proxy <PROXY>' but none was supplied

Build info: version: '4.20.0', revision: '866c76ca80'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17'
Driver info: driver.version: FirefoxDriver

Operating System

Windows 11

Selenium version

4.20.0

What are the browser(s) and version(s) where you see this issue?

FireFox

What are the browser driver(s) and version(s) where you see this issue?

gecko but not initialized at all

Are you using Selenium Grid?

No

Copy link

github-actions bot commented May 3, 2024

@H-Lo, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@pujagani pujagani added I-issue-template Applied to issues not following the template, or missing information. C-java labels May 6, 2024
Copy link

github-actions bot commented May 6, 2024

Hi, @H-Lo.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

@kora-rider
Copy link

Hi, I have the same issue, but only different I am using MacOS Version 14.4.1 (23E224).

@krmahadevan
Copy link
Contributor

@kora-rider - Can you create a sample project that can be used to reproduce the problem and share it here? That will make it easier for us to figure out what is going wrong.

@kora-rider
Copy link

@krmahadevan I tried some configuration and found out that I need to remove proxy settings. I had these settings for the Firefox driver:
Proxy ffProxy = new Proxy(); ffProxy.setProxyType(Proxy.ProxyType.AUTODETECT); ffOptions.setProxy(ffProxy);

So when I removed these proxy settings then it worked well.

@pujagani
Copy link
Contributor

@kora-rider - Can you create a sample project that can be used to reproduce the problem and share it here? That will make it easier for us to figure out what is going wrong.

+1 Please provide a complete reproducible test script/ sample project. I understand that something has worked in the interim but that is not ideal. Ideally, users should be able to set the proxy capability using the Proxy classes exposed by Selenium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-java I-defect I-issue-template Applied to issues not following the template, or missing information. needs-triaging
Projects
None yet
Development

No branches or pull requests

5 participants