QTP测试Windows计算器

简介: QTP是自动化测试的工具,可以使用编写脚本或录制的方式进行测试自动化: 下面是对Windows自带计算器的测试 首先写入脚本,使用VBScript打开计算器 Dim oShellSet oShell=CreateObject("WSCript.

QTP是自动化测试的工具,可以使用编写脚本或录制的方式进行测试自动化:

下面是对Windows自带计算器的测试

首先写入脚本,使用VBScript打开计算器

Dim oShell
Set oShell=CreateObject("WSCript.shell")
oShell.Run "calc",1
Wait 2

然后录制

 

将自动产生脚本,然后在Edit后加入检查点,测试1+1=2(Insert->CheckPoint->Text Area CheckPoint)

界面如下:

设置要检查的值为2.

最后的脚本为

Dim oShell
Set oShell=CreateObject("WSCript.shell")
oShell.Run "calc",1
Wait 2

Window("计算器").WinButton("1").Click
Window("计算器").WinButton("+").Click
Window("计算器").WinButton("1").Click
Window("计算器").WinButton("=").Click
Window("计算器").WinEdit("Edit").Check CheckPoint("Edit_2")
Window("计算器").Close

运行后,会自动产生一个报告:(为了测试错误的信息,本人在检测点附近设置了值为3.)

 

相关文章
|
1月前
|
安全 Unix Linux
Metasploit Pro 4.22.7-2025052201 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.7-2025052201 (Linux, Windows) - 专业渗透测试框架
55 5
Metasploit Pro 4.22.7-2025052201 (Linux, Windows) - 专业渗透测试框架
|
1月前
|
安全 前端开发 Linux
Immunity CANVAS Professional 7.27 (macOS, Linux, Windows) - 渗透测试和漏洞利用平台
Immunity CANVAS Professional 7.27 (macOS, Linux, Windows) - 渗透测试和漏洞利用平台
70 3
Immunity CANVAS Professional 7.27 (macOS, Linux, Windows) - 渗透测试和漏洞利用平台
|
1月前
|
安全 测试技术 Linux
Flawnter 5.9.1 (macOS, Linux, Windows) - 应用程序安全测试软件
Flawnter 5.9.1 (macOS, Linux, Windows) - 应用程序安全测试软件
81 2
Flawnter 5.9.1 (macOS, Linux, Windows) - 应用程序安全测试软件
|
1月前
|
人工智能 安全 网络安全
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
114 4
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
|
1月前
|
数据采集 安全 Linux
Metasploit Pro 4.22.7-2025051201 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.7-2025051201 (Linux, Windows) - 专业渗透测试框架
43 4
Metasploit Pro 4.22.7-2025051201 (Linux, Windows) - 专业渗透测试框架
|
1月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.63 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.63 (macOS, Linux, Windows) - 开源渗透测试框架
49 4
Metasploit Framework 6.4.63 (macOS, Linux, Windows) - 开源渗透测试框架
|
1月前
|
安全 Devops 测试技术
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
43 0
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
|
2月前
|
存储 安全 Linux
Metasploit Pro 4.22.7-2025040601 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.7-2025040601 (Linux, Windows) - 专业渗透测试框架
116 1
Metasploit Pro 4.22.7-2025040601 (Linux, Windows) - 专业渗透测试框架
|
2月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.55 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.55 (macOS, Linux, Windows) - 开源渗透测试框架
69 0
Metasploit Framework 6.4.55 (macOS, Linux, Windows) - 开源渗透测试框架
|
3月前
|
人工智能 测试技术 API
Windows用户必备:Postman v11详细安装指南与API测试入门教程(附官网下载
Postman是全球领先的API开发与测试工具,支持REST、SOAP、GraphQL等协议调试。2025年最新版v11新增AI智能生成测试用例、多环境变量同步等功能,适用于前后端分离开发、自动化测试、接口文档自动生成及团队协作共享API资源。本文详细介绍Postman的软件定位、核心功能、安装步骤、首次配置、基础使用及常见问题解答,帮助用户快速上手并高效利用该工具进行API开发与测试。