Why does Mouse.ClickControl not automatically gain focus?
Posted: Thu Sep 04, 2008 2:04 pm
Hi,
I've just been having a look at Ranorex as a potential replacement for our old automation software.
I had a look through the VS2005 sample with the calculator and had a tinker.
Having looked a bit more into it, it looks like the best way of clicking something is to actually cast the clickable object from Control and then call the Click method, which bypasses the mouse. This way of doing it means you don't have to have the application in displayed. So shouldn't this be used in the example instead of the error prone "Mouse.ClickControl"?
If the application is minimised for some reason, Mouse.ClickControl just clicks where the Control used to be, and even returns a value indicating that the click was successful. So I was also just wondering why "Mouse.ClickControl" doesn't make sure the Control is there for it to click before it does the action? Otherwise whenever you use it, to be safe, you have to check Focused and the call Show() if the application is minimised (calling Focus() doesn't seem to bring the application up from the taskbar).
Many thanks.
Duncan
I've just been having a look at Ranorex as a potential replacement for our old automation software.
I had a look through the VS2005 sample with the calculator and had a tinker.
Having looked a bit more into it, it looks like the best way of clicking something is to actually cast the clickable object from Control and then call the Click method, which bypasses the mouse. This way of doing it means you don't have to have the application in displayed. So shouldn't this be used in the example instead of the error prone "Mouse.ClickControl"?
If the application is minimised for some reason, Mouse.ClickControl just clicks where the Control used to be, and even returns a value indicating that the click was successful. So I was also just wondering why "Mouse.ClickControl" doesn't make sure the Control is there for it to click before it does the action? Otherwise whenever you use it, to be safe, you have to check Focused and the call Show() if the application is minimised (calling Focus() doesn't seem to bring the application up from the taskbar).
Many thanks.
Duncan