Freigeben über


WPF UI Test Tools

We have been asked by various customers about availability of high-level WPF UI testing tools. We will be distributing WPF test guidance and we'd like to include pointers to all available WPF testing tools, so please do let us know if you have created / used such a tool. See the original post by Karsten here .

Comments

  • Anonymous
    September 02, 2007
    if any WPF testing tools or Testing code examples I am very interested in seeing them, as i will be testing WPF app and soon need all the help i can get. thanks Bruce Switzer Bruce.switzer@maxgaming.com.au

  • Anonymous
    September 03, 2007
    Hi Bruce, We are working on a document with guidance on how to test WPF applications, but I don't think it will be ready for at least a couple of months. In the mean time, we'd be happy to provide guidance on specific issues, so do let us know if you have any specific questions and we'll try to help. Thanks Ivo

  • Anonymous
    September 04, 2007
    The comment has been removed

  • Anonymous
    September 04, 2007
    Rakesh, Instead of a sleep, have you tried using the following:   TestAppProcess.WaitForInputIdle(); Using Sleep is typically a sub-optimal solution, since the wait is not deterministic (you are not waiting on an event) and since it adds unnecessary latency to your application that can quickly build up and result in poor perceived performance. Another way to get the AutomationElement for the main window of your application is by using the following method:   public AutomationElement FindAutomationElementByName(AutomationElement container, string name)   {      Condition c = new PropertyCondition(AutomationElement.NameProperty, name);      return container.FindFirst(TreeScope.Descendants, c);   } and then calling it as follows:   AutomationElement ae = FindAutomationElementByName(AutomationElement.RootElement,nameOfYourWindow);

  • Anonymous
    September 05, 2007
    Hi ivom Thanks for your suggestion. I will try this and let you know the result. I wanted to register for an automation Event,so that The automation framwork will get notified when ever the is a dialog/form opens in Test App. Also How to know whether that dialog/form is an error dialog? Is .Net 3.5 UIAumation is better than 3.0 ? Can you please recomend me a link where I can get more samples? Thanks Rakesh

  • Anonymous
    September 10, 2007
    Hi Ivom, TestAppProcess.WaitForInputIdle is working gr8 Thanks

  • Anonymous
    September 10, 2007
    Hi Rakesh, There are no significant changes in UIAutomation for the .NET framework 3.5 release. Your start point for UIAutomation articles and samples is http://msdn2.microsoft.com/en-us/library/ms753388.aspx. Thanks

  • Anonymous
    September 11, 2007
    I was able to register for the events using AutomationElement events. Is it possible to typecast the AutmationElement object to a .Net class from my code base? and How to differenciate between and error window and normal form?

  • Anonymous
    September 12, 2007
    Hmm, not exactly sure what you mean, Rakesh? What are you trying to achieve by typecasting? Typecasting is somewhat of a last resort and there is typically an alternative to it.

  • Anonymous
    September 12, 2007
    Hi Ivom, Sorry I was not clear, What I meant was, If there is a custom control I Have written, And there is an automationelement which corresponds/operates on that control at runtime, How it is possible for me to get a reference of the control which corresponds to my custom control rather than an Automation element object, So that I can do specific operations.

  • Anonymous
    September 17, 2007
    Rakesh, Could you perhaps send me sample code at ivom[at]msn.com?

  • Anonymous
    September 27, 2007
    Hi Ivom, I have posted a sample application code. Please let me know the answer.

  • Anonymous
    February 13, 2008
    We've tried to use the APIs directly but got stuck on trivial testing issues as waiting for objects etc. Now we're using a framework that utilizes the UIAutomation APIs (among others) to automate our tests. It has a record/playback feature but all recordings are in pure .NET code. Check it out at http://www.testautomationfx.com. There will be a totally free version as well according to the information we received through the beta program. We got through issues like the one Rakesh described by just using the classes we want from the framework. For instance the have a WaitForMainWindowHandle that acctually works!! ;)

  • Anonymous
    March 24, 2008
    Hi Ivom, I have already addressed most of the issues. But we have many .net 2.0 controls which are not supported by UIAutomation. Do u have any sujjestions? Rakesh

  • Anonymous
    July 17, 2008
    I've just released Beta 1.0 of NPresent: http://npresent.sourceforge.net/ It's a simple framework for developing WPF applications test-first using NUnit and NBehave.  It's still a bit raw, but contributions of code and / or feature requests are always greatly appreciated :-)