What’s new in selenium 3.0

Selenium released 2 beta versions of selenium 3.0 (beta 1 & 2 till 3rd Aug, 2016) with few of the below changes:

Reference link : Selenium Changelog

Beta 1 updates

Minimum java version is now 8+
Support for Firefox is via Mozilla’s geckodriver (will discuss below)
Support for Safari is provided on macOS (Sierra or later) via Apple’s own safaridriver.
Support for Edge is provided by MS
Download the driver from Microsoft edge driver

Official support for IE requires version 9 or above.
Beta 2 updates (Only for Java)

System property webdriver.firefox.marionette now forces the server in marionette or legacy firefox driver mode, ignoring any related Desired Capability
Update GeckoDriver –port argument in all bindings
Grid fix NPE’s on registration when -browser not specified
Download selenium 3.0 jar files from seleniumHQ download
Firefox driver (gechodriver) for selenium 3.0

From selenium 3.0 on wards, we need to explicitly provide firefox driver (geckodriver) as firefox no longer provides default inbuilt driver.
If you will not provide the firefox driver explicitly & run as usual, then you will get exception –

Exception in thread “main” org.openqa.selenium.WebDriverException: Missing ‘marionetteProtocol’ field…

or

Exception in thread “main” “java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property;

set the system property as you do for chrome browser :
for beta 1 – System.setProperty(“webdriver.gecko.driver”, “./geckodriver.exe”);

for beta 2 – System.setProperty(“webdriver.firefox.marionette”, “./geckodriver.exe”);

Download gechodriver releases (chose for respective OS)
You can now run tests on all old and new versions of Firefox (like 46, 47 etc…)

public class Test {
static WebDriver driver ;

public static void main(String[] args) {
//beta 2 version
System.setProperty(“webdriver.firefox.marionette”, “./geckodriver.exe”);

//beta 1 version
//System.setProperty(“webdriver.gecko.driver”, “./geckodriver.exe”);

driver = new FirefoxDriver();
driver.get(“http://www.facebook.com”);
driver.quit();
}
}

public class Test {
static WebDriver driver ;

public static void main(String[] args) {
//beta 2 version
System.setProperty(“webdriver.firefox.marionette”, “./geckodriver.exe”);

//beta 1 version
//System.setProperty(“webdriver.gecko.driver”, “./geckodriver.exe”);

driver = new FirefoxDriver();
driver.get(“http://www.facebook.com”);
driver.quit();
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s