Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

QTP Descriptive programming Basics

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.

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 , .
  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.create
          we 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

We can use ochkbox.count to get objects matching the description


30 comments:

  1. It was very nice article and it is very useful to

    Testing tools learners.We also provide Testing tools online training

    ReplyDelete
  2. 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..

    Oracle Training in chennai

    ReplyDelete
  3. QTP Training in Chennai,

    Thank you for the informative post. It was thoroughly helpful to me. Keep posting more such articles and enlighten us..

    ReplyDelete
  4. hybernet is a framework Tool. If you are interested in hybernet training, our real time working.
    Hibernate Training in Chennai,hibernate training in Chennai

    ReplyDelete
  5. 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.

    ReplyDelete
  6. Perfect!!! What I can say in this article is very important to be written as it may help everybody to get awareness. Good job done.
    SOFTWARE TESTING Training in noida

    ReplyDelete
  7. 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.
    Selenium Training | Python Training | Pentaho Training | LoadRunner Training | WebSphere Training | Node.js Training

    ReplyDelete

  8. great 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

    ReplyDelete
  9. reat article!!!!!This is very importent information for us.I like all content and information.
    oracle training in chennai

    ReplyDelete
  10. • such a good website and given to more information thanks! and more visit..
    android training in chennai

    ReplyDelete
  11. Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
    oracle training in chennai

    ReplyDelete
  12. microstrategy training in chennai
    Thanks for sharing this informative blog. Keep update your blog.

    ReplyDelete
  13. You have explained Well about descriptive programming. Great effort. Keep updating.
    Oracle dba course | Oracle dba training

    ReplyDelete
  14. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.


    Best AngularJS Training in Chennai

    Hadoop Training in Chennai
    Big Data Training in Chennai

    ReplyDelete
  15. 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.
    AngularJS 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

    ReplyDelete
  16. 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.
    AngularJS 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

    ReplyDelete
  17. You've made some good points there. I looked on the internet for more information about this


    Hadoop Training In Chennai | Sap MM Training In Chennai | ETL Testing Training In Chennai

    ReplyDelete
  18. I have read your blog its very attractive and impressive. I like your blog selenium Online Training

    ReplyDelete