in Selenium by
Q:
How to launch a browser using Selenium WebDriver?

▼ Show 1 Answer

0 votes
by

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();

Selenium
Learn More with Madanswer

Related questions

0 votes
asked Aug 22, 2019 in Selenium by john ganales
...