supriya
supriya

Reputation: 31

The type org.openqa.selenium.firefox.FirefoxDriver is not accessible

I need help in setting up selenium in MAC OS. I have added all the required selenium jar files and java JRE to build path. I have added java path in .profile But still I am still getting error for Firefox driver.

The type org.openqa.selenium.firefox.FirefoxDriver is not accessible

Can you please help.

Screenshot of the Error

Upvotes: 0

Views: 6628

Answers (4)

J Vinay
J Vinay

Reputation: 1

The pretty simple solution is " You might have created module while creating the package. So simply delete the module it will resolve the issue. It worked for me!!

Upvotes: 0

Stephen
Stephen

Reputation: 13

From what I can see in your 'Referenced Libraries' folder, you seem to have added both the selenium-standalone-3.x.x.jar and the individual client-combined-3.x.x versions of the jar files (selenium client jars for java). Is it possible that your eclipse does not know which libraries to finally use? Request you to remove all the libraries in your build path and add ONLY the selenium-server-standalone-3.x.x.jar file. Once done, refresh and this should resolve.

Also, once the right jars are in place, the import should resolve even without the System.setProperty instruction in your class file.

If the issue persists, could you please paste a screen capture without the right-click context menu on the error? Hope this helps.

Upvotes: 0

Vijayalakshmi R
Vijayalakshmi R

Reputation: 19

To resolve this issue,

  1. create a new Java project with JRE syetm libraray (JavaSE 1.8)
  2. copy jar file and build path
  3. copy driver executables

Create new class and move on with your work!!!

Upvotes: 1

undetected Selenium
undetected Selenium

Reputation: 193108

This error message...

The type org.openqa.selenium.firefox.FirefoxDriver is not accessible

...implies that the GeckoDriver was not accessible by your program/script,

Your main issue is the presence of numerous unwanted JAR files containing the same class which are:

  • selenium-server-standalone-3.14.0.jar
  • Selenium-Java client JARs.
  • selenium-firefox-driver-2.35.0.jar

Solution

  • Remove all the JARs and add back only selenium-server-standalone-3.14.0.jar
  • Download the required format of GeckoDriver executable from mozilla/geckodriver, extract the binary and then initialize the FirefoxDriveras follows:

    //imports
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    
    //other lines of code
    System.setProperty("webdriver.gecko.driver","C:\\path\\to\\geckodriver.exe");
    driver = new FirefoxDriver();
    driver.get("https://www.google.com/");
    

Upvotes: 2

Related Questions