Forum Discussion
HKosova
13 years agoSmartBear Alumni (Retired)
Hi Vinay,
For example, let's suppose that we have a SubmitButton object with the following FullName value in the Object Spy:
There're two objects in the hierarchy between Page and SubmitButton - Form("aspnetForm") and Panel(0).
So, we need to use the search depth = 2.
It's a basic example, but if your object hierarchy is dynamic, you'll probably need some trial and error to determine the search depth that will work for all cases.
The search depth for FindChild equals the number of hierarchy levels (intermediate objects) between the object on which you call FindChild and the sought-for object. You'll need to examine your application in the Object Browser to determine that.
Even though the "search depth" is an optional attribute, how can we determine in what search depth the object is supposed to be present?
For example, let's suppose that we have a SubmitButton object with the following FullName value in the Object Spy:
Sys.Process("IEXPLORE").Page("http://example.com").Form("aspnetForm").Panel(0).SubmitButton("Login")and we want to use the Page.FindChild method to find this SubmitButton.
There're two objects in the hierarchy between Page and SubmitButton - Form("aspnetForm") and Panel(0).
So, we need to use the search depth = 2.
It's a basic example, but if your object hierarchy is dynamic, you'll probably need some trial and error to determine the search depth that will work for all cases.
Related Content
- 4 years agobryanhirst15223
- 6 years agosree2011
Recent Discussions
- 2 days agoMW_Didata