Currently we're using AutoIT for automating a few internal tools built with WinForms.
This is not a smooth process since AutoIT does not handle .NET windows very well as far as I could see.
I'm looking for a framework that is:
GUI automation is the process of simulating mouse and keyboard actions on windows and controls. Most automation tools are based either on the coordinates of the controls or the text they contain, but this is not always reliable.
Description. Provider API (UIAutomationProvider.dll and UIAutomationTypes.dll) A set of interface definitions that are implemented by UI Automation providers, objects that provide information about UI elements and respond to programmatic input.
You could use White. From the site:
White is a framework for automating rich client applications based on Win32, WinForms, WPF, Silverlight and SWT (Java) platforms. It is .NET based and does not require the use of any proprietary scripting languages. Tests/automation programs using White can be written with whatever .NET language, IDE and tools you are already using. White provides a consistent object-oriented API, hiding the complexity of Microsoft's UIAutomation library (on which White is based) and windows messages. Only stable versions of White are released, so all releases are production-ready.
Posting explicit AutoIt code from the comments...
#include <DotNetIdentification.au3>
; "Test App" is a fake application with a control named "txtShowMe".
$WindowName = "Test App"
$WindowText = ""
$control = NET_ControlGetHandleByName( $WindowName, $WindowText, "txtShowMe" )
if @error = 0 then
WinActivate( $WindowName, $WindowText )
ControlFocus( $WindowName, $WindowText, $control )
endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With