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:
- First need to understand the meaning of an objects name of QTP to understand the concept the descriptive programming.
- The use of an object name is to map an object in created script with its full description in object repository.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Since in this case you had deleted this description of object for all together there fore script fails.
- 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”.
- Descriptive programming can be used by the two ways: i. Static ii. Dynamic
- 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.
- Yes Multiple descriptions use can be possible by the specify those using the commas for your object.
- Therefore in this case the Agent Name description becomes “natiivclass:=Edit”, “attached text:=Agent Name:”.
- 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.
- Now we will use second method Dynamic Descriptive programming for same action.
- 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.
- So here you can use the description class given by the QTP.
- Syntax of Description Class will be Set MyDescript = Description.Create();
- MyDescript(“property”).value=”Property-value”;
- 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