How to perform UI automation for Panels?

Y

Yash

Hi,

We are trying to automate the testing of a Win forms application
implemented in .NET 3.5. It has several panels which have a boundary
and appear like buttons. The controls are actual Panel class objects
for which the Click event is handled.UI spy recognizes the control but
does not show any Control Patterns.

We would like these panels to be accessible to a UI automation client
so that we can programmatically invoke the Click action on them. How
do we achieve this?
Is there any online tutorial that describes how this can be done?

Thanks,
Yash
 
V

Vladimir Trushkin

1. I some cases using hot keys is a solution.

2. Some tools allow you to generate a mouse button click event for a
higher level hierarchy window. For example, you may define your Panel
as a Window (for which it derives some functions) and use Window.Click
(coordinates) instead of ControlPanel.Click().

3. Another variant is introducing a special TestAPI into your system
that will handle calls from your automation tool. You will need
development assistance for it. Do not do it yourself if you do not
want to run into troubles if this code fails.

4. The last but not least idea to try is implementing a direct
SendMessage for a window using its handle. All the tools that I know
allow wrapping Windows API functions so as to used them from test
code. You can wrap SendMessage with appropriate parameters and use it
for generating a click event in any window. All you have to know is a
handle which can easily be retrieved with approrpriate function
(ControlPanel.GetHandle()).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top