原帖由 木卫十二 于 2007-11-1 10:15 发表
Dim res, WSH
Set WSH = CreateObject("WScript.Shell")
res = WSH.Popup("Closed after 2 seconds.", 2) '代替msgbox "Closed after 2 seconds"
Set WSH = Nothing
不是用msgbox了
原帖由 木卫十二 于 2007-11-1 18:15 发表
Dim res, WSH
Set WSH = CreateObject("WScript.Shell")
res = WSH.Popup("Closed after 2 seconds.", 2) '代替msgbox "Closed after 2 seconds"
Set WSH = Nothing
不是用msgbox了
Dim i
Dim res,WSH
Set WSH=Createobject("WScript.Shell")
Set Msg=Description.create()
For i=1 to 4
If (i=2) or (i=4) Then
MyMessage=MsgBox("Hello Morgan.D,",vbOK) 就是这段代码,添加后,就不会报错了。如果不添加,则要象下列抓拍图一样报错。
res = WSH.Popup("Closed after 2 seconds.", 2) '代替msgbox "Closed after 2 seconds"
Set WSH = Nothing
else
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "admin"
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").Type "MERCURY"
Dialog("Login").WinEdit("Password:").SetSecure "472ff7785a1452302b5089fbd42d83c7c005d116"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
'**********************************************
MyMessage=MsgBox("Hello Morgan.D,",65,"MsgBox Example")
msg("text").value="MsgBox Example"
dialog(msg).close
'*******************************************
End If
Next
原帖由 loho1968 于 2007-11-2 13:39 发表
QTP自己设置的MSGBOX也是一个对象
Set Msg=Description.create()
msg("text").value="MsgBox Example"
dialog(msg).close
Dim i
Dim res,WSH
Set WSH=Createobject("WScript.Shell")
Set Msg=Description.create()
For i=1 to 4
If (i=2) or (i=4) Then
MyMessage=MsgBox("Hello Morgan.D,",vbOK)
res = WSH.Popup("Closed after 2 seconds.", 2) '代替msgbox "Closed after 2 seconds"
Set WSH = Nothing
else
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "admin"
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").Type "MERCURY"
Dialog("Login").WinEdit("Password:").SetSecure "472ff7785a1452302b5089fbd42d83c7c005d116"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
'**********************************************
MyMessage=MsgBox("Hello Morgan.D,",65,"MsgBox Example")
msg("text").value="MsgBox Example"这段代码在试验时,报错了,具体如抓拍图所示。不明白错误到底错在哪里?还有一个就是msg()里面添加的text这个text代表那个text,是具体指msgbox里面titile的内容,还是就是一个随便定义的一个参数而已? dialog(msg).close '*******************************************
End If
Next
原帖由 木卫十二 于 2007-11-1 18:15 发表
Dim res, WSH
Set WSH = CreateObject("WScript.Shell")
res = WSH.Popup("Closed after 2 seconds.", 2) '代替msgbox "Closed after 2 seconds"
Set WSH = Nothing
不是用msgbox了
原帖由 loho1968 于 2007-11-2 13:39 发表
QTP自己设置的MSGBOX也是一个对象
Set Msg=Description.create()
msg("text").value="MsgBox Example"
dialog(msg).close
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |