Forum Discussion
8 Replies
Sort By
- ashokkumaredsContributor
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. - ashokkumaredsContributorHi vallalarasu,
Sorry about the wrong attachment. Please find the new one.
Kindly vote for my reply if my responses were helpful. - RavikSuper ContributorTake the reference of below thread.
http://smartbear.com/forums/f74/t97023/creating-objects-in-script-testcomplete-unable/#97038 - Vallalarasu_PFrequent ContributorThe output of each find is not the same.. Some are array, Few are variable and Can be more clear about it.
I experienced All the "Find" methods can't be used at all times.
Can you be more specific - Vallalarasu_PFrequent ContributorThanks for your response..This is better understandable than the previous one....
But not the attachement .. He He He ..! - Vallalarasu_PFrequent ContributorI have a situation here. Im Creating function by finding the objects using any of the find method. I'm going to use the functions across all the project or webpages. So the find performs as per the DEPTH used. It changes changes and the function fails. If I use a depth of huge number as 1000 or more, it finds it. But the execution is very slow.
Please help me how to resolve it?? - ashokkumaredsContributorHi vallalarasu,
The depth cannot be somthing big like 1000.
Can you be more specific on the depths you are finding the object. please post few examples.
In case depth is your only problem, keep the depth incrementing. ex as below
var arrNames = new Array("name", "class", "visible");
var arrValues = new Array("show", "button", true);
var intDepth = 0;
do
{
intDepth ++;
var objChild = FindChild(arrNames, arrValues , intDepth, true);
}while(!objChild.Exists)
hope this helps. If not please provide more details about the problem. - Vallalarasu_PFrequent ContributorIt take lot of time than the normal one as i said.... Because for every value of Depth, it has to find the object and its bad. If most advanced sites like flight booking or any other has this issue.
I'm creating a framework that find the object everytime using FIND .. So it take lot of time.
Related Content
- 8 years ago
- 11 years ago