Can we do descriptive programming
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2011
08:17 PM
02-13-2011
08:17 PM
Can we do descriptive programming
Hi,
Can we do scripting (descriptive programming) with TC if application is not developed ?
Thanks,
Gopal
Can we do scripting (descriptive programming) with TC if application is not developed ?
Thanks,
Gopal
15 REPLIES 15
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2011
12:30 AM
02-14-2011
12:30 AM
Hi Gopal,
Yes, this is possible. Straightforward analogue to the sample provided by ahuja1234 at http://www.geekinterview.com/talk/14-descriptive-programming.html.
You need to create wrapping functions (stubs) that will return tested objects for your (future) application and use methods/properties of the returned objects.
Yes, this is possible. Straightforward analogue to the sample provided by ahuja1234 at http://www.geekinterview.com/talk/14-descriptive-programming.html.
You need to create wrapping functions (stubs) that will return tested objects for your (future) application and use methods/properties of the returned objects.
Regards,
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2011
01:46 AM
02-17-2011
01:46 AM
Hi,
Can anyone please tell me how to achieve Descriptive Programming for Web based applications in Test Complete. I have searched lots of site but not getting anything that would be helpful to me. Please let me where can i get it.
thanks
Can anyone please tell me how to achieve Descriptive Programming for Web based applications in Test Complete. I have searched lots of site but not getting anything that would be helpful to me. Please let me where can i get it.
thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2011
09:32 PM
02-17-2011
09:32 PM
Hi,
You can address your application objects as described in the "About Working With Application Objects and Controls" help topic.
To learn how to perform functional testing of web pages, see the "Testing Web Applications" help topic and those related.
Descriptive Programming
You can address your application objects as described in the "About Working With Application Objects and Controls" help topic.
Web based applications in Test Complete
To learn how to perform functional testing of web pages, see the "Testing Web Applications" help topic and those related.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2012
03:06 AM
10-04-2012
03:06 AM
Hi,
Yes, we can do descriptive programming in Test Complete Tool.
Here are the example for Gmail Login Page:
1st Step: Click on Map Object icon -> Drag the Target Point to the Object -> Save a whole Page Object in Name Mapping.
Ex: Map Name: pageGmailLogin
After Saving the Page Object then Name Mapping shows Tree Model. like--> sys-IEXPLORE-pageGmailLogin
Sub GmailLogin()
Set iexplore = Aliases.IEXPLORE
Set Page = iexplore.pageGmailLogin
Page.Wait
' Enter User Name
NameProperty = Array("ObjectType", "ObjectIdentifier")
ValueProperty = Array("Textbox", "Email")
UserName = Page.FindAllChildren(NameProperty, ValueProperty, 7)
UserName (0).SetText ("prakash")
End Sub
'For Finding Objects, we need to click on object spy, and pass the Unique Name Properties and Value Properties
'7 = Depth of the User Name
Hope this will needful for you.
Thanks,
Prakash
prakashraju06@gmail.com
Yes, we can do descriptive programming in Test Complete Tool.
Here are the example for Gmail Login Page:
1st Step: Click on Map Object icon -> Drag the Target Point to the Object -> Save a whole Page Object in Name Mapping.
Ex: Map Name: pageGmailLogin
After Saving the Page Object then Name Mapping shows Tree Model. like--> sys-IEXPLORE-pageGmailLogin
Sub GmailLogin()
Set iexplore = Aliases.IEXPLORE
Set Page = iexplore.pageGmailLogin
Page.Wait
' Enter User Name
NameProperty = Array("ObjectType", "ObjectIdentifier")
ValueProperty = Array("Textbox", "Email")
UserName = Page.FindAllChildren(NameProperty, ValueProperty, 7)
UserName (0).SetText ("prakash")
End Sub
'For Finding Objects, we need to click on object spy, and pass the Unique Name Properties and Value Properties
'7 = Depth of the User Name
Hope this will needful for you.
Thanks,
Prakash
prakashraju06@gmail.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2013
05:58 PM
05-11-2013
05:58 PM
Hi,
I have been working with QTP (UFT) for years and now I am slowly uncovering capabilities of TestComplete.
Descriptive programming (defining test objects via properties and corresponding values) was one of the first things I was interested in.
In QTP (UFT), syntax of descriptive programming looked like this:
Browser("prop1:=val1", "prop2:=val2")
... the same in testComplete:
Sys.Browser(prop1="val1", prop2=val2)
Note:
Please, notice that in case of val1 I used apostrophe ("val1"), while in case of val2 I did not. So in used syntax example above val1 is a String data type while val2 is an integer.
example:
Sys.Browser(ObjectIdentifier="iexplore", BrowserIndex=1)
Hope this helps 🙂
I have been working with QTP (UFT) for years and now I am slowly uncovering capabilities of TestComplete.
Descriptive programming (defining test objects via properties and corresponding values) was one of the first things I was interested in.
In QTP (UFT), syntax of descriptive programming looked like this:
Browser("prop1:=val1", "prop2:=val2")
... the same in testComplete:
Sys.Browser(prop1="val1", prop2=val2)
Note:
Please, notice that in case of val1 I used apostrophe ("val1"), while in case of val2 I did not. So in used syntax example above val1 is a String data type while val2 is an integer.
example:
Sys.Browser(ObjectIdentifier="iexplore", BrowserIndex=1)
Hope this helps 🙂
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2014
04:47 PM
07-31-2014
04:47 PM
Hi Lukas Krupa,
I tried to use the descriptive programming approach as per you but didn't worked for me. Can you post any working sample code here.
Thanks,
I tried to use the descriptive programming approach as per you but didn't worked for me. Can you post any working sample code here.
Thanks,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2014
06:58 PM
07-31-2014
06:58 PM
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2014
10:58 PM
07-31-2014
10:58 PM
Yes we can! Try this one
Function Descript()
Set pg=Sys.Browser("iexplore").Page("*")
NameProperty = Array("textContent","outerText","Id","tagName")
ValueProperty = Array(strPropVal1,strPropVal2,strPropVal3,strPropVal4)
Set obj=pg.FindAllChildren(NameProperty,ValueProperty,9999999,True)
obj.Method
End Function
Based on your requirement enter the Name property and their Property value into array.
Thank you,
Srini.
Function Descript()
Set pg=Sys.Browser("iexplore").Page("*")
NameProperty = Array("textContent","outerText","Id","tagName")
ValueProperty = Array(strPropVal1,strPropVal2,strPropVal3,strPropVal4)
Set obj=pg.FindAllChildren(NameProperty,ValueProperty,9999999,True)
obj.Method
End Function
Based on your requirement enter the Name property and their Property value into array.
Thank you,
Srini.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2014
07:26 PM
08-04-2014
07:26 PM
Eh?
I presume "strPropVal1,strPropVal2,strPropVal3,strPropVal4" are all meant to be passed into the function?
And you've also hardcoded the properties available to search on, which is restrictive.
What you've posted will work, but it's using a bazooka to kill a fly. If your pages has a lot of objects, that function will be very inefficient as you're starting at the top level (Page) for every object.
What would make more sense would be to pass it a top level object and also the properties, and their values, that you want to search for. Then build and execute a command to search the child objects of the passed in object based on the parameters and the values. It might also be a good idea to pass in the depth you want it to search.
I presume "strPropVal1,strPropVal2,strPropVal3,strPropVal4" are all meant to be passed into the function?
And you've also hardcoded the properties available to search on, which is restrictive.
What you've posted will work, but it's using a bazooka to kill a fly. If your pages has a lot of objects, that function will be very inefficient as you're starting at the top level (Page) for every object.
What would make more sense would be to pass it a top level object and also the properties, and their values, that you want to search for. Then build and execute a command to search the child objects of the passed in object based on the parameters and the values. It might also be a good idea to pass in the depth you want it to search.
