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 1 and 6 and type the answer here:
  • Post
  • Hello

    I have a different situation here. My application supports only Google Chrome , dev team developed  this application like that and will not able to open in any other browsers. Now I am looking to automate this application. I tried to identify the objects through Coded UI test builder and I could see same properties for all controls. Even I tried to record and play back with Chrome. When I recorded all controls have been created with control type as “Document”. Is there a way to automate an application which supports only Chrome either hand coded or record and play back? Please suggest me..

  • @infovenu: You would not be able to record on Chrome as recording support for this feature is available only for the above mentioned versions of IE. Hence, Coded UI Test Builder does not work fine on other browsers. However, if you want to hand code on Chrome, you can use the Chrome Developer Tools (can be accessed by F12) to inspect properties of controls. You can then use these properties to add Search Properties in your code.

  • Hi,

    The link provided for feedback survey seems to be dead. I am getting Page not found error (Http 400 Bad Request).

    Regards,

    Pankaj

  • Hello.

    I'm trying to run Codedui tests in chrome. Here is the code i'm using:

    BrowserWindow.CurrentBrowser = "chrome";

    var browser = BrowserWindow.Launch(new Uri("http://msdn.com"));

    But i'm getting exception: "The browser chrome is currently not supported".

    I have VS2012 Ultimate and 'Selenium components for Coded UI Cross Browser Testing' installed.

    Am I doing something wrong or is there smthing i need to check?

  • Hello!

    I did following:

    - installed VS 2012 premium, vsupdate_KB2707250.exe and  CodedUITestCrossBrowserSetup.msi on Server 2012 . - downloaded chrome driver and selenium dot net bindings, unzipped these files and copied to folder as specified.

    - created new Coded UI project and recorded several actions in IE 10.

    - Run test on IE (it was executed successfully).

    - Added  BrowserWindow.CurrentBrowser = “firefox”; and run the test - test was failed with error:

    Unable to find browser window with 'Security Settings at Risk' in the title.

    Result StackTrace: at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserFactory.Locate(PropertyExpressionCollection searchProperties, PropertyExpressionCollection filterProperties)

    The same is for Chrome. Please help me with this issue.

  • I cannot hear the recordings. What do I need to download to listen?

  • Will this feature work without CTP update, by just installing Selenium components on VSTS 2010 Ultimate RTM.

    Or it is mandatory to install the CTP update for this to run on chrome?

  • Alexey_R:

    The problem is the window title. When the framework is search for the browser window to play back in it starts by looking at the window title which is added as a property when you recorded this. I had some issues with this but it's easily soved. Go to the .uitest file and edit the window title to match what is actually showing.

    Likely, when you recorded on IE some security settings were upsetting IE so it displayed that on the title but when you play back in Chrome it does not complain but shows the correct title but now the framework is looking for the title with the security warning, not the correct one.

    Hope that helps

  • @Peter: Thanks for the solution that you suggested. I hope it helps solve Alexy_R's problem. We are planning to add smart match for changing window titles in the next release. Hopefully, it will ease the problem

    @Alexy_R: You do not need to download Selenium separately. The installer that you download from Visual Studio Gallery visualstudiogallery.msdn.microsoft.com/.../CodedUITestCrossBrowserSetup.msi should install all required components for you

    Also, in case the solution suggested by Peter does not work, write to us with problem description and HTML Logs as well as UITestLogs at shubhram at microsoft dot com

  • I have a problem getting this to run on Firefox. It works fine on IE and Chrome but when I try Firefox I get the following:

    Result Message:

    Test method Med3K.Framework.WebFramework.Sanity.Smoke threw exception:

    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: No response from server for url http://localhost:7055/hub/session/b0d7759e-4327-479e-a787-0885dfa6bae9/element/%7B4ade158a-2728-4140-9693-9f6eb79182d1%7D/displayed

    and I have no idea what is wrong. I'm using Firefox 17.0 and Chrome 23.0 using scripts recorded on IE9. I'm running VS2012 Premium with the latest updates and everything installed as described above.

    The curious thing is that it doesn't fail immediately, the script starts up, launched Firefox, logs in to the application but then when it tries to interact with the webpage nothing happens for 2 minutes and then I get this failure message.

    Any ideas?

  • @Peter Harlid:

    Does the page take a really long time to load? After the login step, if you catch the UITestException and try to move ahead does that work? If that does not,  write to us with problem description and HTML Logs as well as UITestLogs at shubhram at microsoft dot com. (Or skhan at microsoft dot com)

  • Coded UI test work only in IE!!!WTF why visual studio can't find controls and class of elements in firefox and chrome? My environment VS 2012 premium, vsupdate_KB2707250.exe

  • @ch_mn,

    There isn't any audio associated with these videos.

  • Awesome article Shubhra, and thanks for Chrome & Firefox playback testing, do you know you guys will support Safari? :)

  • Currently , My team is embedded in TFS 2010. Is it possible for this. Does this Patch will work in TSF 2010.

Page 1 of 3 (32 items) 123