Site Loader
Auckland, New Zealand
Selenium WebDriver supports different types of browsers by using its native as well as third party web drivers. Firefox browser is natively supported in Selenium Web driver, but for all other browsers, third party web driver are available for Selenium.

Selenium Supported browsers

Selenium supports different types of browsers, such as
  1. Firefox
  2. Chrome
  3. IE
  4. Safari
  5. Opera etc.
Here are the code snippets for Firefox, Chrome and IE Firefox
System.setProperty("webdriver.firefox.bin","F:\\Program Files   (x86)\\Firefox\\Firefox.exe");
WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
WebDriver driver = new InternetExplorerDriver();
Checkout the complete video from here Please leave your comments and thanks for watching and reading the post !!! Thanks, Karthik KK

Post Author: Karthik kk

9 Replies to “Working with Different browsers in Selenium WebDriver”

  1. Dear Karthik,
    Thanks for the video. It is really helpful.

    Following could be useful for the users
    For opera
    1. Install opera browser latest version
    2. Download and extract the opera driver to the lib directory as in the video
    3. Add the lib directory to the PATH
    4. Code snippet for Opera
    WebDriver driver = new OperaDriver();

    Note :: You can skip setting the System property when the driver is added to the PATH

    For Safari
    1. Install the Safari web browser
    2. Download safari driver latest version from Selenium download page
    3. Click on the downloaded file to install the driver on the browser
    4. Following code snippet can be used
    WebDriver driver = new SafariDriver();

    Code snippet for HTMLUnitDriver
    WebDriver driver = new HTMLUnitDriver();

    1. Awesome !!!

      Thanks for the information Janesh, this will be helpful for the community !!!

      Karthik KK

    2. Do we need to set property for HTmlUnitdriver?. IF so, please let me know. could you elaborate you blog for HtmlUntidriver

  2. PhanthomJS is another headless browser like HTMLUnitDriver

    Steps to run PhanthomJS with Selenium WebDriver.
    1. Download Phanthom JS
    2. Download the phantomjsdriver-1.1.0.jar from
    3. Add the jar file into the classpath
    4. Code snippet
    File file = new File(“E:\\PTL\\selenium\\June2015\\OrangeHRM\\install\\drivers\\phantomjs.exe”);
    System.setProperty(“phantomjs.binary.path”, file.getAbsolutePath());
    WebDriver driver = new PhantomJSDriver();

  3. Dear Karthik,
    Firefox driver is not supported by WebDriver now.
    Will you be updating the videos to reflect recent changes in WebDriver 3.x?

    Your Videos are really helpful to the community.


Leave a Reply

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