Cheat Sheets are the most effective way to teach things to others, there is an acute shortage of Selenium WebDriver Cheat Sheets, so we have decided to create one yourself for you guys. This cheat sheet for selenium WebDriver provides all the important and commonly used methods, operations and commands for your easy daily access. In this acritical we are discussing how to play with latest version of Firefox opening as in new releases of Firefox its introduce some security Check.
STEP 01:
Place your Gecko Driver on your system’s Drive and place the path in code as mentioned below in my case it’s placed on C drive.
STEP 02:
Now Set the System property of Driver for Firefox and also give the Gecko Driver path with it as mentioned below.
STEP 03: Project Example
package FireFox_GeckoDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class FireFox_GeckoDriver
{
static WebDriver driver;
// Here we set Gecko Driver path Latest version of
// Firefox Browser cannot run without this Gecko Driver
static String driverPath = “c:\\geckodriver\\geckodriver.exe”;
public static void main(String[] args)
{
// TODO Auto-generated method stub
System.setProperty(“webdriver.gecko.driver”, driverPath);
driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get(“http://www.mtbc.com”);
}
}