Saturday, September 27, 2008

Some improvement for QTP in my project

I'm sorry, this is my brainstorming, not for publishing purpose

The most important idea: (as my experience in developing web crawler, apply artificial interllienge)

-If we use too much properties to identify an object, obviously, we assume that object identify will more accurately. But in some case, if the object in real life, sometime, miss some properties, our application cannot recognize the object (html object is rarely the same all the time). And this process is a result of training object identifier in a 'too large environment' where we have many object, and the application always try the best to unique the object (in test automation is a large set of test case that use the same object repository, and object in repository absolutely has many properties, and cause sometime it cannot recognize the object)
=> increase of number properties to identify object

Another case, if there are too much object has the same properties so to unique the object QTP will reject any duplicated properties, lead to
=> reduce number of properties to identify object. So QTP cannot identify any object (even in small environment)

==>This all is a result of training QTP in a large environment
-1/ too many object, window on the desktop at the time of training
-2/ you train QTP to recognize objects (then store in the same OBJECT REPOSITORY) but you train it many times, each time is of another Application (another test case)


-But, what if we use less properties to identify the object? In the small environment where there are several objects only, it is very easy to unique an object. But when we put the test in to large environment (where there are many test case that open many windows/object) the it will be very hard to unique an object

=> So, we are tester, developer, we understand much, which case will use which type of object. We can leverage dynamic object repository load functionality of QTP to:
1/ For each test case, we know exactly which object we would like to interact, so we can load exactly OR file of that object only. So if we have 2 more objects that similiar in different test cases, but we are testing 1 test case only, we can elimiate 1 remain test case,

2/ For each OR file, we will try to get as much unique properties as possible

Compose two above, we will have a good solution to avoid any duplicated object on the system by elimiate each OR / test case, interact objects/windows in sequence

3/ We need to get investigation, graph to balance, how many properties is good enough for our application to identify? for each test case if possible

1/ Separate our test case into small piece, to limit, and increase object identify performance, increase accurate
2/ Dynamic load object repository for each set of test case


- One more thing, there are some guys around the world, they use programatic to identify object, not relay on Object Repository anymore. That is perfect, so they how to identify their object clearly and to avoid any impact from the change of interface GUI , coding, what if developer, and sudently add some very funny properties into you object?
Ref: http://www.softwareinquisition.com/2006/04/new-object-repository-interface-in-quicktest-pro-9#comment-21844








Below is the detail:


-Dynamic load Object Repository, separate object repository by screen, test case, to increase performace, accurately identify

-In some case, update the object property in object repository to reflect the actually object that known by tester

-Try to understand and have good use of QTP Object properties
Objects Properties:

-Try to understand and have good use of QTP checkpoint functionalities

"
Mandatory Properties: Predefined sets of properties QuickTest learns for each test object.
Assistive Properties: Assistive properties are properties that QuickTest learns only if the mandatory properties are NOT sufficient to create a unique description.
Ordinal Identifier: The Ordinal Identifier assigns the object a numerical value that indicates its order relative to other objects for those have same values for all properties specified in the mandatory and Assistive property lists. This ordered value enables QuickTest to create a unique description when the mandatory and Assistive properties are not sufficient to do so.
SmartTesting @ January 28, 2008
"




"
ISSUE: How to set a property value of an object in the Object Repository during runtime?
Issues, Quick Test Pro, Test Automation

Solution: We can modify the properties of the temporary version of the object during the run session without affecting the permanent values in the object repository by adding a SetTOProperty method. The SetTOProperty method can be inserted from the Keyword view using step generator or inserted to the expert view.

How?

The regular expression checkbox needs to be selected for the specified object .

Either through the Object Repository or through the Object Properties window, the regular expression checkbox needs to be selected before running the test.

To go through the Object Repository:
1. Select Resources -> Object Repository.
2. Select the object that will be used with the SetTOProperty method.
3. Select the property that will be used with the SetTOProperty method.
4. Select the “Edit Constant Value Options” button, which is to the right of the Constant field.
5. Select the “Regular expression” checkbox.
6. Click .
7. Click .

After modifying the setting, you can specify the regular expression using the SetTOProperty method.

Example:
Window(”Notepad”).WinEditor(”Edit”).SetTOProperty “text”, “test.*”
"

No comments:

Digital Inspiration Technology Guide

Change the world with your passion