Susan1202 发表于 2007-6-14 22:24:59

qtp 问题。

关于环境变量, 不知各位有没有更多的例子 。。。。 拿出来供大家参考。

gzj_06 发表于 2007-7-3 11:10:08

Action1:
'msgbox Environment.Value("TestDir")

Environment.Value("loginname")="admin"
Environment.Value("pwd")="mercury"
Environment.Value("passen")="gzj"


Action2:
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 Environment.Value("loginname")
Dialog("Login").WinEdit("Agent Name:").TypemicTab
Dialog("Login").WinEdit("Password:").SetSecure "464816ba0e7cb84c70c8f3acf7c7a4919980d757"
Dialog("Login").WinEdit("Password:").TypemicReturn
Window("Flight Reservation").ActiveX("MaskEdBox").Type "051707"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Frankfurt"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "12486   LON   08:00 AM   FRA   10:00 AM   AF   $161.90"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "sssssssss"
Window("Flight Reservation").WinRadioButton("Business").Set
Window("Flight Reservation").WinEdit("Tickets:").SetSelection 0,1
Window("Flight Reservation").WinEdit("Tickets:").Set RandomNumber(1, 10)
Window("Flight Reservation").Close
页: [1]
查看完整版本: qtp 问题。