3

My manager asked me to do some automated UI tests for our Silverlight application. The problem is that this application uses some custom controls, therefore I cannot programmatically access them right away.

The only way to access them is to use AutomationPeer, but my manager doesn't like this idea, because it goes against testing principle to change the code in order to support UI automation; the code should be tested as-is.

Is there a method or a tool that will enable me to create automated Silverlight UI tests, without the use of AutomationPeer?

jlucktay
  • 390
  • 1
  • 7
  • 23
Val
  • 629
  • 1
  • 6
  • 12

2 Answers2

6

Your custom controls should support automated testing, but that same mechanism is how accessibility tools interact with them.

Tell your manager, 'I need to add accessibility support, and automation comes free'.

In short, if you can't automate your control, a blind, deaf, and/or limited mobility person can't use it anyway.

JasonRShaver
  • 4,344
  • 3
  • 32
  • 39
  • 2
    +1 - if you have a custom control and no AutomationPeer, what you are testing is an incomplete implementation. – BrendanMcK Aug 23 '11 at 23:29
  • I agree with Jason. However, in the event you cannot take that route. Telerik Test Studio is able to work with Silverlight applications where AutomationPeer has not been implemented. It can do this because it doesn't rely on AutomationPeer. – sircody Aug 25 '11 at 01:18
  • Thanks guys! I'll try to convince him to use AutomationPeer and also investigate the Telerik Test Studio. – Val Aug 25 '11 at 22:29