Selenium 3 got released and Important changes are listed here.

IMPORTANT CHANGES
* Minimum java version is now 8+
* The original RC APIs are only available via the leg-rc package.
* To run exported IDE tests, ensure that the leg-rc package is on the classpath.
* Support for Firefox is via Mozilla’s geckodriver. You may download this from                   Gecko Driver Release
* Support for Safari is provided on macOS (Sierra or later) via Apple’s own safaridriver.
* Support for Edge is provided by MS:
MicrosoftWebDriver Download
*Official support for IE requires version 9 or above. Earlier versions may work, but are no longer supported as MS has end-of-lifed them.
Other major changes:
* New html-table runner backed by WebDriver.
* Unused command line arguments are now no longer parsed

Download Selenium 3 (Beta 1) jars from Selenium Java Jars Download Page

Firefox via GeckoDriver Example:

In Selenium 2.0 (Webdriver), we used FirefoxDriver as the default driver as
WebDriver driver = new FirefoxDriver();

But in Selenium 3 (Beta 1) it throws an exception saying “lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver”

In order to work with FirefoxDriver in Selenium 3 Beta version,

  • Download GeckoDriver from Gecko Driver Release
  • Extract the zip file and give the path of the geckodriver exe in the program.
  • You need to use webdriver.gecko.driver for setting the System Property

Sample Program:

@Test
public void firefoxTest()
{
String ffDriverPath = "<path to the directory>\\geckodriver.exe";
System.setProperty("webdriver.gecko.driver", ffDriverPath);
WebDriver driver = new FirefoxDriver();
driver.get("http://www.facebook.com");
System.out.println("Title———–"+driver.getTitle());
driver.quit();
}

Tested with Firefox 47.0.1 version and is working fine.

0