Selenium WebDriver Cheat Sheet – Selenium FireFox Version Compatibility

Posted by

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

  1. package FireFox_GeckoDriver;
  2. import org.openqa.selenium.WebDriver;
  3. import org.openqa.selenium.firefox.FirefoxDriver;
  4. public class FireFox_GeckoDriver
  5. {
  6. static WebDriver driver;
  7. // Here we set Gecko Driver path Latest version of
  8. // Firefox Browser cannot run without this Gecko Driver
  9. static String driverPath = “c:\\geckodriver\\geckodriver.exe”;
  10. public static void main(String[] args)
  11. {
  12.        // TODO Auto-generated method stub
  13.        System.setProperty(“webdriver.gecko.driver”, driverPath);
  14.        driver = new FirefoxDriver();
  15.        driver.manage().window().maximize();
  16.        driver.get(“http://www.mtbc.com”);
  17.        }
  18. }

Leave a Reply

Your email address will not be published. Required fields are marked *