在线等待各位大家帮助
在代码回放过程中,弹出的对话框无法自动关闭,每次都需手动关闭在线等待各位大侠求解
代码如下:
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 If Browser("xxxxxx").Dialog("Microsoft Internet Explorer").static("text:=[用户名不能为空!]").Exist Then
Browser("xxxxxx").Dialog("Microsoft Internet Explorer").WinButton("确定").click
end if
这句话在代码开头处再写一遍,行不? 本帖最后由 jiangzi512 于 2011-9-21 10:36 编辑
75352
调整以后在执行到第一行参数后会弹出上边错误信息 拿出来试试。。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
Reporter.ReportEvent micPass,"失败测试","用户名不能为空"
elseif Browser("xxxxxx").Dialog("Microsoft Internet Explorer").static("test:=[密码不能为空!]").Exist then
Reporter.ReportEvent micPass,"失败测试","密码不能为空"
elseif Browser("xxxxxx").Dialog("Microsoft Internet Explorer").static("test:=[用户名或密码错误!]").Exist then
Reporter.ReportEvent micPass,"失败测试","用户名、密码输入不正确"
else
Reporter.ReportEvent micFail,"输入异常","输入异常错误!"
flag = 1
End If
If flag <> 1 Then
Browser("xxxxxx").Dialog("Microsoft Internet Explorer").WinButton("确定").click
Else
'Keep going
End If
else
Reporter.ReportEvent micPass,"登录成功","登录成功!"
end if 回复 4# Ganve_001
ok,好了,是对象没被识别吧,spy了一下
多谢你的帮助啊 好了就可以了 呵呵还是论坛里热心人多啊
页:
[1]