I must admit that I’m absolutely not a fan of testing through UI. A good program keeps the business logic separated from the UI, so it is testable without passing for the UI. In the real world we have application written by others, or you can simply have to test UI control interaction. In these scenario interacting with the UI can be a viable option. Let’s see how VS2010 can helps us.
You have a new type of unit test, called Coded UI test, when you create test the test will ask you how you will write the test
Simply choose to record action, a recording toolbar will shows up
Now simply press record, then press “Start without Debugging†on my project. My program opens (a simple form to divide two integers), and I begin interact with the form. Here is the result.
As you can see the recorded intercept the launch of my application, and the interaction with the form. When you finished recording, you can simply press the “Generate Code button†and have a new test generated.
Now I suggest you to rename the test (VS calls it CodedUITestMethod1), and when you run it, you can look at the program open again and all of your actions replayed
.
Alk.
Tags: Visual Studio
Tags: Testing, Visual Studio






November 1st, 2009 at 5:58 am
Coded UI tests aren’t available in 2010 professional versions
I’m right?
November 1st, 2009 at 12:36 pm
I do not remember well, but It seems me that you need premium to have coded ui test.
alk.
November 9th, 2009 at 4:46 am
Hi Alk – Stumbled on your blog by chance – nice blog! Will index it on my reader.
Hi Diego – You need to get the Ultimate version to use CUIT. Check out http://blogs.msdn.com/anutthar.....tures.aspx for more details.
January 24th, 2010 at 3:57 pm
The coded UI test is available with all the test components with the Visual Stuidio Ultimate edition or as stand alown license
Best Regards,
Eran Ruso
March 31st, 2010 at 11:03 am
Can anyone help me how test random label displaying in a page using coded ui test to get the labelfor value using coded ui
April 1st, 2010 at 10:13 am
Can you explain better your sceanario?
September 2nd, 2010 at 2:09 pm
hi,
i am new to coded ui can u please give me some links regarding how to work with coded ui. also earlier i worked with qtp is that experience works with this tool? and how can i start with descriptive programming in coded ui?
thanks in advance
September 2nd, 2010 at 4:23 pm
A good starting point is (http://msdn.microsoft.com/en-u.....86726.aspx) and I suggest also having a look at MTM (Microsoft Test Manager).
September 6th, 2010 at 7:09 pm
Hi,
I have a list of Doubts Please paste this link. you can find the attachment.This is comparision of CUI with QTP plz resolve this sheet
its urgent
thanks in advance
https://spreadsheets1.google.com/ccc?key=tqkK8Db1bGSy-PxNgFOzVng
October 18th, 2010 at 8:03 am
Hi Alk, i am facing a problem in clicking on an object i am giving all the search properties to click on the object it is throwing an error message like “could not able to find the control Page is refreshing” i tried with wait ,and sleep methods to wait the Execution still showing same message.is there any other way to Synchronize the tool and application?? notice that in my application page containing grid colums will be updating for every three minutes. please try to give a solution
Thanks in Advance.
October 18th, 2010 at 8:54 am
I think you should ask this question in the official forum
(http://social.msdn.microsoft.c.....st/threads) probably you can have quicker response
.
As soon as I have time I’ll try to figure out a solution, but to understand what is wrong probably you should create a working sample of your application to play with it.