Q. 51: What is the use of mapping Repository Parameter Values in QTP
You can map repository parameters that are used in shared object repositories that are associated with your action. Mapping a repository parameter to a value or parameter specifies the property values used toidentify the test object during a run session. You can specify that the property value is taken from a constant value, or parameterize it using a Data Table, random number, environment, or test parameter.
You can map each repository parameter as required in each test that has an associated object repository containing repository parameters.
If you do not map a repository parameter, the default value that was defined with the parameter, if any, is used during the action run. If the parameter is unmapped, meaning no default value was specified for it, the test run may fail if a test object cannot be identified because it has an unmapped parameter value.
Q. 52: What are the various Object Properties in QTP?===========================================
QTP has a predefined set of properties that it learns for each test object. If these mandatory property values are not sufficient to uniquely identify a learned object, QTP can add some assistive properties and/or an ordinal identifier to create a unique description.
Mandatory properties are properties that QTP always learns for a particular test object class.
Assistive properties are properties that QTP learns only if the mandatory properties that QTP learns for a particular object in your application are not sufficient to create a unique description. If several assistive properties are defined for an object class, then QTP learns one assistive property at a time, and stops as soon as it creates a unique description for the object. If QTP does learn assistive properties, those properties are added to the test object description.
Q. 53: What are the various types of ordinal identifiers used by QTP to identify an object?
1) Index Property: Indicates the order in which the object appears in the application code relative to other objects with an otherwise identical description.
2) Location Property: Indicates the order in which the object appears within the parent window, frame, or dialog box relative to other objects with an otherwise identical description.
3) CreationTime Property: (For Browser object only.) Indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description.
Q. 54: What is Index Property for identifying the objects in QTP?===================================================
While learning an object, QTP can assign a value to the test object’s Index property to uniquely identify the object. The value is based on the order in which the object appears within the source code. The first occurrence is 0.
Index property values are object-specific. Therefore, if you use Index:=3 to describe a WebEdit test object, QTP searches for the fourth WebEdit object in the page.
However, if you use Index:=3 to describe a WebElement object, QTPt searches for the fourth Web object on the page—regardless of the type—because the WebElement object applies to all Web objects.
Q. 55: What is Location Property for identifying the objects in QTP?=====================================================
While learning an object, QTP can assign a value to the test object’s Location property to uniquely identify the object. The value is based on the order in which the object appears within the window, frame, or dialog box, in relation to other objects with identical properties. The first occurrence of the object is 0. Values are assigned in columns from top to bottom, and left to right.
Location property values are object-specific. Therefore, if you use Location:=3 to describe a WinButton test object, QTP searches from top to bottom, and left to right for the fourth WinButton object in the page. However, if you use Location:=3 to describe a WinObject object, QuickTest searches from top to bottom, and left to right for the fourth standard object on the page— regardless of the type—because the WinObject object applies to all standard objects.
Q. 56: What is Creation Time Property for identifying the objects in QTP?
While learning a browser object, if QTP is unable to uniquely identify the object according to its test object description, it assigns a value to the CreationTime test object property. This value indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description. The first browser that opens receives the value CreationTime = 0.
During the run session, if QTP is unable to identify a browser object based solely on its test object description, it examines the order in which the browsers were opened, and then uses the CreationTime property to identify the correct one.
For example, if you record a test on three otherwise identical browsers that are opened at 9:01 pm, 9:03 pm, and 9:05 pm, QuickTest assigns the CreationTime values, as follows: CreationTime = 0 to the 9:01 am browser, CreationTime = 1 to the 9:03 am browser, and CreationTime = 2 to the 9:06 am browser.
At 10:30 pm, when you run your test, suppose the browsers are opened at 10:31 pm, 10:33 pm, and 10:34 pm. QTP identifies the browsers, as follows: the 10:31 pm browser is identified with the browser test object with CreationTime = 0, 10:33 pm browser is identified with the test object with CreationTime = 1, 10:34 pm browser is identified with the test object with CreationTime = 2.
Q. 57: What is the Smart Identification Process of QTP
If QTP activates the Smart Identification mechanism during a run session, it follows the following process to identify the object:
1) QTP “forgets” the learned test object description and creates a new object candidate list containing the objects (within the object’s parent object) that match all of the properties defined in the Base Filter Properties list.
2) QTP filters out any object in the object candidate list that does not match the first property listed in the Optional Filter Properties list. The remaining objects become the new object candidate list.
3) QTP evaluates the new object candidate list:
# If the new object candidate list still has more than one object, QTP uses the new (smaller) object candidate list to repeat step 2 for the next optional filter property in the list.
# If the new object candidate list is empty, QTP ignores this optional filter property, returns to the previous object candidate list, and repeats step 2 for the next optional filter property in the list.
# If the object candidate list contains exactly one object, then QTP concludes that it has identified the object and performs the statement containing the object.
4) QTP continues the process described in steps 2 and 3 until it either identifies one object, or runs out of optional filter properties to use. If, after completing the Smart Identification elimination process, QTP still cannot identify the object, then QTP uses the learned description plus the ordinal identifier to identify the object. If the combined learned description and ordinal identifier are not sufficientto identify the object, then QuickTest stops the run session and displays aRun Error message.
Q. 58: What happens in case Smart Identification fails to identify the object in QTP?
If the Smart Identification mechanism cannot successfully identify the object, QTP uses the learned description plus the ordinal identifier to identify the object.
If the object is still not identified, the test fails and a normal failed step is displayed in the results.
Q. 59: What is the use of Repository Parameters in QTP?=============================================
Repository parameters enable you to specify that certain property values should be parameterized, but leave the actual parameterization to be defined in each test that is associated with the object repository that contains the parameterized test object property values.
Repository parameters are useful when you want to create and run tests on an object that changes dynamically. An object may change dynamically if it is frequently updated in the application, or if its property values are set using dynamic content, for example, from a database.
Q. 60: How can we locate test objects in an object repository?=================================================
You can search for a specific test object in your object repository in many ways.
You can search for a test object according to its type. For example, you can search for a specific edit box, or you can point to an object in your application to automatically highlight that same object in your repository.
You can replace specific property values with other property values. For example, you can replace a property value userName with the value user name.
You can also select an object in your object repository and highlight it in your application to check which object it is.
After making sure that your shared object repository is the active window, you locate an object in a shared object repository in the same way as you locate it in a local object repository. If you want to replace property values, you must also make sure that the object repository is editable.
Keyword: QTP Interview Questions, FAQ QTP
QTP VBScript new series + Interview Question Bank on QTP for enrichment of Knowledge in QTP
This Site has been brought to you by HP Certified Expert of QTP.
Exciting new articles for October:
1) QTP Tip:Deselect all Radio Buttons
2) HP QTP Crypt Object
3)Adding Hyperlinks in Excel Spreadsheet
Best of Luck Friends ! ! !
All Articles are Copyright Protected. These are Free for Reading & Personal Use. Reproduction in Any Form without the Permission is Illegal & Strictly Prohibited.
Copyright © 2009 ExpertQTP
Tuesday, September 30, 2008
Q. 51: What is the use of mapping Repository Parameter Values in QTP