문제

I am trying the below code in QTP.

With msgbox s.count, I am getting an output of 5.

but I am not sure how to view those childObjects. Please suggest.

below is the code :

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
도움이 되었습니까?

해결책

The easiest way to do this is by looping on the ChildObjects collection and printing the relevant properties you wish to view.

For example, you could try appending the following to the code above:

NumberOfButtons = s.Count()

For i = 0 To NumberOfButtons - 1
    print s(i).getROProperty("name")
Next
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top