|
代码如下,QTP9.2自带flight3a样例程序,界面中有两个WinComboBox对象,增加一个index属性进行描述,可只能运行index:=0的那一句,求解,谢谢!
Dim DescEditlogin
Set DescEditlogin = Description.Create()
DescEditlogin("Class Name").Value = "Dialog"
DescEditlogin("Regexpwndtitle").Value = "Login"
Dialog(DescEditlogin).WinEdit("Attached text:=Agent Name:").Set "admin"
Dialog(DescEditlogin).WinEdit("Attached text:=Password:").Set "Mercury"
Dialog(DescEditlogin).WinButton("text:=OK").Click
Window("Flight Reservation").Activate
Window("Flight Reservation").winobject("nativeclass:=MSMaskWndClass").Type "121212"
Window("Flight Reservation").WinComboBox("attached text:=Fly From:","index:=0").Select "Denver" '能进行选择出发地
Window("Flight Reservation").WinComboBox("attached text:=Fly To:","index:=1").Select "Frankfurt" '不能选择目的地 |
|