The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Software Testing >> Automated Testing

Pages: 1
MArk B.
Advanced Member


Reged: 10/04/02
Posts: 509
Loc: Federal Way, WA
Using UI Automation built into WPF to test
      #374411 - 04/19/07 11:02 AM

WPF is Windows Presentation Foundation. It is built into Windows Vista and can be used on Windows XP. It has libraries with built-in hooks to enable automated testing among other things. It is not for the faint of heart or inexperienced.

To use it you're going to need a development environment like Micorsofts Visual Studio and be able to do some serious programming. I'm posting this in hopes that a community that people like me can go to will develop as more testers start using it.

Learn more here:
http://www.codeproject.com/WPF/UIAutomation1.asp
http://www.codeproject.com/WPF/UIAutomation2.asp

http://blogs.msdn.com/abhinaba/archive/2006/06/27/648221.aspx
http://blogs.msdn.com/abhinaba/archive/2006/07/06/657168.aspx

It's a real pain to get started with. I'm still trying to get it figured out enough to do something valuable. So far, I've got it navigating around in the File Save dialog in IE. My first project is to get it to navigate to a web page and then download a file. Part of my problem is I'm working in C# and that's a new language for me.

I'll try to post more as I move along.

MArk B.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Corey_G
Veteran


Reged: 09/14/01
Posts: 4281
Loc: Boston, MA
Re: Using UI Automation built into WPF to test [Re: MArk B.]
      #374440 - 04/19/07 12:11 PM

Mark.. good stuff.. i might investigate further (I'm also a C# developer)

though I am hoping that by the time WPF (or avalon or winfx or silverlight or .net 3.0, or whatever microsoft feels like naming it this week) is commonplace, I will no longer be working on any MS platform.. (ahh we can dream..)

--------------------
Corey Goldberg
Homepage: goldb.org
Twitter: twitter.com/cgoldberg
Google+: gplus.to/cgoldberg


Post Extras: Print Post   Remind Me!   Notify Moderator  
rong
Advanced Member


Reged: 10/19/05
Posts: 411
Loc: UK
Re: Using UI Automation built into WPF to test [Re: Corey_G]
      #376789 - 04/29/07 05:11 PM

Mark,

I have recently started testing a WPF application using QTP and although there are many of the standard methods and properties available, I think there is still a need to develop a level of extensibility for at least the AutomationElement object. I have noticed that manipulation of objects within the test environment doesn't always fire the correct events - e.g. setting the selected item in a WpfComboBox doesn't fire the OnChange event. In this case there is a need for additional function libraries and also in the detection of ChildObject controls within WpfGrid objects.

There is a general lack of info pertaining to the testing of WPF as opposed to development with WPF. This forum would obviously provide an ideal window onto experiences in this area and I think this could become a hot topic fairly soon.

Unfortunately I am away in UK on holiday during May, but would like to continue this thread and add anything constructive, on my return.

--------------------
Ron
*******
If you had to identify, in one word, the reason
why the human race has not achieved, and never
will achieve, its full potential that word would be "meetings".


Post Extras: Print Post   Remind Me!   Notify Moderator  
nahimov
Member


Reged: 04/28/05
Posts: 42
Re: Using UI Automation built into WPF to test [Re: rong]
      #377572 - 05/02/07 11:16 AM

I'm also trying to automate using WPF AutomationElement objects. So far the technology seems to be very raw at this point. When using FindAll or FindFirst functions on some screens it would go into an infinite loop. I'm trying to automate MFC type application so maybe that is the reason. I suspect that FindAll for Win32 apps is using GetWindow API which is unrealable and does have issues with infinite loops. I ended up writing my own function where I use EnumChildWindows API to loop through all children and then using AutomationElement.FromHandle to take advantage of WPF API. The result is somewhat slow atomation but workable. If interested I can keep you guys updated on my efforts.

Post Extras: Print Post   Remind Me!   Notify Moderator  
rong
Advanced Member


Reged: 10/19/05
Posts: 411
Loc: UK
Re: Using UI Automation built into WPF to test [Re: nahimov]
      #377670 - 05/02/07 05:26 PM

nahimov,

Yes please - keep it coming.

I have also been talking to HP/Mercury with regard to some improvements in AutomationElement functionality.

Currently, I have a problem with child browsers which provide, basically, a web application within another web application. At present the Test tool (QTP) can only detect the child browser object - nothing in it.

--------------------
Ron
*******
If you had to identify, in one word, the reason
why the human race has not achieved, and never
will achieve, its full potential that word would be "meetings".


Post Extras: Print Post   Remind Me!   Notify Moderator  
nahimov
Member


Reged: 04/28/05
Posts: 42
Re: Using UI Automation built into WPF to test [Re: rong]
      #378450 - 05/06/07 11:30 AM

Quote:

nahimov,

Yes please - keep it coming.

I have also been talking to HP/Mercury with regard to some improvements in AutomationElement functionality.

Currently, I have a problem with child browsers which provide, basically, a web application within another web application. At present the Test tool (QTP) can only detect the child browser object - nothing in it.




What is this other application written in? Is it java, activex, flex, flash?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Byron_Goodman
Member


Reged: 01/04/07
Posts: 49
Loc: Mission Viejo, CA
Re: Using UI Automation built into WPF to test [Re: nahimov]
      #380632 - 05/14/07 04:47 PM

I have experimented with the UI Automation framework a bit, too. There is an issue with it that causes issues trying to automate derived databound controls in WPF. The framework simply does not recognize those controls. Even assigning specific UI Automation IDs does not solve the problem.

Here is a link that calls out some other useful information:
http://msdn2.microsoft.com/en-us/library/aa349646.aspx

I also found that TestComplete was having the identical issue, althought their tech support claimed to not be using the UI Automation Framework.

Until I find a solution to the above issue, I won't be able to automate this application - a first for me!

--------------------
Humble QA servant


Post Extras: Print Post   Remind Me!   Notify Moderator  
rong
Advanced Member


Reged: 10/19/05
Posts: 411
Loc: UK
Re: Using UI Automation built into WPF to test [Re: Byron_Goodman]
      #387020 - 06/06/07 08:42 PM

Sorry I haven't answered before now, but I've been on leave.

Nahimov, the other apps vary between terminal emulation, html and .Net. They are fundamentally derived from their own host application as a service, so I am not too worried as I can automate them via their native application.

I am more concerned with things like:
extracting data from grid cells
modifying data and firing their onchange events (this is possible using keyboard emulation - Type method - but would rather use standard Set methods)

So far I have managed to use various .Net spy utilities to derive child objects to interrogate but specifying, say, a cell by its row and column or returning the GridDataItem seems impossible.

Thanks, Byron, I try to follow all leads/links and quite believe that the problems are not confined to one test tool (hence posting in this forum) and involve lack of info for testing.

Ron

--------------------
Ron
*******
If you had to identify, in one word, the reason
why the human race has not achieved, and never
will achieve, its full potential that word would be "meetings".


Post Extras: Print Post   Remind Me!   Notify Moderator  
stark05
Newbie


Reged: 06/21/07
Posts: 1
Re: Using UI Automation built into WPF to test [Re: rong]
      #391446 - 06/21/07 09:12 AM

Hi rong,

I recently saw a dialog in which i believe you said you were testing a WPF based appw with a QTP release?!

If I'm correct, which release version was that, b/c an HP rep has told me I have to wait b/c such a release is not yet available.

Thanks,
stark


Post Extras: Print Post   Remind Me!   Notify Moderator  
rong
Advanced Member


Reged: 10/19/05
Posts: 411
Loc: UK
Re: Using UI Automation built into WPF to test [Re: stark05]
      #391607 - 06/21/07 05:12 PM

Hi Stark,

Yes, I am using QTP 9.2 with the latest (9.2) .Net addin which supports WPF objects. You can download the trial from the support site.

At present it is going very well and the .Net Forms Spy tool is an absolute boon - lets you interrogate all the available object properties.

I have a few gripes, though. You need to be aware of what you can do with the object patterns and currently there is no way to fire events. As I mentioned before, there is very little helpful documentation to make testing easier.

Ron

--------------------
Ron
*******
If you had to identify, in one word, the reason
why the human race has not achieved, and never
will achieve, its full potential that word would be "meetings".


Post Extras: Print Post   Remind Me!   Notify Moderator  
p_chris
Newbie


Reged: 04/30/08
Posts: 4
Re: Using UI Automation built into WPF to test [Re: rong]
      #576615 - 06/25/09 01:44 AM

Hi Ron,

maybe you'll have a look on the tool set of Ranorex. They provide a nice spy tool which provides all required information of your WPF/Silverlight applications. In addition the Ranroex automation library is really interesting to realize smart test automation modules.

Christoph


Post Extras: Print Post   Remind Me!   Notify Moderator  
libin1234
Newbie


Reged: 10/24/12
Posts: 11
Re: Using UI Automation built into WPF to test [Re: p_chris]
      #719513 - 11/08/12 01:50 AM

If you are able to successfully import UIAutomationcore.dll you can write the user defined functions to perform methods on WPF objects using Excel VBA.I could automate a complete WPF application in excel VBA using MS UI automation. However a challenge with VBA is lack of support for OOPS concept. Incase if the application has a custom control, it will be difficult to get the control patterns using VBA. Still investigating how to get the handle of custom controls using excel VBA.....

Regards
Libin


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 7 anonymous users are browsing this forum.

Moderator:  Elfriede Dustin, AJ, Joe Strazzere 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 15291

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5