51Testing软件测试论坛
标题:
关于描述性编程..
[打印本页]
作者:
leonyaya
时间:
2013-4-21 14:05
标题:
关于描述性编程..
Window下的Dialog的名称的一部分是动态生成的 如何用使用描述性的编程?
wait 10
Jilu= Window("Flight Reservation").WinEdit("Order No:").GetROProperty("text")
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Check CheckPoint("Order No.")
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Type Jilu
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Check CheckPoint("Order No._2")
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Customer Name").Check CheckPoint("Customer Name")
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").WinObject("Date of Flight:").Check CheckPoint("Date of Flight:")
Window("Flight Reservation").WinMenu("Menu").Select "File;Fax Order..."
ff="Fax Order No.*"
Window("Flight Reservation").Dialog("text:="&ff).Activate
Window("Flight Reservation").Dialog("text:="&ff).WinObject("attached text:=Fax Number:").Set "3334445555"
Window("Flight Reservation").Dialog("text:="&ff).WinButton("text:=Send").Click
Window("Flight Reservation").WinObject("Fax Sent Successfully").Check CheckPoint("Fax Sent Successfully")
Window("Flight Reservation").Close
复制代码
在线等..谢谢
作者:
floatIsland
时间:
2013-4-22 20:14
不了解具体情况也不太明白,从字面意思上讲要么使用正则表达式,要么就利用其它的属性来定位找到这个对象
作者:
黑羽祭
时间:
2013-4-23 09:07
回复
1#
leonyaya
看着太乱了,代码就不看了。
对于动态生成的,要么用GetROProperty进行抓取。要么用正则表达式操作。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2