TestStack / White

DEPRECATED - no longer actively maintained
Other
1.02k stars 487 forks source link

Button.Click moves mouse #294

Open i00 opened 9 years ago

i00 commented 9 years ago

This seems to simulate actions a little too literally.

I think it should be able to simulate things without setting focus on the window controlling the mouse etc.

For example Button.Click moves the mouse to the location of the button sets focus on the window and then clicks. If you have a window set to always on top and over the button the window on top gets the click!... instead this should all be done through send message.

Also it would be great if you could set some properties rather than just read them ... eg window title etc. And expose the control / window / applications handle.

Kris

JakeGinnivan commented 9 years ago

Hi,

The problem with using UI automation directly is that many events do not fire. For instance, in WPF if you use AutomationPatterns.Invoke to press the button, the mouse over, mouse down, mouse up and mouse click events do not fire.

This would be something which could become a configuration option if someone wanted to do the work to abstract it into a strategy

i00 commented 9 years ago

An option would be great! ... As I quite often want to manipulate something in the background without it taking over the computer!

Kris

i00 commented 9 years ago

Also what about setting the properties such as visibility of items, setting window titles etc? Thanks, Kris

JakeGinnivan commented 9 years ago

We are limited to what UI automation can do, which is pretty limited.

To be clear, I do not see myself doing the work require to separate this any time soon. There is a heap of work which needs to be done and my time in the UK is quite limited. When I head back to Australia in about 3 months I am thinking about trying to get a bunch of people who are interested in White and organise a week where we can fix as many issues as we can and do a bunch of the outstanding work to refresh this project. It might be viable as I will have 3-4 weeks between getting back and going back to work, will have to see though as I will have other stuff going on.

If a pull request for something of this size was submitted in one go it would be quite hard to review and support if it caused regressions. A pull request with the groundwork like a configuration option and a bit of investigation into what needs to be done would be really welcome though.