1
我想在QTP中的下面的代碼。QTP - 我如何查看ChildObjects?
隨着MSGBOX s.count,我得到的5
輸出,但我不知道如何查看這些childObjects。 請推薦。
下面是代碼:
Set Login = Description.Create()
Login("regexpwndtitle").Value = "Login"
Set AgentName= Description.Create
AgentName("attached text").Value = "Agent Name:"
Set Password= Description.Create()
Password("attached text").Value = "Password:"
Set OK = Description.Create()
OK("regexpwndtitle").Value = "OK"
Set oFlightRes = Description.Create()
oFlightRes("regexpwndtitle").Value = "Flight Reservation"
Set oButton = Description.Create()
oButton("nativeclass").Value = "Button"
oButton("windowstyle").Value = "1342177291"
Dialog(Login).WinEdit(AgentName).Set "John"
Dialog(Login).WinEdit(Password).Set "Mercury"
Dialog(Login).WinButton(OK).Click
Dim s
Set s = Dialog(oFlightRes).ChildObjects(oButton)
msgbox s
同意。另外:可以打電話給s(i)。高亮顯示哪個實例是哪個實例。直觀。 – TheBlastOne