This can be achieved using Marionette and geckodriver. Marionette support is best in Firefox 48 and onwards, although the more recent the Firefox version, the more bug fixes and features. Firefox 47 is explicitly not supported. Marionette, the next generation of FirefoxDriver. Just like the other drivers available to Selenium from other browser vendors, Mozilla has released an executable that will run alongside the browser. The Selenium client bindings will try to locate the geckodriver executable from the system path. You will need to add the directory containing the executable to the system path. With Selenium 3.0 and later, you don't need to do anything to use Marionette, as it's enabled by default.
package com.packt;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class NavigateToAUrl {
public static void main(String[] args){
System.setProperty("webdriver.firefox.marionette",
"C:\\geckodriver-v0.11.1-win64\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://tecintw.blogspot.in/");
}
}
Useful links:
No comments:
Post a Comment