Autoit
Is an open-source automation tool designed
Windows GUI
Automation can be used
Lightweight automated testing tools
.
The latest version
3.3.4
:
Http://www.autoitscript.com/autoit3/docs/history.htm
In use
Rft
,
Qtp
When automated testing tools are used for testing
Windows GUI
Difficult to recognize objects.
Autoit
Script to solve the problem.
Because
Autoit
Can be compiled
EXE
Executable File. Therefore, you can
Rft
In the following way to call
Autoit
Script:
1
First, write
Autoit
Script and convert
EXE
Executable file:
Dim $ title
Dim $ OK _contrl
$ Title ="
About
Calculator
"
$ OK _contrl = "[Class: button; text:
OK
]"
Winactivate ($ title)
Controlclick ($ title, "", $ OK _contrl)
2
In
Rft
:
Startapp
(
"Calc"
);
// Window: calc
. Exe
:
Calculator
Application menubar (). Click (Atpath
(
"Help (h )"
));
Application menubar (). Click (Atpath
(
"Help (H)-> about calculator ()"
));
String autoitscript
=
"D: // rft // rft_project // calc // autoit // closecalc.exe"
;
String
Workdir =
"D: // rft // rft_project // calc // autoit"
;
Run
(Autoitscript
, Workdir );
In
Qtp
Can be called in a similar way
Autoit
Compiled executable files:
Systemutil. Run "calc"
Window ("
Calculator
"). Activate
Window ("
Calculator
"). Winmenu (" menu "). Select"
Help
(H );
About Calculator
()"
Systemutil. Run
"Autoit/closecalc.exe"
In addition, because
Autoit
Supported
Com
Therefore, you can also call the API as follows:
Set oautoit =
Createobject ("autoitx3.control ")
Oautoit. Run "calc"
Oautoit. winactivate"
Calculator
"
Oautoit. Send "! H"
Oautoit. Send ""
Title ="
About
Calculator
"
OK _contrl = "[Class: button; text:
OK
]"
Oautoit. winactivate title
Oautoit. controlclick title
, "", OK _contrl
Oautoit. winclose"
Calculator
"
As you can see,
Autoit
To a large extent
Devicereplay
Strong!