views:

453

answers:

3

I am considering porting a WPF application to Silverlight. However, the WPF application uses Watin to spawn IE processes and automate certain tasks.

My question is if there is a way to automate tasks in Silverlight by spawning popups and performing tasks in them similar to how you would with Watin.

A: 

As far as I know WatiN is a web application test framework, but your question seems to indicate that you are using WatiN to automate tasks in your application. In that context I will try to answer your question.

A Silverlight application is executed in a sandboxed environment and is unable to start new processes on the local computer. However, a Silverlight application can interact with the browser object model that is used to host the Silverlight application. This allows for some interaction with the local environment. If you can fit your use of WatiN into this model you are able to do it from Silverlight but in general you should consider a Silverlight application to live in a sandboxed environment.

Martin Liversage
A: 

Have you had a look at the Silverlight Automation Peer?

http://msdn.microsoft.com/en-us/library/cc645045(VS.95).aspx

Ray Booysen
+2  A: 

I haven't tried this tool yet, but it is the closest I've found to Watin for Silverlight. It is WebAii from Telerik and it is a free download. I ran across it the other day and plan to try it soon.

WebAii Testing Framework plugs directly into the Silverlight application it automates and has access to every single element/object in the entire Silverlight application. Beside the ability to perform basic automation actions like clicking, moving and setting text, the tool gives you access to complex properties on UI elements such as brushes, borders and even transform matrices. What’s best is that you can set most of these properties, which is crucial for test verifications and synchronizations.

Bryant