Skip to main content

How to open other Browsers except Firefox using Selenium Web Driver

We can best use the Selenium Web Driver with the Firefox Browser but selenium Web Driver work with other browser also. To work with other browser, we can download the driver of the browser and set property of that driver executable file with the Selenium Web Driver to make compatible with the Selenium Web driver. below i write down the code and way to make compatible the other browser with the Selenium Web Driver.

To Open the Google Chrome driver using Selenium Web driver, we need to download the chrome driver. For downloading click here

Automation Testing, Selenium Web Driver, Open Chrome Browse

Now Following code to run Chrome Browser

    package openBrowserPackage;
   
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.chrome.ChromeDriver;
   
    public class OpenBrowserClass {
        public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver","Path of Chrome Driver");
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.google.co.in");
        }
    }


Top Open the IE driver using Selenium Web driver, we need to download the chrome driver. For downloading click here


Now Following code to run IE Browser

    package openBrowserPackage;
   
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.ie.InternetExplorerDriver;
   
    public class OpenBrowserClass {
        public static void main(String[] args) {
        System.setProperty("webdriver.ie.driver","Path of IE driver");
        WebDriver driver = new InternetExplorerDriver();
        driver.get("https://www.google.co.in");
        }
    }
 

Comments

Popular posts from this blog

What is API?

In general way, API (Application Programming Interface) is the intermediate software which is useful for two applications to communicate. API is the tool which is used for interaction of two applications. If developer developing any software which have multiple blocks (Modules) than developer use APIs to put them together.

Smoke Testing

In Smoke Testing, Testing team check the key feature or key bugs of the software. Smoke testing ensure that critical functionality of the software is working fine.If key features are not working then it is no needed to test the overall functionality because it is just waste of time. In Smoke Testing, test team check the basic feature of the software and if basic feature is not working it means software is broken very badly and further testing is unnecessary. If Smoke Testing failed then it is declared that build is unstable and revert back to developer team until smoke test is pass.

Guide to Setup Selenium Web Driver

In this Article i am describing you how to setup Selenium Web Driver in your Machine Step 1: First You need to install Java in your Computer. To download the java Click Here