51Testing软件测试论坛

标题: 时而通过这步,时而不通这步,如何解决 [打印本页]

作者: he_jian    时间: 2011-1-17 16:22
标题: 时而通过这步,时而不通这步,如何解决
本帖最后由 he_jian 于 2011-1-17 16:25 编辑

qtp在进行回放时,有时这句能通过,有时这句通过不了,是什么问题
Browser("后台管理系统").Page("后台登陆界面").WebEdit("用户名").Set (user)
出现的错误提示为语法错误
代码如下:
Function UtilAppliction(user,pwd)
'systemUtil.Run "Interent Explorer.exe","http://xxxxxxxx/admin/index.php",这句话运行时,出现语法提示
        systemUtil.Run "http://xxxxxxxxxxxxxxxxxx/admin/index.php"
        Browser("后台管理系统").Page("后台登陆界面").WebEdit("用户名").Set (user)
        Browser("后台管理系统").Page("后台登陆界面").WebEdit("密码").Set crypt.Encrypt(pwd)
        '人为干预输入验证码
Dim strCheck
                strCheck = InPutBox("Please enter checkcode:")
                Browser("后台管理系统").Page("后台登陆界面").WebEdit("验证码").Set strCheck

                Browser("后台管理系统").Page("后台登陆界面").Image("登陆").Click

End Function

'调用UtilAppliction
        UtilAppliction "admin","admin888"
作者: wolaizhinidexin    时间: 2011-1-17 17:26
set (user)  set user 或者添加一个同步
作者: he_jian    时间: 2011-1-17 17:31
不明白,能不能说具体一点,谢谢你了
作者: Jun_Li    时间: 2011-1-18 13:41
systemUtil.Run "http://xxxxxxxxxxxxxxxxxx/admin/index.php"
        Browser("后台管理系统").Page("后台登陆界面").WebEdit("用户名").Set (user)

两句之间要判断是否页面已经刷完了啊, 网络环境好当然能成功, 不好一定失败
作者: shingo0109    时间: 2011-1-20 17:32
LZ要么加个wait, 要么加个同步sync, 要直到页面刷新出来才行
作者: 17800455    时间: 2011-1-21 15:05
在前边加上。
Browser("后台管理系统").Page("后台登陆界面").sync




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2