Rft, qtp, and autoit

Source: Internet
Author: User


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!

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.