In this post we will discuss working with different browser in Coded UI Testing such as Chrome, firefox and IE using the same code which we worked in previous post.
Cross-browser testing libraries does NOT ships with Visual Studio 2013 out of the box, rather, it should be downloaded as an extension from Visual Studio Extensions and Updates as shown below
You can also download from the following link https://visualstudiogallery.msdn.microsoft.com/11cfc881-f8c9-4f96-b303-a2780156628d
The extension will be installed in the common file directory of your local machine C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT
What’s the coding change?
Code change for Cross-browser testing is as simple as changing the CurrentBrowser property of BrowserWindow class
//For Chrome Browser
BrowserWindow.CurrentBrowser = "chrome"
//For Firefox Browser
BrowserWindow.CurrentBrowser = "firefox"
//The default Value for BrowserWindow is IE, hence no need to mention in property
Here is the complete Video for the above discussion.
Thanks for reading the post and watching the video!!!
Please leave your comments and let me know if there is anything need to be improved in the post.