score:1

your code looks fine but a couple of points:

  1. to work with selenium 3.x & mozila firefox 52.x you need to download the latest gecko driver from this location and save it.

  2. instead of "firefox.exe" you need to provide absolute path of the "geckodriver.exe"

replace:

system.setproperty("webdriver.gecko.driver","c:\\users\\12345678\\
    appdata\\local\\mozilla firefox\\firefox.exe");

by:

system.setproperty("webdriver.gecko.driver","c:\\your_directory\\geckodriver.exe");
  1. finally you code will look like:

    system.setproperty("webdriver.gecko.driver", "c:\\seleniumutilities\\browserdrivers\\geckodriver.exe");
    desiredcapabilities dc = desiredcapabilities.firefox();
    firefoxprofile profile = new firefoxprofile();
    dc.setcapability(firefoxdriver.profile, profile);
    webdriver driver =  new firefoxdriver(dc);
    driver.manage().window().maximize();
    driver.get("http:\\gmail.com");
    

this code executes good with me.

let me know if this helps you.


Related Query

More Query from same tag