|
在代码回放过程中,弹出的对话框无法自动关闭,每次都需手动关闭
在线等待各位大侠求解
代码如下:
Browser("xxxxxx").Page("xxxxxx").WebEdit("user.name").Set DataTable("username", dtGlobalSheet)
Browser("xxxxxx").Page("xxxxxx").WebEdit("user.password").SetSecure DataTable("password", dtGlobalSheet)
Browser("xxxxxx").Page("xxxxxx").WebEdit("veryCode").Set "oxh1"
Browser("xxxxxx").Page("xxxxxx").WebButton("WebButton").Click
If Browser("xxxxxx").Dialog("Microsoft Internet Explorer").Exist Then
If Browser("xxxxxx").Dialog("Microsoft Internet Explorer").static("text:=[用户名不能为空!]").Exist Then
Browser("xxxxxx").Dialog("Microsoft Internet Explorer").WinButton("确定").click
Reporter.ReportEvent micPass,"失败测试","用户名不能为空"
elseif Browser("xxxxxx").Dialog("Microsoft Internet Explorer").static("test:=[密码不能为空!]").Exist then
Browser("xxxxxx").Dialog("Microsoft Internet Explorer").WinButton("确定").click
Reporter.ReportEvent micPass,"失败测试","密码不能为空"
elseif Browser("xxxxxx").Dialog("Microsoft Internet Explorer").static("test:=[用户名或密码错误!]").Exist then
Browser("xxxxxx").Dialog("Microsoft Internet Explorer").WinButton("确定").click
Reporter.ReportEvent micPass,"失败测试","用户名、密码输入不正确"
else Reporter.ReportEvent micFail,"输入异常","输入异常错误!"
End If
else
Reporter.ReportEvent micPass,"登录成功","登录成功!"
end if |
|