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.
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();
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!