Tuesday, January 4, 2011

Coded UI testing for Silverlight application

 

So I have started by looking at:

http://timheuer.com/blog/archive/2010/11/24/coded-ui-available-for-silverlight-4.aspx

I have manually created my testing project (wanted a different name)

Tried the application and received this error:

image

 

So it seems the video forgot a step…

So I added a reference to the dll to my Silverlight project :

C:\Program Files (x86)\Common Files\microsoft shared\VSTT\10.0\UITestExtensionPackages\SilverlightUIAutomationHelper\Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll

 

C:\Program Files\Common Files\microsoft shared\VSTT\10.0\UITestExtensionPackages\SilverlightUIAutomationHelper\Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll

 

Found this tip: http://blogs.microsoft.co.il/blogs/shair/archive/2010/07/22/coded-ui-test-tip-3-locate-controls-using-win-i.aspx

About using Window+I to locate controls – didn't work for me…

 

For coded UI I need to add ids to each element that I want to test but in Silverlight best practices it says not to!

 

Silverlight Best Practices:

http://www.kunal-chowdhury.com/2010/08/some-best-practices-for-silverlight.html

//TODO: add a link to the best practices

//TODO: too raw…