Tools for automating SilverLight application - silverlight

I want to automate the application develoepd in silverlight. Can you let me know whether there are any open source tools are available which can be used for automating SilverLight app. Thanks.

We are doing UI testing on a Silverlight application using the UIAutomation API, and it works very nicely.
Project White is a library that sits on top of UIAutomation, and many people find it helpful. I prefer to use the UIAutomation APIs directly - it's really not as hard as you might think, as my tutorial shows.

If you're looking to perform User Interface Automation (UIA) to simulate mouse clicks, keyboard presses, etc. there is no "easy" way to get this today.
I've seen some third party tools that may work, such as Telerik's. Note that I have not used and do not endorse this, just know it is out there!

I am currently trying out Project White and finding it quite easy to use.
Before using Project White I tried out WiPFlash which was also rather easy to use. It just lacked a few features that I was after (Right Click and Drag options).

Related

Windows UI Automation tools (Visual UIAVerify, Inspect.exe) recognizes the Buttons as Pane

I am using UI Automation library - TestStack.White to automate a Windows Application, where I utilize Inspect.exe to get the UI Elements from the WinForms. I have had no issues with the Inspect.exe so far except currently I am stuck with an issue in my development machine where the tool started recognizing the "Buttons" as "Pane" and the behavior is same across Visual UIA Verify, TestStack(White). Eventually all the tests are getting failed since it couldn't identify the Buttons (returns Null).
Here's what it looks like now,
[]
Here's what it used to look and it looks in a Fresh VM,
Expected,
[]
Can someone please through some light regarding this behavior or point out what would have gone wrong here ?
Thanks in Advance !
Hmm... It looks like a bug in UIAutomationCore.dll or a target application issue. I think you can't do something with that on client side. But some workarounds are possible. It's still recognized as a class name with BUTTON inside. So it's possible to do some part of your automation with a tool that can support both UI Automation (for complicated controls like WinForms list views etc) and Win32 API (like here, when it has NativeWindowHandle and adequate ClassName).
If you can consider changing the automation tool, one of the options is pywinauto. It can use Win32 API or UI Automation under the hood by your choice. The high level API is almost the same. So you can easily switch between 2 backends for different actions (having 2 different Application objects connected to one target app instance). Getting Started Guide will bring you initial guidance for the core concept.

Testing custom Silverlight controls without using AutomationPeer

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?
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.
There are several solutions. One is you can write full support via a UITestExtionsPackage Take a look at these
http://blogs.msdn.com/b/gautamg/archive/2010/03/23/writing-extension-for-wpf-custom-control.aspx
http://blogs.msdn.com/b/mathew_aniyan/archive/2011/05/17/custom-wpf-control-s-custom-properties.aspx
However this solution might be a simpler one
http://blog.benday.com/archive/2011/07/18/Silverlight-Coded-UI-Tests-with-UserControls-amp-AutomationProperties.aspx

Image recognition puzzle: Which off-the-shelf WPF library is this program using for its GUI?

I'm really curious to know which off-the-shelf WPF library this program is using for its web interface.
I'd like to use a few of the components in a small, in-house .NET program I'm writing.
Here is a couple of images showing the program in question (and if you don't know what WPF library this one is based on, please feel free to recommend your favourite).
Get a copy / trial. Look at the dll's downloaded. Third party components have very recognizable names (after all there are only some players there anyway).

How do I implement an address location bar (bread crumb control) similar to that in Windows Vista's File Explorer?

The explorer control in Windows Vista is very handy and I would like to be able to incorporate it in an application written in WPF. I've been unable to find a stock control that is part of the Framework. This application is being specifically developed for Windows Vista and therefore, having the same look and feel as the OS is desirable.
One could use the Microsoft.Win32.OpenFileDialog, but the problem with that is that it looks nothing like Vista's so it sticks out like a sore thumb.
Any thoughts on a good implementation would be most helpful. I would like to stay away from Third Party components if possible, but am definitely open to all suggestions.
Actipro makes a really good WPF breadcrumb control. There's also an open source WPF breadcrumb control that I might actually give a try.
I haven't yet tried it but look at VistaBridge... It gives you all the Vista look dialog boxes!
There is a replacement for the Microsoft.Win32 file dialogs on my blog that gives you the Vista look without the complexity of VistaBridge and is also backward compatible with XP.
http://www.nbdtech.com/blog/archive/2008/07/15/Vista-style-open-and-save-dialogs-with-WPF-without-using.aspx
At the risk of sounding self-serving, the best Breadcrumb control for WPF you can find is here:
http://www.teraque.com/Products/Explorer-Chrome-Suite
I've spent a year trying to reverse engineer the Window's Vista control because none of the off-the-shelf products provided the right look-and-feel. You will run into the limitations of all of the suggestions above sooner or later. And, having been through it myself, I can tell you that trying to embark on developing the controls yourself will take you months. The oddities surrounding the overflow logic alone will be enough to eat up two months just to get it right.
Good luck. If there's anything I can answer for you, please feel free to contact me.
Donald Roy Airey
Donald.Roy.Airey#teraque.com
If you are coding for the .net Framework 3.5, calling for the common dialog should display the correct Vista era dialog.
Sorry, appears I was mistaken. In previous projects, I was using this library to call the Vista dialogs.

Possibilities for full blown silverlight applications

Since the launch of Silverlight 2 I was expecting a lot of full blown Silverlight applications popping up but still there seem to be little evidence of this. Does anybody know of such applications out there in the wild. And also what would be the obvious applications you would develop in Silverlight. I would say mail clients are bad examples as they just as well could be written as a web/ajax app. As Silverlight is far more powerful than web+ajax possible candidates should be impossible/akward implementing as a web/ajax app.
The ones that comes to my mind is
Photo and imaging editing apps
Reporting applications
Office applications, Word/Excel...
Edit:
Added from posts
Games
The point isn't that the app need to fill the whole screen just that it isn't just a small part of a webpage, or you could call it a full blown application running inside the webbrowser, only using the webbrowser as a host.
I think the Medical app that Microsoft itself developed shows pretty well what could be achieved with silverlight http://www.mscui.net/PatientJourneyDemonstrator/
As for image editing then as I understand its a bit difficult as Silverlight lacks a Bitmap API to be able to do per pixel image editing...
Edit:
I noticed you added Word/Excel to your question and there comes the problem that Silverlight doesn't have a rich text editor built in and there hasn't been real good examples of custom implementations. There is one http://www.codeplex.com/richtextedit but I haven't seen any applications that actually use it.
I'm working on one in the medical domain.
This started as an update of a Mac classic application but due to the amount of work involved, broadened to considering other toolkits. I convinced them to go for an initial WPF desktop port to be followed by a Silverlight version.
I don't know one so far, but I could imagine that it could be used in a kind like the fullscreen video playback on youtube.
How many fullscreen desktop apps are there? Most application don't need the entire screen. If you don't want to be distracted by menus and taskbars and so you go fullscreen. Another type of applications that can use fullscreen are games.
You are limited in fullscreen to certain key presses such as arrow keys, tab, enter, and space so this rules out some of those types of apps. They have done this for security reasons so an app can't hijack the screen and record the keypresses, but I wish they could come up with a scheme to sufficiently warn the user then allow it if they consent.
An application Microsoft seem to like to show case is the AOL mail client written entirely in silverlight.
Personally I follow the rule is if you would not write it in flash you would not write it in silverlight preferring AJAX in most cases. In the past most large flash application have failed such as the flash word processor (cant remember the name) while AJAX enabled applications such as google documents have taken off.
Finally I believe until moonlight (linux and mac support) has been released and more general users have silverlight downloaded developers will be reluctant to use it widely even for smaller apps and gadgets.

Resources