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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception is thrown "Cannot find firefox binary in PATH" #1643

Closed
Jassi10 opened this issue Oct 29, 2019 · 16 comments
Closed

Exception is thrown "Cannot find firefox binary in PATH" #1643

Jassi10 opened this issue Oct 29, 2019 · 16 comments
Labels

Comments

@Jassi10
Copy link

Jassi10 commented Oct 29, 2019

System

  • Version: gecko version = 0.26
  • Platform: Windows 10 - 64 bit
  • Firefox: Version 70
  • Selenium: 3.14

Testcase

I am getting an exception since yesterday , so I wrote a simple code to check the browser if the problem is my code or something else and still I am getting the same exception.

I have Firefox installed and it is in the environmental variable too.

Code is as below

package smartbytes.opencart.scenario;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Browser {

public static void main(String[] args) {
	System.setProperty("webdriver.gecko.driver","C:\\SELENIUM\\selenium-tutorial\\drivers\\geckodriver.exe");
	String url = "https://www.amazon.in/";
	
	WebDriver driver = new FirefoxDriver();
	
	driver.get(url);

}

}

Stacktrace Please find the stacktrace below

Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'NONU-PC', ip: '192.168.0.104', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.4'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:100)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at org.openqa.selenium.firefox.FirefoxOptions.getBinary(FirefoxOptions.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:187)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:147)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:125)
at smartbytes.opencart.scenario.Browser.main(Browser.java:12)

Trace-level log

@whimboo
Copy link
Collaborator

whimboo commented Oct 29, 2019

@Jassi10, did you install the 32bit version of geckodriver or Firefox on your system?

@Jassi10
Copy link
Author

Jassi10 commented Oct 29, 2019

@whimboo I had installed the 64 bit version of geckodriver

@whimboo
Copy link
Collaborator

whimboo commented Oct 29, 2019

And what about Firefox?

@Jassi10
Copy link
Author

Jassi10 commented Oct 30, 2019

@whimboo Hi,I have already provided the details above ,I have a 64-bit windows OS and I always install the compatible drivers.
Firefox is also installed , the details are already mentioned, copying them here again
Version: gecko version = 0.26 64- bit version
Platform: Windows 10 - 64 bit
Firefox: Version 70
Selenium: 3.14

@whimboo
Copy link
Collaborator

whimboo commented Oct 30, 2019

No, you haven't still provided the information if Firefox is also the 64bit version or the 32bit one. I specifically ask because of issue #1045, which you seem to be affected of.

@Jassi10
Copy link
Author

Jassi10 commented Oct 30, 2019

@whimboo Firefox is also 64 bit version .I am going to uninstall firefox and install again( I am sure that is the next thing you would ask from the questions you have asked so far)!!.

@Jassi10
Copy link
Author

Jassi10 commented Oct 30, 2019

@whimboo one thing to add , it was working fine till last week,but after the latest automatic update , it has suddenly stopped responding.

@whimboo
Copy link
Collaborator

whimboo commented Nov 1, 2019

Which kind of automatic update? Windows, or something else?

@Jassi10
Copy link
Author

Jassi10 commented Nov 2, 2019

It is the Windows automatic update

@Jassi10
Copy link
Author

Jassi10 commented Nov 2, 2019

Anyways I am going to use Chrome for my selenium code its working fine ,I won't be using Firefox.
Closing the issue ,I guess this cannot be solved

@Jassi10 Jassi10 closed this as completed Nov 2, 2019
@whimboo
Copy link
Collaborator

whimboo commented Nov 4, 2019

I would appreciate if you could help us to identify the problem. Also note that only using Chrome for testing will not help anyone from us to have an interoperable web.

If you don't specify the Firefox binary location within the moz:firefoxOptions capability (see https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions) geckodriver will search some default paths for the binary.

@Jassi10, please tell us exactly into which folder you have installed Firefox. Also the above link shows some locations in the Windows Registry which geckodriver reads. Does the referenced key exist for you, and if yes where does it point to?

Thanks

@whimboo whimboo reopened this Nov 4, 2019
@sample199
Copy link

@whimboo, getting same issue with firefox driver please find below path for installing firefox: Executable Jar Path :
C:\Users******\AppData\Roaming\Microsoft\Windows\Start Menu\Programs, also i cannot find the actual path under program files/ program files(x86)

@orthur
Copy link

orthur commented Nov 22, 2019

I have encountered the same issue with 0.26.0 version for linux 64bit in alpine:edge (Linux 22d58bbbc350 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 Linux) docker container

Steps to reproduce:

  1. wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
  2. tar -xvzf geckodriver-v0.26.0-linux64.tar.gz
  3. chmod a+x geckodriver
  4. ./geckodriver --version
    output:
    bash: ./geckodriver: No such file or directory

it is not reproducible with v0.25.0

@whimboo
Copy link
Collaborator

whimboo commented Nov 27, 2019

@orthur this is not related to this issue and something weird goes on for you. Please consult your operating system's documentation.

Sadly we haven't gotten feedback from @Jassi10 so far. As such I'm going and close this issue.

@Jassi10
Copy link
Author

Jassi10 commented Nov 27, 2019

Hi Sorry I could not reply ,I had uninstalled and reinstalled the 64 bit version of firefox ,and it started working .
Just to summarise ,I am using 64-bit windows OS and had installed 64-bit gecko version.

@lock
Copy link

lock bot commented Jan 11, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants