Selenium Web Driver C # : UI Automation on Multiple Browsers

Tarun Babbar
1 min readMay 24, 2017

--

I hope you have gone through my first story on Selenium Driver published here, where I talked about how to create your first ui automation test case using selenium driver and C#. Here, I am going little further to talk about how to do testing across multiple browsers. If you haven’t yet visited, please do visit this link to get initial idea on Selenium Web Driver.

An application is always opened on different browsers — Chrome, IE, Firefox, Safari, etc. Selenium web driver is supported for all these browsers. To verify behavior across browsers, Selenium has provided an easy mechanism to instantiate any of Chrome/FF/IE browsers. You can use the below piece of code which would help you achieve the same. Comparing with code I shown in my previous article, here I created a separate class named WebDriver, where I am initializing instance for webdriver, as per the instance required.

I have an enum where I am storing all the browser types as below:

So easy with Selenium driver !!
For more information, please look at the source code placed at github.

--

--