|
我录制了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".请高手帮忙 |
|