51Testing软件测试论坛
标题:
报“General run error”怎么解决,代码如下
[打印本页]
作者:
lp7wshishui
时间:
2011-1-5 15:22
标题:
报“General run error”怎么解决,代码如下
ExecuteFile TestPath+"Initialize.vbs"
Url(sUrl)
With Browser("name:= .*").Page("title:= .*")
.Sync
If .WebEdit("html id:= ctl00_loginview1_LoginView1_login1_ipt_UserName").Exist(0) And .WebEdit("html id:= ctl00_loginview1_LoginView1_login1_ipt_PassWord").Exist(0)Then
Reporter.ReportEvent micDone,"UserName/Password","Object Exist"
.WebEdit("html id:= ctl00_loginview1_LoginView1_login1_ipt_UserName").Set UserName
.WebEdit("html id:= ctl00_loginview1_LoginView1_login1_ipt_PassWord").Set Password
Else
Reporter.ReportEvent micFail,"UserName/Password","Object Not Exist"
End If
.WebButton("html id:= ctl00_loginview1_LoginView1_login1_btn_submit").Click
'.WebButton("html id:= btn_Agree").Click
'.Image("html id:= ctl00_loginview1_LoginView1_LoginSucess1_imglogout").Click
End With
Reporter.ReportEvent micDone,"UserName/Password","Object Exist"
报General run error错误
作者:
17800455
时间:
2011-1-5 17:20
语法错误
With Browser("name:= .*").Page("title:= .*")
建议你用 Set a = Browser("name:= .*").Page("title:= .*")
a.Sync
If a.WebEdit("html id:= ctl00_loginview1_LoginView1_login1_ipt_UserName").Exist(0) And a.WebEdit("html id:= ctl00_loginview1_LoginView1_login1_ipt_PassWord").Exist(0)Then
作者:
lp7wshishui
时间:
2011-1-5 17:40
回复
2#
17800455
仍然不行,还是一样的错误
作者:
ls_721521
时间:
2011-1-7 11:22
ExecuteFile TestPath&"Initialize.vbs"
作者:
风雪夜归人
时间:
2011-1-7 11:40
把with去掉试试,最烦的其实就是with,很多情况下都会出错,而且,这样用,一点都不酷
作者:
skyzhu
时间:
2011-1-7 11:41
没什么明显错误
换句别的语句在这个位置试试
如果是COPY来的语句,看看是不是COPY了什么无法显示的特殊符号进去了
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2