I am using Selenium WebDriver with Java & TestNG framework. I want to use Firefox, IE, Chrome in one single code at a time for doing cross-browser testing. I can only initialize Firefox as
driver = new FirefoxDriver();
but cannot initialize other browsers in the same way. For example:
driver = new InternetExplorerDriver();
gives the error InternetExplorerDriver cannot be resolved.
driver = new ChromeDriver();
gives the error ChromeDriver cannot be resolved.
How can I initialize IE and Chrome and execute my tests in all the desired browser ?
For C#
Add
Create a config file which will contain browser name.
Implement a method for interaction with the config file
And you can use below code for initialize browsers:
good luck!