QTP SystemUtil对象

'SystemUtil对象的方法用法
SystemUtil. Run "Notepad.exe"
wait 1

'关闭由QuickTest打开的所有进程
'msgbox SystemUtil. CloseDescendentProcesses
SystemUtil.CloseDescendentProcesses

'根据敞开的句柄找到相应的进程,并关闭该进程
hwnd =  Window("Notepad").GetROProperty("hwnd")
SystemUtil. CloseProcessByHwnd(hwnd)


'根据进程PID关闭进程
PID = Window("Notepad").GetROProperty("process id")
SystemUtil. CloseProcessById(PID)

'根据进程名称关闭进程
'msgbox SystemUtil.CloseProcessByName("Notepad.exe")
SystemUtil. CloseProcessByName("Notepad.exe")

'根据窗口标题关闭进程
SystemUtil. CloseProcessByWndTitle("Untitled - Notepad")



'wait 3时光标无法移动,即BlockInput方法阻止键盘或鼠标的操作扰乱QuickTest的正常运行
'wait 5时光标可以移动,解除禁止
SystemUtil. BlockInput

Browser("百度一下,你就知道").Page("163网易免费邮箱").WebEdit("WebEdit").Set "qtp_test00"
wait 3
Browser("百度一下,你就知道").Page("163网易免费邮箱").WebEdit("password").SetSecure "4fcf338be2c65c451d5febbbb214acd42e380e48c0ab8d9c04e826f8"
Browser("百度一下,你就知道").Page("163网易免费邮箱").WebButton("登 录").Click

SystemUtil. UnblockInput
wait 5
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值