Introducing WPF Application Quality Guide v.0.4

WPF Application Quality Guide v0.4 has been released today at the WindowsClient.NET with new topics and updates.

This release includes several new topics and updates:
1. Suggested Roadmap – updated to include new topics
2. Data-Driven Testing – a new article about the data-driven testing practice.
3. Globalization and Localization Testing – updated w/ more details including creating localizable UI layouts in WPF and approaches to localizing WPF applications.
4. Stability and Stress Testing – a new article about stress testing principles, best practices, and useful resources.
5. Accessibility Testing – a new article about accessibility considerations, best practices and key resources.
6. Tools / TestAPI – a brief intro about the newly released TestAPIs.

The full online version can be found here.

Fun with UIAutomation and calc 2 (event handling)

Last week, I wrote about UIAutomation and calc. Now it’s time to revisit or little example program and replace the automatic start of calc and replace it a method that will wait for any calc to start and take control over that session. To abstract away the waiting code, I did create a new class called WindowOpenWaiter. Let’s take a look how we can use or new class. The full code to this blog can be found in the bottom.

The first thing we need to-do is to create a new instance of WindowOpenWaiter and give the title to the window that it should look for. Next thing is to call the wait methods with a timeout time in mille seconds so that we will not wait forever. The last thing we do is to get the element that the waiter has found for us and save it in some variable.

AutomationElement calc = null;
using (WindowOpenWaiter waiter = new WindowOpenWaiter("Calculator"))
{
    try
    {
        waiter.Wait(1000 * 10);
    }
    catch (TimeoutException e)
    {
        Console.WriteLine(e.Message);
        return;
    }
 
    calc = waiter.Element;
}

Read more

Regular expression builder

I was doing some input verification of data to method when it did hit me that it would be nice if I could do it with regular expression since I was only check if the string data was in correct format. Since I’m not an expert in regular expression I needed some type of builder or verification tool. After some searching I found this free tool RegExr that has both an online version and desktop version. The thing that I did like most was the online version that was only a click away. The program doesn’t help you that much building the regular express but it helps a lot for verifying your expressions. It also has a bunch “code snippets” that you can use as building block.
Anyway this little program did save my day to tryout some different expression to find one that did fit my needs.

So I hope that you also will find it useful.
RegExr
RegExr desktop