Descriptive programming is creating of description of
objects so that they can be identified once executed from QTP. It is approach for object identification together with object repository.
Description object creates a collection
of object based on object matching the defined properties.
we have defined an description object odesc.
We can use ochkbox.count to get objects
matching the description
Why Descriptive Programming:
Descriptive
programming is useful due to following reasons:
- It reduces the effort of maintaining and associating object repository with the test.
- Maintenance is simpler.
- In scenarios, when application is not developed but we know the properties of objects that will be added in the application. In such scenarios , we cannot maintain object repository since application is not ready and Objects cannot be learned from the application. So Using Descriptive programming, we can prepare the scripts which can be executed once application is up and running.
- It is useful when performing similar actions on multiple objects with similar properties
- It is useful when object can be uniquely identified using fewer set of properties existing across multiple set of objects.
OR Vs Descriptive programming
When QTP learns an object during recording session or
through object spy, object is identified and saved in object repository. QTP
saves properties like innertext, name for the object in the object repository
to uniquely identify an object. Similar to this, Descriptive programming
creates a unique description of the object which is identified.
With using Object Repository, we can use features like relative identifier, and other QTP specific features. Also time to create
script based on descriptive programming is more compared to object repository. So for projects and for limited use of automation pack and applications with mostly static pages, Object repository can be
better approach.
Types of Descriptive programming
Descriptive Programming can be implemented in following
ways.
- Creating description string
- Using Description object.
Let us discuss the ways in some
details:
- Creating description string:
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Set
“DP”
Above we created a description string similar
to tree structure we see in expert view.
Below are few points to remember in creating description strings.
1. The parent object in the string can be used from
Object repository, in case child object is defined in string.
2. Child objects cannot be used from OR if string description is described for parent
in the tree.
Browser("Google").Page("Google").WebEdit("name:=q").Set
“DP” is possible but
Browser("title:=Google").Page("title:=Google").WebEdit("q").Set
“DP” will not identify the object
In case multiple objects are to defined , they needs to be separated by , .
In case multiple objects are to defined , they needs to be separated by , .
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q”,html
tag = In").Set “DP”
To identify the properties of the
object to be used in descriptive programming, Go to Object Spy and click on
object.
- Go to Identification button and properties tab
- Select properties and property values and create string such that the identification is unique.
In case of multiple objects with
same properties, we can use index property to identify object based on indexing.
- Using Description.Create:
Description object creates a collection
of object based on object matching the defined properties.Steps in description Object
1. Define description object:
set odesc = description.createwe have defined an description object odesc.
2. Add property to the object defined in step
above.
odesc(“name”).value =”q”
odesc(“html tag”).value
=”Input”
we have defined the object with properties.
3. Replace string with description object.
Browser("title:=Google").Page("title:=Google").WebEdit(odesc).Set
“DP”
we have replaced string with description object.
This description object can also be used to find child
objects in the tree structure. For e.g : we can find all the links in the pages, check box, perform action on all the objects in the collection.
Below code explains the same:
odesc = Description.create
odesc(‘”html tag”).value =”Input”
odesc(“type”).value = “checkbox”
Set ochkbox =
Browser("title:=Google").Page("title:=Google").childobjects(odesc)
For each obj in ochkbox
obj.set “ON”
Next
It was very nice article and it is very useful to
ReplyDeleteTesting tools learners.We also provide Testing tools online training
QTP Programming is really nice.It really helpful for the testing.Thanks for the blog.
ReplyDeleteSelenium Training in Chennai | Software Testing Training in Chennai | Software Testing Training in Chennai | QTP Training in Chennai
It was really a wonderful article and I was really impressed by reading this blog. We are giving all software and Database Course Online Training. Oracle Training in Chennai is one of the reputed Training institute in Chennai. They give professional and real time training for all students..
ReplyDeleteOracle Training in chennai
QTP Training in Chennai,
ReplyDeleteThank you for the informative post. It was thoroughly helpful to me. Keep posting more such articles and enlighten us..
hybernet is a framework Tool. If you are interested in hybernet training, our real time working.
ReplyDeleteHibernate Training in Chennai,hibernate training in Chennai
Testing is the only way to deliver reliable products in the Information Technology market(Software testing training in chennai). Articles like this are vital in improvising one's ability as a software testing professional(Automation testing courses in chennai). Thank you so much for sharing this information in here(Software testing institute in chennai). Keep blogging.
ReplyDeleteNice post..
ReplyDeletePerfect!!! What I can say in this article is very important to be written as it may help everybody to get awareness. Good job done.
ReplyDeleteSOFTWARE TESTING Training in noida
Selenium will support too many popular languages like Java, C#, etc,. But, that doesn't mean Java and c# is a pre-requisite before learning Selenium.
ReplyDeleteSelenium Training | Python Training | Pentaho Training | LoadRunner Training | WebSphere Training | Node.js Training
ReplyDeletegreat article!!!!!This is very importent information for us.I like all content and information.I have read it.You know more about this please visit again.
Testing Training with Live Project
reat article!!!!!This is very importent information for us.I like all content and information.
ReplyDeleteoracle training in chennai
• such a good website and given to more information thanks! and more visit..
ReplyDeleteandroid training in chennai
• Looking for real-time training institute.
ReplyDeletejava training in chennai
Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
ReplyDeleteoracle training in chennai
dot net training in chennai
ReplyDeletethanks so much
microstrategy training in chennai
ReplyDeleteThanks for sharing this informative blog. Keep update your blog.
• best and useful sites and I like the sites
ReplyDeletemicrostrategy training in chennai
important informatio....
ReplyDeleteoracle training in chennai
oracle training in chennai
oracle training in chennai
oracle training in chennai
oracle training in chennai
oracle training in chennai
Online Training.| AWS Training,AWS Online Training,AWS Training Online
ReplyDeleteyou have post an very useful information. Keep update.. Thank you...
ReplyDeleteSelenium Training in Chennai | Cloud Computing Training in Chennai
You have explained Well about descriptive programming. Great effort. Keep updating.
ReplyDeleteOracle dba course | Oracle dba training
Real Estate Consultant in Chennai
ReplyDeleteReal Estate Private Equity in India
Real Estate Advisory Companies in India
Real Estate Research in Chennai
Real Estate Tax Advisor in Chennai
Portfolio Management Services in Chennai
Webtrackker is the best web development company in Noida
ReplyDeleteWebsite Development Company in Noida,
Website Development Company in Noida sector 64,
Website Development Company in Noida sector 63,
Website Development Company in Noida sector 62,
Website Development Company in Noida sector 58,
Website Development Company in Noida sector 55,
Website Development Company in Noida sector 5,
ReplyDeleteWebsite Development Company in Noida sector 37,
Website Development Company in Noida sector 2,
Website Development Company in Noida sector 18,
Website Development Company in Noida sector 15,
React.JS online training in india
ReplyDeletePython online Training in India
Oracle DBA online training in India
Java online Training in India
SAP online Training In india
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.
ReplyDeleteBest AngularJS Training in Chennai
Hadoop Training in Chennai
Big Data Training in Chennai
This was some very inciteful and useful information. I appreciated the candor in not checking multiple times a week, as I do! :-) You are correct in saying that efforts can be focused on building additional link sources. Thanks for the reminder.Thanks for posting useful information.
ReplyDeleteAngularJS Training Institute in Chennai
AngularJS Cetification Training in Chennai
AWS Training in Chennai
AWS Devops Training in Chennai
DevOps Certification in Chennai
DevOPs Certification Training Institute in Chennai
Best AngularJS Training in Chennai
AngularJS Training in Chennai
Nice post. I learn something tougher on different blogs everyday. It’s going to all the time be stimulating to read content material from other writers and observe a little bit something from their store. I’d favor to make use of some with the content material on my weblog whether you don’t mind.
ReplyDeleteAngularJS Training Institute in Chennai
AngularJS Cetification Training in Chennai
AWS Training in Chennai
AWS Devops Training in Chennai
DevOps Certification in Chennai
DevOPs Certification Training Institute in Chennai
Best AngularJS Training in Chennai
AngularJS Training in Chennai
You've made some good points there. I looked on the internet for more information about this
ReplyDeleteHadoop Training In Chennai | Sap MM Training In Chennai | ETL Testing Training In Chennai
I have read your blog its very attractive and impressive. I like your blog selenium Online Training
ReplyDelete