Geeks With Blogs

News QTP and Stuff
Theo Moore Questions... Morphology? Longevity? Incept dates?

I am a huge fan of using PostMessage API calls to avoid problems with QTP recognizing Windows Dialog boxes. All you have to do is set up the call (I use a function library) and pass in the correct params. Poof! No more issues.

A prime example is the Print dialog that pops up in IE. QTP will recognize it sometimes, but usually won't. Oh, it'll highlight the window from the OR when asked, but it may tell you that the "Object is Disabled" at runtime.

I know how to call the PostMessage function and have been for some time now. Combine it with the FindWindowEX function, and you can interact with most anything. The trouble is that sometimes you have no idea what parameter to pass to tell PostMessage what to click.

I found an article where someone discussing using PostMessage and explains how to use WinSpector to find out what parameter to send. This is very cool as it gives me the ability to figure out what a particular window wants in order to make it doe what I want. Very slick.

BTW, I'll happily provide examples if anyone wants them.

Posted on Tuesday, September 23, 2008 10:53 AM | Back to top


Comments on this post: QTP: Using PostMessage

Comments are closed.
Comments have been closed on this topic.
Copyright © Theo Moore | Powered by: GeeksWithBlogs.net