Introducing Cross Browser Testing with Coded UI Tests

Introducing Cross Browser Testing with Coded UI Tests

Rate This
  • Comments 32

Coded UI Tests help automate browser based applications built on Internet Explorer. We are now enabling cross-browser testing of such applications. Users will be able to perform functional testing of web applications across IE/Firefox/Chrome.  One can use IE to record tests and validate control properties using Coded UI Test Builder. Users also have an option to hand code cross browser tests. If user needs to playback on IE, she can click on Run All in Test Explorer which plays back the recording using Coded UI inbuilt IE Plugin. On the other hand, if the user needs to playback on non-IE browser, she can set BrowserWindow.CurrentBrowser as “firefox” or “chrome” in the test depending on which browser she wants to test before running from the test explorer.  In this case, Coded UI Engine communicates with Selenium Web Driver to execute the playback. 

Hope you like this feature. Feel free to drop your feedback here

System Requirements:

  1. Operating System: Windows 8 X86 Client/Windows 8 X64/Win7 X64/Win7 X86/Win2k8 R2 SP1
  2. IE version - IE9/ classic IE10 
  3. Firefox version - 15+
  4. Chrome version - 21+
  5. Visual Studio Ultimate/Premium - VS 2012 RTM  + VS 2012 Update 1
  6. Selenium NET Bindings and the Selenium ChromeDriver made available to you through an installer on Visual Studio Gallery. Refer to the file attachment "CUIT Cross Browser Testing Acquisition" for more details

Features:

The following features are available across the various web browsers:

  • Recording support for actions and validation on supported IE browsers
  • Hand-coding scenarios support for such things as control properties, search, and playback waiters.
  • Support for popups and dialog
  • Ability to execute basic JavaScript with no return type
  • Search resilience (via smart match) and performance improvements

Scenario Videos: 

Record on IE and Playback everywhere

Author cross browser tests with Coded UI Test Builder

Author cross browser tests using plain hand coding without UI Map

Run cross browser tests sequentially on multiple browsers

Troubleshoot cross browser test failures

Known Limitations

  1. No support for Safari browser
  2. Browser launch needs to be part of the UITest. In case you have a browser already open and you want to run steps on the opened browser, playback will fail for non-IE browser windows. Hence, it is advisable to have launch too as part of the test case.
  3. Automating browser based actions such as Maximize/minimize/restore is not supported

Troubleshooting tips

 Enable HTML Logger - follow http://msdn.microsoft.com/en-us/library/jj159363.aspx

Feedback Survey:

Please fill in the survey to register your feedback on this feature: https://s.zoomerang.com/s/CrossBrowserTesting. Your feedback will help us plan for further enhancement to the cross browser feature.


Attachment: CUIT Cross Browser Testing Acquisition.pdf
Leave a Comment
  • Please add 8 and 2 and type the answer here:
  • Post
  • Does this work with Firefox version 17?

  • Does this work if I record an action recording in MTM 2012 and need to playback against Chrome?

  • Very good blog post!!!

  • After test execution, the chrome driver never close, so it cause a lot of instance of chrome driver open on test box. Is there any way to close the driver after test execution

  • In one of my test I need to get the parent/container of the selected element. I tried using both Container property and GetParent method.

    Each of the browser work differently :(

    1. IE - Returns the parent object of the selected element.

    2. Chrome and FF: Are returning the window object.

    Any help on this? Is there a way in which I can get the actual parent instead of the window object for FF and Chrome?

  • Awesome idea, thanks for the blog.

    I have found it a little hard to get test written in IE to work with chrome and have been trying another framework on top of this (CUITe) which, while doesn't support VS2012 or this feature, they work amazingly well together.

    Thanks  again

  • I'm having the same problem as Utk, when running in firefox or Chrome. When calling method like GetChildren() the wrong children objects are returned - when calling GetChildren() on a div in the following situation: <div><ul>..</ul></div> i get:

    HtmlDiv linktrack-zone-editor

       WinMenuBar System

           WinMenuItem System

               WinMenu System

                   WinMenuItem Restore

                   WinMenuItem Move

                   WinMenuItem Size

                   WinMenuItem Minimize

                   WinMenuItem Maximize

                   WinSeparator

                   WinMenuItem Close Alt+F4

       WinTitleBar BBC - Search results for richard 3rd - Mozilla Fir...

           WinButton IME

           WinButton Minimize

           WinButton Restore

           WinButton Context help

           WinButton Close

       WinMenuBar Application

       WinControl BBC - Search results for richard 3rd - Mozilla Fir...

    <cut the next 400 lines>

    Is there anywhere we can download the Cross Browser dll (Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll) so i can step though and see if it's the Selenium WebDriver or this extension getting the wrong information.

  • It appears to require vs2012 to be installed on test agents? that's a pretty heavy requirement (only got not supported exceptions without it installed).

    Now Firefox will open, but I need to update the driver to support FF 18.

    Chrome gives me an exception - System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

  • Recording in Windows 8 + IE10 seems to have a few issues - firstly I don't believe the Action Filters are working with the new start screen (or the run dialog). I ended up pinning IE10 to my taskbar to fix this issue.

    IE10 seems to see textboxes as HtmlCustom not HtmlEdit, whereas IE9 appears to be the other way around.  This makes it very hard to create a test that works in both browsers.

  • Hi,

    I have followed all the pre-requisite and have install VSTS2012 with Update-1 and Selenium components for Coded UI Cross Browser Testing. Also verified the browser version too.

    But when launch the test case to run in Chrome by adding BrowserWindow.CurrentBrowser= 'Chrome'; in my code it did not invoked the chrome browser.

    Have i missed out any configuration or pre-requisite ?

  • I recorded my script on IE9, can I playback on IE8 and IE10 using remote desktop and can I run sequentially?

  • Hi,

    I have follow this guide and i keep getting the error when running the test in firefox. It open firefox but cannot go to the url... In IE and chrome it work only firefox..

    at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.Utility.MapAndReThrow(Exception exception)

      at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.Launch(Uri uri)

      at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserFactory.Launch(Uri uri)

  • I have VSTS 2012 update 4 RC & selenium components installed.

    I am able to run test in Chrome & firefox for few steps. But there is a scenario that new chrome window opens on clicking on one control. Then I need to continue the steps in the new active chrome window.

    But Codeduitest failed to recognize the controls present in the new active Chrome window. Below is the exception error message:

    element not visible

     (Session info: chrome=30.0.1599.101)

     (Driver info: chromedriver=2.2,platform=Windows NT 6.1 x86_64)

    I suspect it's unable to read the htmldocument of the new active chrome/firefox window. While debugging i found that BrowserWindow still refers to the intial window instead of connecting to the latest new window opened by the code.

    Please do the needfull to resolve this issue.

  • say i have 1000 test cases i have to launch the non ie browser 1000 times one each test? That looks very awkward to do.

    can you please clarify?

  • Hi All,

    In my case Latest version of Firefox is supported while it is creating problem for google chrome.

    I have google chrome Version 32.0.1700.102. but Coded Ui Builder is not able to detect controls in google chrome.Can u suggest what to do to run Coded Ui in Google chrome.

    Any suggestion is welcome..

Page 2 of 3 (32 items) 123