Forum Discussion
Ravik
11 years agoSuper Contributor
Hi guys..
Prakash Konduru is explain descriptive programming concept very well with example.
Using Find, FindAll, FindChild, FindAllChilderen methods we can performed descriptive programming in TestComplete. (all the above methods will help for Dynamic Descriptive programming).
3- Find : - This method is used to search the object from the TestedObj hierarchy.This method searches an object with the specified values of the specified properties. here search starts from TestedObj parent node and continue upto the depth mention.
Syntax
Set myObject = TestObject.Find(PropertyName, PropertyValue, Depth)
Example - Suppose you want to search "gmail link" on google page, We will write Descriptive programming like -
Set lnkgmail = Sys.Browser("IExplorer").Page("google.com").Find("ContentText", "gmail", 10)
Here -
1- Property Name = ContentText
2- Property Value = gmail
3- Depth = 10
4- FindChild : - A TestedObj may have one or more child objects with specified values of the specified properties so in this case we will using FindChild Method. FindChild method searches child objects from the TestedObj.
Syntax -
Set myObject = TestObject.FindChild(PropertyName, PropertyValue, Depth)
Note - The difference between Find and FindChild is that, FindChild searches child objects, while Find searches TestedObj only.
5- FindAll : - FindAll method is used to search desire object from the TestedObj hierarchy. FindAll Method searches the entire object that have Specified value of the Specified properties. it's return a collection of objects and stored entire object list into an Array.
Syntax -
Set myObject = TestObject.FindChild(PropertyName, PropertyValue, Depth)
6- FindAllChildren : – FindAllChildren method is same as FindAll method (as mention above), it will search all the children and store them into an Array.
Set myObject = TestObject.FindAllChildren(PropertyName, PropertyValue, Depth)
Note - We can search a object with the combination of multiple properties and values. Suppose we want to search gmail link which is enabled on page, so in this case we will need to define arrays for Property Name and Property Value and use them like below-
Example
PropertiesName = Array ("ContentText","ObjectType", "Enabled")
PropertieValue = Array("gmail","Link", "True")
Set myObject = TestObject.FindChild(PropertiesName, PropertieValue, 100)
This May help you.
Prakash Konduru is explain descriptive programming concept very well with example.
Using Find, FindAll, FindChild, FindAllChilderen methods we can performed descriptive programming in TestComplete. (all the above methods will help for Dynamic Descriptive programming).
3- Find : - This method is used to search the object from the TestedObj hierarchy.This method searches an object with the specified values of the specified properties. here search starts from TestedObj parent node and continue upto the depth mention.
Syntax
Set myObject = TestObject.Find(PropertyName, PropertyValue, Depth)
Example - Suppose you want to search "gmail link" on google page, We will write Descriptive programming like -
Set lnkgmail = Sys.Browser("IExplorer").Page("google.com").Find("ContentText", "gmail", 10)
Here -
1- Property Name = ContentText
2- Property Value = gmail
3- Depth = 10
4- FindChild : - A TestedObj may have one or more child objects with specified values of the specified properties so in this case we will using FindChild Method. FindChild method searches child objects from the TestedObj.
Syntax -
Set myObject = TestObject.FindChild(PropertyName, PropertyValue, Depth)
Note - The difference between Find and FindChild is that, FindChild searches child objects, while Find searches TestedObj only.
5- FindAll : - FindAll method is used to search desire object from the TestedObj hierarchy. FindAll Method searches the entire object that have Specified value of the Specified properties. it's return a collection of objects and stored entire object list into an Array.
Syntax -
Set myObject = TestObject.FindChild(PropertyName, PropertyValue, Depth)
6- FindAllChildren : – FindAllChildren method is same as FindAll method (as mention above), it will search all the children and store them into an Array.
Set myObject = TestObject.FindAllChildren(PropertyName, PropertyValue, Depth)
Note - We can search a object with the combination of multiple properties and values. Suppose we want to search gmail link which is enabled on page, so in this case we will need to define arrays for Property Name and Property Value and use them like below-
Example
PropertiesName = Array ("ContentText","ObjectType", "Enabled")
PropertieValue = Array("gmail","Link", "True")
Set myObject = TestObject.FindChild(PropertiesName, PropertieValue, 100)
This May help you.
Related Content
- 5 months ago
- 14 years ago
Recent Discussions
- 4 days ago
- 4 days ago
- 7 days ago