Geeks With Blogs

Michael Crump Microsoft MVP, INETA Community Champion and XAML Advocate.

With the release of Visual Studio 2010 Feature Pack 2, Microsoft included the Coded UI Test framework. With this release it is possible to create automated test with just a few mouse clicks. This is a very powerful feature that all Silverlight developers need to learn. Instead of my normal blog post, I have created a video tutorial that walks you through it starting from “File” –> New Project. I hope you enjoy and please leave feedback.

Video Tutorial (short 9 minute video):

Slides from the demo (only 3):

Silverlight 4 – Coded UI Testing

Code for the MainPage.xaml that was used in the Demo. For the sake of time, I did not go into the AutomationProperties.Name that I used for the TextBox or Button. I added that for each element .

<Grid x:Name="LayoutRoot" Background="White" Height="100" Width="350">
    <TextBlock Padding="15" Grid.Column="0" TextAlignment="Right">Name</TextBlock>
    <TextBox AutomationProperties.Name="txtAP" Grid.Column="1" Height="25" TextAlignment="Right" Name="txtName" />
    <Button AutomationProperties.Name="btnAP" Grid.Row="1" Grid.Column="1" Content="Click for Name"             x:Name="btnMessage" Click="btnMessage_Click" />

alt Subscribe to my feed

Posted on Saturday, December 11, 2010 7:49 PM Silverlight | Back to top

Copyright © mbcrump | Powered by: