51Testing软件测试论坛

标题: qtp 问题。 [打印本页]

作者: Susan1202    时间: 2007-6-14 22:24
标题: qtp 问题。
关于环境变量, 不知各位有没有更多的例子 。。。。 拿出来供大家参考。
作者: gzj_06    时间: 2007-7-3 11:10
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:").Type  micTab
Dialog("Login").WinEdit("Password:").SetSecure "464816ba0e7cb84c70c8f3acf7c7a4919980d757"
Dialog("Login").WinEdit("Password:").Type  micReturn
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




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