1、GetROProperty:获取被测对象运行时属性

如:window(“Flight Reservation”).WinEdit(“Name:”)

UFT GetROProperty、SetTOProperty和 GetTOProperty方法-冯金伟博客园

此时窗口值:

UFT GetROProperty、SetTOProperty和 GetTOProperty方法-冯金伟博客园

输出name 值  msgbox window(“Flight Reservation”).WinEdit(“Name:”).GetROProperty(“text”)

UFT GetROProperty、SetTOProperty和 GetTOProperty方法-冯金伟博客园

2、GetTOProperty:获取仓库对象某属性的值

如:对象库name.text 值与界面值

UFT GetROProperty、SetTOProperty和 GetTOProperty方法-冯金伟博客园

输出name 值  msgbox window(“Flight Reservation”).WinEdit(“Name:”).GetROProperty(“text”)

UFT GetROProperty、SetTOProperty和 GetTOProperty方法-冯金伟博客园

3、SetTOProperty:修改运行时被测对象属性的值

window("Flight Reservation").WinEdit("Name:").SetTOProperty "HZQ","HZQ"
msgbox window("Flight Reservation").WinEdit("Name:").GetTOProperty("HZQ")

 输出

UFT GetROProperty、SetTOProperty和 GetTOProperty方法-冯金伟博客园