如果添加重复的帐号,根据web页面弹出的提示框是什么,下面以页面弹出的“确定”窗口来判断,然后在QTP的报告中打印相关的信息。
set tipWin=Browser("name:=号码百事通个人助理_超级管理员").Dialog("text:=Microsoft Internet Explorer")
if tipWin.WinButton("text:=确定").Exist(1) then
Set myStatic=Description.Create()
myStatic("nativeclass").Value="Static"
Set myObject=tipWin.ChildObjects(myStatic)
erro_repeat=myObject(1).GetRoProperty("text")
tipWin.WinButton("text:=确定").Click
.WebButton("name:=关闭").Click
Reporter.ReportEvent micDone, "添加重复的管理员失败", "无法添加重复管理员"&ad_name(num)&",系统提示:"&erro_repeat
else
Reporter.ReportEvent micDone, "添加重复的管理员没有提示失败", "添加重复管理员,系统没有提示出错"
end if