0
System.setProperty("webdriver.firefox.marionette","D:\\selenium\\New folder\\geckodriver.exe");

WebDriver driver = new FirefoxDriver();

driver.manage().window().maximize();
driver.get("https://www.google.com/");

closed as unclear what you're asking by dzieciou, IAmMilinPatel, NarendraC, Kate Paulk, Paul Muir Nov 29 '16 at 12:32

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    are you getting any error? – IAmMilinPatel Nov 28 '16 at 7:30
3

Selenium recently launched its one of the major release, i.e., Selenium 3 – beta. You can download it from here- Download Selenium 3.0-Beta .

In this new version, one of the major change is the way Mozilla Firefox Browser is invoked and for that GeckoDriver is necessary for invoking Firefox Browser. Gecko Driver can be downloaded from Here.

The minimum version of Mozilla required for Selenium 3 is Firefox-48 and above.

System.setProperty("webdriver.gecko.driver","c://workspace//libs//geckodriver.exe"); 
WebDriver driver = new FirefoxDriver();

String url = "http://www.google.com";

/* To Maximize the window */
driver.manage().window().maximize();

/* To delete all the cookies of the browser */
driver.manage().deleteAllCookies();

/* To navigate to a particular URL */
driver.get(url);

This will definitely work..

1

If your using eclipse try switching the \\ to // in your path to the geckodriver. You also need to change the string inside the setProperty to webdriver.gecko.driver:

System.setProperty("webdriver.gecko.driver","D://selenium//New folder//geckodriver.exe");

WebDriver driver = new FirefoxDriver();

driver.manage().window().maximize();
driver.get("https://www.google.com/");

Also make sure that you have the correct version of firefox for the geckodriver.

Not the answer you're looking for? Browse other questions tagged or ask your own question.