All about Descriptive Programming in QTP with Example, Types of Descriptive Programming in QTP



All about Descriptive Programming in QTP with Example, Types of Descriptive Programming in QTP

Let’s familiar with Descriptive programming and its two parts static and dynamic:

  1. First need to understand the meaning of an objects name of QTP to understand the concept the descriptive programming.
  2. The use of an object name is to map an object in created script with its full description in object repository.
  3. Significance if I change the object name here to CDE and correspondingly change the name of object in script with CDE then script will work fine.
  4. Take this statement; here it sets the Agent name equal to MyTest. We will do an experiment here. First we will delete the description of object of Agent Name Win Edit Box from Object Repository.
  5. It will fail again if I run test again since it can not identify the instance. Let us check the reason why the script getting fail again and again.
  6. With the time of Run Time, QTP will identify the operations or process that is processed on WinEdit box and the description of object in object repository is saved as the Name of Agent.
  7. The use of this name is to track the object in the object repository. As a parent one can not have the two objects as child with the similar name. Therefore QTP is able to maps the object in the repository uniquely.
  8. Then it use the saved description in the object repository and description will be replaced with the name. Then it use same declaration to recognize the object available in application which is under test.
  9. Since in this case you had deleted this description of object for all together there fore script fails.
  10. But in this case what for QTP when it will change or replace the description of object, then you as a tester directly declare the description of object in your generated script – This is called “Descriptive Programming”.
  11. Descriptive programming can be used by the two ways: i. Static ii. Dynamic
  12. Static Programming -> Following format will be used for Object identification – property:=values, here you will mention the property of objects and its corresponding value will be separated by the colons and will be equal to sign. Format used by this way is called the property value par and will be enclosed in the inverted commas.
  13. Yes Multiple descriptions use can be possible by the specify those using the commas for your object.
  14. Therefore in this case the Agent Name description becomes “natiivclass:=Edit”, “attached text:=Agent Name:”.
  15. Next step will the Object Name need to replace with the above description. So in QTP, we need to make replacement and execute the test again. Definitely it will run fine now. In the result of test the Name of Agent object is enclosed in braces indicating the Descriptive Programming is used it this identification. This will call the static function or method.
  16. Now we will use second method Dynamic Descriptive programming for same action.
  17. If this script object uses the object candidate multiple times for descriptive programming then it will be very irritating to declare all the property values pairs for each and every time while adding or updating.
  18. So here you can use the description class given by the QTP.
  19. Syntax of Description Class will be Set MyDescript = Description.Create();
  20. MyDescript(“property”).value=”Property-value”;
  21. This will called Dynamic Method of Descriptive Programming.



















Android Install Apps to SD Card Default
Developer vs Tester a fake competition


QTP TESTING STEPS How to Record a QTP Script






No comments:

Post a Comment

Popular Posts