Automation Testing, Manual Testing, QTP/UFT 11 , QC/ALM 11 ,SAP TAO, Unix, Selenium, Oracle SQL, Shell Scripting and For Online Trinings to contact me : Cell:+91-8897972059 , Email Id : quicktestprotech@gmail.com

Thursday, November 4, 2010

Difference between Index and Location

Difference between Index and Location


The Definitions by QTP
Index :- Indicates the order in which the object appears in the application code relative to other objects with an otherwise identical description.
Index property values are object-specific. Therefore, if you use Index:=3 to describe a WebEdit test object, QuickTest searches for the fourth WebEdit object in the page. However, if you use Index:=3 to describe a WebElement object, QuickTest searches for the fourth Web object on the page—regardless of the type—because the WebElement object applies to all Web objects.
Location :- 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.
Location property values are object-specific. Therefore, if you use Location:=3 to describe a WinButton test object, QuickTest 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.
These are confusing statements. Let me give a stand on  this.
Here is an example.
Index
In the below page image the first link which is appeared is “Web”. The index for this link will be “0” because it is the first link in the page. Like the way Images, News, and Maps will have the index 1,2 and 3.
Location
Location is the position of the object from left to right and top to bottom of the page. This means that when you add an object QTP assigns the location id based on the object position from left to right side and top to bottom.
In the below page the 0th location link is Alerts. Because in the page from left to right QTP will identify a series of links in the same column. Those are Alerts, Blog Search, …..etc. Now QTP assigns location from top to bottom like Alerts –0, Blog Search –1, Books-2…etc.
The link “web” will have the location id “13” but the index is “0”.
The definition by QTP for location says “QuickTest searches from top to bottom, and left to right “. But the actual is “from left to right and top to bottom of the page”.
I am in process of getting clarification from HP on this.
You can get the below page from this URL http://www.google.co.in/intl/en/options/
image
___________________________________________________
Please send your Suggestions  http:\\qtpthirupathi.blogspot.com\

0 comments:

Post a Comment

Loading...