CUITe Quick Start Guide

1) Install CUITe
Download and install the latest CUITe Framework from http://cuite.codeplex.com.
The pre-requisites for this are: (a) Visual Studio 2010 Premium or Visual Studio 2010 Ultimate (b) Visual Studio 2010 Feature Pack 2

2) Create the project
Open Visual Studio and create a new Test project (File -> New -> Project -> Visual C# -> Test -> Test Project).
Add a new Coded UI Test (record a very small test case or action such as clicking a link in a web app) into this project so that all Coded UI Test related references are created automatically and all configurations/initializations done automatically.
Now reference CUITe.dll from C:\Program Files*\Microsoft\CUITe folder.
Create a folder 'Object Repository' directly under the project root folder.

3) Create CUITe Object Repository files
Open CUITe Object Recorder (Start -> All Programs -> CUITe -> CUITe Object Recorder), and navigate to your application under test.
Click 'Record' button at the top right corner, now the recorder is ready to record object/control definitions in the page loaded.
Move the mouse over to the object/control that needs to be recorded, now you can see the html code behind it. If the object/control is the correct one, left click the mouse to generate the code. Do the same for all the objects/controls that you need to interact with in automation. Once you are done, click the 'Code' button in the toolbar, the page definition code will appear in a notepad instance. Copy the code and paste it in a new class file created under 'Object Repository' folder. Name the class file appropriately to suggest the page.

Please make sure not to mix objects/controls from different pages into one page definition class file.

CUITe Object Recorder.jpg

4) Code the Test case
All the test case code has to go into a [TestMethod] under a class attributed as [CodedUITest].
Using 'CUITe_BrowserWindow.Launch(<string sURL>)' method will launch a new IE browser instance and navigate to the URL specified.
Now, you need to create the instance of the page definition class of the page loaded to interact with objects/controls. This is how you would do it:
PAHome pgPAHome = CUITe_BrowserWindow.GetBrowserWindow<PAHome>(); 
Here 'PAHome' is the page definition class placed under Object Repository folder, and has all object/control definitions in it.
Once you have created the instance of the page definition file, you can interact with the objects/controls in the page.
It's all intellisense: oPage.oControl.Operation();

CodeTheTest.jpg

5) Run the Tests
Create a Test List or run the test cases as you would normally do with any Coded UI Test case. Enjoy!

Last edited Jun 6, 2011 at 7:45 AM by sureba, version 21

Comments

smarsten Nov 6, 2013 at 6:15 PM 
Now that Visual Studio 2013 is out, and VS 2012 is no longer available from MS, Does CUITe for VS2012 work with VS 2013? If not, what is the release date of the next CUITe build that is compatible with VS2013?

icnocop Jan 17, 2013 at 7:59 AM 
The latest source code has support for desktop applications (win32 and wpf).

OriginIce May 16, 2012 at 6:54 AM 
Windows desktop app is not supported on current release, but i think will add on next build.

jose_mb91 Apr 20, 2012 at 4:57 PM 
sorry for saying the same, but I also want to do the same for Windows desktop applications. How can I do it?

linuxaa Mar 30, 2012 at 1:25 PM 
Yes, I am struggling with the same Q: how can we do the same for Windows desktop applications?

EdStauff Oct 18, 2011 at 2:20 PM 
How do I record object/control definitions for a desktop app?