.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Testing WPF Application w/ UIAutomation Framework

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :WPF

Hi All,


I have a pretty complex WPF application, but for simplicities sake, let's suppose I have a very simple WPF application with a Button on it.


I have a separate console application that I want to invoke the button on the WPF application. Using UIAutomation I'm having a little trouble finding the intuitive way to do this.


So far the steps for doing so look like:

  • Use Process.Start to launch WPF application
  • Use Process Id from above step to get Window handle for UI Automation framework
  • Once Window handle is obtained, find Button child element of Window
  • Invoke Button
This seems pretty straightforward, and I'm understanding the first 4 steps. The 5th step (invoking the Button), is where I'm having some trouble.

Anyone have experience with something like this?

View Complete Post

More Related Resource Links

Entity Framework: N-Tier Application Patterns


This article examines n-tier patterns for success and some of the key APIs and issues specific to the Entity Framework. It also provides a sneak peak at features coming in the Microsoft .NET Framework 4 that should make n-tier development significantly easier.

Daniel Simmons

MSDN Magazine August 2009

Mutant Power: Create A Simple Mutation Testing System With The .NET Framework


With mutation testing, the system under test is changed to create a faulty version called a mutant. Here James McCaffrey explains how to do this in .NET.

James McCaffrey

MSDN Magazine April 2006

Testing: Perform Code Coverage Analysis with .NET to Ensure Thorough Application Testing


When running your tests how do you know which parts of your product code are actually executed and tested? This article presents a complete system called Fundamental Function code coverage that operates at the method level. The author gives an overview of the system so you can understand code coverage principles, explains the key parts of the underlying code, and discusses how code coverage fits into the overall product development cycle. After reading this article you will be able to perform code coverage analysis on any .NET software system.

James McCaffrey

MSDN Magazine April 2004

Stress Testing: Custom LoadGenerator Tool Identifies the Issues Your Application Faces Under Stress


It's easy to postpone stress testing when developing an application, and it's easy to forgo it altogether. Having an easy-to-use framework at your fingertips to conduct these tests can make the task far less painful. This article walks you through an application that eases the task of generating load for a variety of layers within an application.

Brian Otto

MSDN Magazine April 2004

C# and the Web: Writing a Web Client Application with Managed Code in the Microsoft .NET Framework


When the author wanted to build a middleware Web client to connect to other applications over the Internet, he realized that the XMLHttpRequest COM object was not sufficient for his purposes. In order to build a Web client using managed code, the author had to use the HTTPWebRequest and HTTPWebResponse classes provided by the Microsoft .NET framework. These classes are used in the sample project as a substitute for the less powerful XMLHttpRequest COM object, allowing the author to build a full-featured Web client. They also take advantage of all the benefits that the CLR and managed code have to offer.

Avi Ben-Menahem

MSDN Magazine September 2001

Avoiding DLL Hell: Introducing Application Metadata in the Microsoft .NET Framework


The Microsoft .NET platform uses metadata and assemblies to store information about components, enabling cross-language programming and resolving the infamous DLL Hell problem. This article describes the use of metadata for easy linking and loading of assemblies, the relationship between metadata and concepts such as IDL and type libraries, and the metadata hierarchy. The process of reading metadata from assemblies for easy versioning is also described. Although Microsoft provides the MSIL disassembler, IDLASM, and MetaInfo.exe for accessing metadata, the author provides two sample programs that read metadata using the unmanaged metadata interfaces and the Reflection API.

Matt Pietrek

MSDN Magazine October 2000

Connection to Exchange Server of .NET 1.1 Framework application on Windows 2008 64-bit

I am running Visual Studio 2003 .NET Framework 1.1 application on Windows 2008 64-bit machine. There is only one problem - connection to Exchange Server. The same application is running fine on Windows 7 64-bit machine (not server). I tried to use the same Interop.MAPI.dll I used for Windows 7, but it doesn't work for Windows 2008.   Please help.  

Unit Testing a ASP.Net Web Application

Hi, I want to imlement the Unit Testing in my asp.net web application. How to identify the scope of this. I mean, How should i start on this front. 

2.0 application run on a machine with only 3.5 framework?

Hi all, This may be a silly question, but will an application developed in VS2005 and normally running on a machine with version 2.0 of the framework, run OK on a machine with only version 3.5 framework? I'm thinking it will as the 2.0 libraries are unchanged in 3.5??? Thanks John

Redistribute .NET Framework 4 with my application

Hi,   I have just made a custom installer for my project (previously used ClickOnce) and one problem I have is that the user is sent off to a website where s/he has to download and install .NET and then re-run my installation. That's not at all optimal. Also, it requires an internet connection.   I would like to bundle .NET Framework 4 Client Profile with my application, so the user only has to start my installation one time. I have searched around and found some talk about this aimed and .NET 1 and .NET 2.   First, am I allowed to do this? I have VS 2010 Professional, downloaded via DreamSpark using my student account. Second, how do I do this? I have checked "Microsoft .NET Framework 4 Client Profile" in Prerequisites and tried to set it to "Download prerequisites from the same location as my application" but I still get thrown away to a website where I have to manually install .NET.   Please, I need a more user-friendly deployment. :)

WPF - What is the best automated test application for testing WPF applications?

WPF - What is the best application for autmated testing of a WPF application? We use VS 2008 Professional. We do not use TFS.

Framework 1.1 Application errors when run over network




I recently picked up a project for a client that is stuck on the 1.1 framework. The application in itself is fairly straight forward. A few datagrids and pic boxes to display data from an mdb file.


When run from the host machine it works a treat and has no problems whatsoever, but when it is run from a network folder it crashes as soon as it tries to connect to the mdb file. This is running on a dev machine to match the clients so is sat on the 1.1 framework. When I run it on my machine which has all frameworks it works fine.


So does anyone know what I have to do to make this work as it's proving to be a show stopper with the client. And before you ask, they won't move frameworks, I tried getting them to do that and they said no.


Just to add as well, I have very good error trapping throughout the app and it doesn't return anything. All message returned are blank which is making it an even bigger pain in the asre. Considering it's such a simple app.





WCF (.Net framework 3.5) Call from Windows Application (.net framework 2.0) is too SLOW!!!

WCF (.Net framework 3.5) Call from Windows Application (.net framework 2.0) is too SLOW!!!

It gives more frustration when the new technology means the performance drawbacks. Do I've to dump .Net 3.5 ??????

We've a web service that is being called from the Windows Application and it is loading the initial screen after 30 seconds. The binding is done through coding:


ET2Service service = new ET2Service();
service.Url =

deployment of .Net framework based application




I want to make setup of .net framework based application in which following components must be included within setup file.


- .Net framework 2.0

- Windows Installer 3.1

- MDAC 2.8


I don't want to provide the link and let user manually download it and install it.

Setup should check whether this components are installed or not.

I tried Inno Setup maker but it requires internet to download .net framework then it installs.


My application is for india and internet is not widely spread in india till now.


Please help me ....

.Net framework 3.5 SP1 application fails to run on .NET framework 4.0.


We have a developed some PowerShell cmdlets in C# using Visual Studio 2008 / .NET framework 3.5 SP1. When we try to execute the cmdlet on a Windows XP or Windows 2003 server that has .NET framework 4.0 installed, we get the following error:


Could not load file or assembly 'System.Core, Version=, Cul

ture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The

system cannot find the file specified.


Note that this machine does NOT have .NET framework 3.5 installed on it. .NET framework 4.0 is directly installed without installing 3.5. I do not see System.Core.dll in the GAC.


On the other hand, if we first install .NET 3.5 and then install .NET 4.0, we do see System.Core in GAC and there are no issues.


Is this expected behavior? Doesn't .NET framework 4.0 installer install all the binaries from 3.5 SP1 as well?


Please advise.


Thanks for your help,


Can we freely distribute .NET framework 3.5 SP1 with our application?



Is the .NET Framework 3.5 SP1 free to distribute without obtaining a license?

I don't see a redistributable package for .NET Framework 3.5. Can I still redistribute it?


How do you move an UI testing for a web site project to a web application project?


I was not able to do unit testing for our existing web site project. I converted the web site project to a web application project. I did some unit testing and changes on the converted web application project. However, my co-worker was doing UI testing on the web site project.  We need put UI testing and unit testing to the web application project. Is it possible to move the UI testing code that my co-worker did to the web application project I am working? If so, how do you do it? Thank you for your help.

Li Ai Shen

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend