Coded UI Test–Record one application only

Generally, you will be testing a single application using Coded UI Test. By default, Coded UI Test though will record actions on all applications.  Thus you may get unwanted actions on other application in your recording. You can prevent this by adding the following configuration in CodedUITestBuilder.exe.config. <add key="IncludeProcess" value="%SystemRoot%\system32\calc.exe"/> Replace calc.exe with the full…


FAQ: Some Minutiae on DrawHighlight()

UITestControl.DrawHighlight() is a very useful method (especially during debugging). It draws a blue rectangle around the UI Test Control.   For WinMenuItems, if DrawHighlight() is called, it will click on the parent menu item to make the child menu item visible and then draw the highlight. For WinListItems inside a WinComboBox, if a DrawHighlight is…


FAQ: Do not add assertions on some properties of UI Test Control

You should not add assertions on the following properties. They will most probably fail in future test runs because they are dynamic in nature. Bounding Rectangle Window Handle Top Parent Class Name in case of winforms(sometimes)


FAQ: How can I run Coded UI Test as part of a Team Build

    An MSDN article -  How to: Configure and Run Scheduled Tests After Building Your Application – describes the steps required to run Coded UI Test as part of building the application.   For running the Coded UI test with the Build agent service, it is required to install the Test agent (or Visual…


FAQ: Currently Recording in Coded UI Test Builder

Whenever Coded UI Test Builder is recording actions on an application under test, a ‘Currently Recording’ caption is shown on the application’s title bar.     This helps you to identify that recording is going on for that application.   Sometimes, the ‘Currently Recording’ caption may stick around for some time after the application is…


FAQ: Why can’t I record actions on an application ?

Most probably, the application is running under different user credentials. Due to limitations in the underlying Microsoft Active Accessibility, we cannot record on applications which run under a different user credential from the user running Coded UI Test Builder.   NOTE: This restriction is applicable even during playback. If you are running a Coded UI…


FAQ: Why can’t I select two identical items in a HtmlList?

If an HtmlList has multiple items with the same name, you cannot select both the identical items. e.g:- this.UIMap.UIHomePageWindowsInterWindow.UIHomePageDocument.UICtl00MainContentListList.SelectedItems = new string[]{"Washington","Washington"}; In the above code snippet, two identical list items are being selected. When the above code snippet is played back, there will be no selected items in the list.   Currently this scenario…


FAQ: Why I am not able to launch a Click-Once application using ApplicationUnderTest?

You cannot launch a Click-Once application using ApplicationUnderTest.Launch(). e.g:- ApplicationUnderTest.Launch(@"C:\Users\YourName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\LOB Apps\YourApplication.appref-ms");   This will give an error: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToLaunchApplicationException: The specified executable is not a valid Win32 application. File: C:\Users\YourName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\LOB Apps\YourApplication.appref-ms. —> System.ComponentModel.Win32Exception: The specified executable is not a valid application for this OS platform.   We have made a conscious decision to allow…


FAQ: Some minutiae on HtmlListItem

HtmlListItem.HasFocus will return false always since a list item cannot be given focus manually. SetFocus on HtmlListItem will not work since a list item cannot be given focus manually. NOTE: There will be no exception thrown. Coded UI Test will continue with the next action.