Forum Discussion
ashokkumareds
10 years agoContributor
Let us take an Example:
1. There is a webpage opened in a browser. There are 4 buttons "Ok", "Cancel", "Hide" & "Sort" button on this page. Attachd is the screenshot.
2. In this page we have a webtable of 1 row and 4 columns in this page
3. The header of this table is also webtable with 2 buttons each say "Name" "Sort", "Age" "Sort", "Company" "Sort", "Salary" "Sort"
4. The 1st row 4th column there is another button named "Hide"
Say the parent is objParent like below and let us see the results -
var objParent = Browser("brow").Page("pge");
Find ("Sort" button)
-------------------------------------------------------
This methods finds/searches for required object(only 1 desired object) under the mentioned Parent and and as well as its children objects. The search is started from objParent and continues down the object hierarchy to the specified depth.
Result:-
Now this returns "Sort" button object which is present under the parent directly. There are few more sorts but this is first catch.
FindChild ("Sort" button)
-------------------------------------------------------
This methods finds/searches for required object (only 1 desired object) only under the child objects of objParent. The search is started from child objects of objParent and continues down the object hierarchy to the specified depth.
Result:-
Now this returns "Sort" button object present in the "Name" column of the header of main table. This methods ignore the parent
FindAll ("Sort" button)
--------------------------------------------------------
This methods finds/searches all objects of desired prop-values in Parent and its children objects
Result:-
Now this returns all "Sort" button objects present iunder the parent and its childrens also. The search is started from objParent and continues down the object hierarchy to the specified depth.
FindAllChildren ("Sort" button)
---------------------------------------------------------
This methods finds/searches all objects of desired prop-values in parent's children objects only (parent is ognored). The search is started from child objects of objParent and continues down the object hierarchy to the specified depth.
Result:-
Now this returns all "Sort" button objects present iunder the parent and its childrens also. The search is started from objParent and continues down the object hierarchy to the specified depth.
Hope this helps you.
Related Content
- 8 years ago
- 11 years ago
Recent Discussions
- 2 days ago