UFT 添加对象库,根据对象库进行编写
1、使用对象侦测器识别对象并添加对象库
2、打开对象库,可以查看对象属性及结构
3、根据结构对象类及属性进行编写,比如登入
Dialog("Login").WinEdit("Agent Name:").Set username Dialog("Login").WinEdit("Password:").Set password Dialog("Login").WinButton("OK").Click
4、完整订票流程脚本
Dialog("Login").WinEdit("Agent Name:").Set "1231" Dialog("Login").WinEdit("Password:").Set "Mercury" Dialog("Login").WinButton("OK").Click window("Flight Reservation").ActiveX("MaskEdBox").Type "090918" window("Flight Reservation").winCombobox("Fly From:").Select 0 window("Flight Reservation").winCombobox("Fly To:").Select 1 window("Flight Reservation").WinButton("FLIGHT").Click window("Flight Reservation").Dialog("Flights Table").Winlist("From").Select 1 window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click window("Flight Reservation").WinEdit("Name:").Set "HHH" window("Flight Reservation").WinButton("Insert Order").Click