Pages

Custom Search

HP QTP Question Database: Q. 51 to 60

HP QTP Question Database: Q. 51 to 60

Q. 51: What is the use of Mapping Repository Parameter Values in QTP?

We can map repository parameters that are used in shared object repositories that are associated with our action. Mapping a repository parameter to a value or parameter specifies the property values used to

identify the test object during a run session. We 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.

We can map each repository parameter as required in each test that has an associated object repository containing repository parameters.

If we 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 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 our 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 types of Ordinal Identifiers used by QTP to identify an object?

1) Index Property: It indicates the order in which the object appears in the application code relative to other objects with an otherwise identical description.

2) Location Property:It 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: It is applicable for Browser Object only. It 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 we use Index:=3 to describe a WebEdit test object, QTP searches for the fourth WebEdit object in the page. However, if we 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 we 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, QTP 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 we record a test on three otherwise identical browsers that are opened at 9:01 pm, 9:03 pm, and 9:05 pm, QTP 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 we run our 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 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 sufficient to identify the object, then QTP stops the run session and displays a Run 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 us 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 we 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?

We can search for a specific test object in our object repository in many ways.

We can search for a test object according to its type. For example, we can search for a specific edit box, or we can point to an object in our application to automatically highlight that same object in our repository.

We can replace specific property values with other property values. For example, we can replace a property value userName with the value user name.

We can also select an object in our object repository and highlight it in our application to check which object it is.

After making sure that we shared object repository is the active window, we locate an object in a shared object repository in the same way as we locate it in a local object repository. If we want to replace property values, we must also make sure that the object repository is editable.

1 comment:

BigClasses said...

Thanks for providing the information on  Business Objects Online training. Online training have the benefits of being convenient, flexible and on your own time.