sankar_k
11 years agoOccasional Contributor
Clarification on FindAllChildrenMethod
Hi There
I am trying to automate a .net application using Testcomplete. I am refering one of the frame in the application as follows
Set calc = Sys.Process("Client").WinFormsObject("MainFrame").WinFormsObject("LoginBrowserControl").WinFormsObject("loginParameters1").WinFormsObject("loginGroupWrapper")
Set calc = NameMapping.Sys.Client.MainFrame.LoginBrowserControl.loginParameters1.loginGroupWrapper
Both reference works and I am able to print properties as follows
Log.Message(calc.WndCaption)
Log.Message(calc.WndClass)
However, I am trying to apply FindAllChildrenMethod it throws an error "Object Required". I have gone through the documents and am not able to find what am missing here. Appreciate your help.
Thanks
Sankar
I am trying to automate a .net application using Testcomplete. I am refering one of the frame in the application as follows
Set calc = Sys.Process("Client").WinFormsObject("MainFrame").WinFormsObject("LoginBrowserControl").WinFormsObject("loginParameters1").WinFormsObject("loginGroupWrapper")
Set calc = NameMapping.Sys.Client.MainFrame.LoginBrowserControl.loginParameters1.loginGroupWrapper
Both reference works and I am able to print properties as follows
Log.Message(calc.WndCaption)
Log.Message(calc.WndClass)
However, I am trying to apply FindAllChildrenMethod it throws an error "Object Required". I have gone through the documents and am not able to find what am missing here. Appreciate your help.
Thanks
Sankar
- Hi Sankar,
The FindAllChildren method searches for an object by its identification properties. For example, you could find the loginGroupWrapper object in the following way:
Dim logCntrl, PropArray, ValuesArray, calc
Set logCntrl = Sys.Process("Client").WinFormsObject("MainFrame").WinFormsObject("LoginBrowserControl")
PropArray = Array("WndClass", "WndCaption")
ValuesArray = Array("<Value of WndClass>", "<Value of WndCaption>")
calc = logCntrl.FindAllChildren(PropArray, ValuesArray, 5)
If UBound(calc)>= 0 Then
....
End If