Aug 22, 2019 in Selenium
Q: How to launch a browser using Selenium WebDriver?

1 Answer

0 votes
Aug 22, 2019

WebDriver is an Interface. We create an Object of a required driver class such as FirefoxDriver, ChromeDriver, InternetExplorerDriver etc.,

To launch Firefox Driver:

WebDriver driver = new FirefoxDriver();

Note: If you use geckodriver with Selenium, you must upgrade to Selenium 3.3. Here we have to set the property as follows

System.setProperty("webdriver.gecko.driver", "D:\\Selenium Environment\\Drivers\\geckodriver.exe");

1

System.setProperty("webdriver.gecko.driver", "D:\\Selenium Environment\\Drivers\\geckodriver.exe");

To launch Chrome Driver:

WebDriver driver = new ChromeDriver();

To launch Internet Explorer Driver:

WebDriver driver = new InternetExplorerDriver();

To launch Safari Driver:

WebDriver driver = new SafariDriver();

Click here to read more about Selenium
Click here to read more about Insurance

Related questions

0 votes
Aug 22, 2019 in Selenium
...