51Testing软件测试论坛

标题: "is not visible"问题 [打印本页]

作者: liyf51    时间: 2008-8-19 17:38
标题: "is not visible"问题
我录制了QTP自带的订票系统,然后把登录模块编写为一个函数,如下面代码:
Function Login(username,password)
Set dlgDesc = description.Create
Set editUserDesc = description.Create
Set editPasswdDesc = description.Create
Set btnOKDesc = description.Create

dlgDesc("text").value = "Login"
editUserDesc("attached text").value = "Agent Name:"
editPasswdDesc("attached text").value = "assword:"
btnOKDesc("text").value = "OK"

Dialog(dlgDesc).WinEdit(editUserDesc).Set username
Dialog(dlgDesc).WinEdit(editPasswdDesc).Set password
Dialog(dlgDesc).WinButton(btnOKDesc).Click
End Function

下面是qtp中我修改完的部分代码;
systemutil.CloseProcessByName"flight4a.exe"
'start up software
systemutil.Run"C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
filepath = "c:\login.txt"
executefile filepath
user = DataTable("username", dtGlobalSheet)
Login user,"mercury"
回放问题出现在,点击OK按纽时提示:等录的窗口"is not visible".请高手帮忙
作者: r74110    时间: 2008-8-20 11:51
要先将 登录窗口 active
作者: 没有蛀牙    时间: 2008-8-20 16:44
我这里OK的阿
当然我注释了几步奇怪的步骤
你自己再看看
systemutil.CloseProcessByName"flight4a.exe"
'start up software
systemutil.Run"C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
'filepath = "c:\login.txt"
'executefile filepath
'user = DataTable("username", dtGlobalSheet)
Login "mercury","mercury"
或者截个图上来
作者: liyf51    时间: 2008-8-21 16:30
我来解释一下,这几个路径:
filepath = "c:\login.txt"是存放Login函数,
user = DataTable("username", dtGlobalSheet) 是Data table 中的表  username
代码好像没有问题 但是测试通不过




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