1

I am trying write a selenium code using Java but there is an error package org is not accessible.

I have downloaded a firefox driver and given a path. Please let me know. It will be appreciated.

Please find the code below

package Selenium.webdriver.basictests;

    import org.openqa.selenium.firefox.FirefoxDriver;
    
    public class Firsttest {
    
        public static void main(String [] args) {
            System.setProperty("webdriver.firefox.marionette","C://Users//97477//.eclipse//geckodriver.exe");
            
            FirefoxDriver driver = new FirefoxDriver();
        }
    }

SeleniumWebdriverErrors

Please the location of my project folder and let me know the next step because it still showing an error.

Please check the location

1 Answers1

0

Few things:

instead of this:

System.setProperty("webdriver.firefox.marionette","C://Users//97477//.eclipse//geckodriver.exe");

use this:

System.setProperty("webdriver.gecko.driver",Path_of_Firefox_Driver"); // Setting system properties of FirefoxDriver

and

instead of this:

FirefoxDriver driver = new FirefoxDriver();

use this:

WebDriver driver = new FirefoxDriver(); //Creating an object of FirefoxDriver

refer this image:

enter image description here

cruisepandey
  • 28,520
  • 6
  • 20
  • 38