[attach]75350[/attach]
代码如下:
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作者: shanfeng1419 时间: 2011-9-21 09:29
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:30 本帖最后由 jiangzi512 于 2011-9-21 10:36 编辑