Hierarchy specifiers Sibling specifiers Type (Construct type) Basic attributes (Level 1) Attributes (Level 2) Application (Site signature) Web page (web) Window and controls inside a window Elements inside a web page or HTML document only Any HTML element (html) HTML image (img) HTML input (input) HTML form (form) form_name [string] HTML frame (frame) HTML document (document) HTML anchor (anchor) child parent descendent ancestor top btm lhs rhs Executable (exe) {for any executable .exe or binary .bin extension} exe_name [string] file_version [string] product_name [string] product_version [string] original_file_name [string] internal_name [string] language [string] 16 bit application/hosted application (task) {always listed under ntvdm.exe or wowexec.exe in Task Manager} exe_name [string] task_name [string] wnd_title [string] class_name [string] domain [string] protocol [string] url [string] path [string] {used a lot with web applications hosted on a portal} port [numeric] query_string [string] Window (wnd) {any control inside a window including the window itself} Window title [string] class_name [string] Child control {control inside a window} ctrl_id [numeric] class_name [string] .Net application child control control_name [string] rel_ypos [numeric] rel_xpos [numeric] size [numeric] is_visible [numeric] window_style [numeric] window_ex_style [numeric] class_style [numeric] ypos [numeric] xpos [numeric] is_foreground [numeric] - check if the window is the foreground Java window (jwnd) {Window/control belonging to a Java application/applet). Applets inside a webpage also fall under this category. Window title [string] class_name [string] Child control class_name [string] rel_ypos [numeric] rel_xpos [numeric] is_visible [numeric] class_style [numeric] ypos [numeric] xpos [numeric] size [numeric] is_foreground [numeric] value [string] After using above tag_name you should look at the HTML element and then you can use the other attributes "as is" in the signature. Common HTML attributes are type inner_text [string] inner_html [string] element like "Any HTML element in Row 15 tag_name [string] src [string] input_name [string] input_type [string] className [string] OR If ::html is used to treat input element like "Any HTML element in Row 15 tag_name [string] type [string] If ::input is used: input_index [numeric]
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Hierarchy specifiers Sibling specifiers
Type (Construct type) Basic attributes (Level 1) Attributes (Level 2)
Application (Site signature)
Web page (web)
Window and controls inside a window
Elements inside a web page or HTML document only
Any HTML element (html)
HTML image (img)
HTML input (input)HTML form (form) form_name [string]HTML frame (frame)HTML document (document)HTML anchor (anchor)
child parent
descendent ancestor
top btm
lhs rhs
Executable (exe) {for any executable .exe or binary.bin extension}
tag_name [string]value [string]After using above tag_name you should look at the HTML element and then you can use the other attributes "as is" in the signature. Common HTML attributes are type
inner_text [string]inner_html [string]
If ::html is used to treat input element like "Any HTML element in Row 15
If ::html is used to treat input element like "Any HTML element in Row 15
tag_name [string]type [string]
If ::input is used:input_index [numeric]
A1
sganesh: The basic hierarchy specifiers that can be used for unique identification.
B1
sganesh: These hierarchy specifiers can be used when the Level 1 specifiers are not sufficient for unique identification.
A2
sganesh: child - immediate child descendent or descendant - can be an immediate child or a descendent in the subtree parent - immediate parent ancestor - includes immediate parent or ancestor.
B2
sganesh: These are sibling specifiers. They can be used to identify controls/constructs that have the same parent. top = control/construct that is immediately above btm = control/cinstruct that is immediately below lhs = control/construct that is to the left rhs = control/construct that is to the right NOTE: top, btm, lhs and rhs are used to identify siblings
B3
sganesh: The basic attributes that can be used for unique identification
C3
sganesh: These attributes can be used when the Level 1 attributes are not sufficient for unique identification.
Basic operators for attributes
=#~
andor
Advanced operators for attributes!=!~!#&!&
Basic operators between 2 or more attributes
A2
sganesh: exact comparison. When used for a string, then the comparison is case-insensitive
A3
sganesh: this is the LIKE comparison operator; also known as regular expression comparison. Used when you want to match only a part or fragment of a string. When a part of a string to compare with changes, then this operator can be used. Comparison is case-insensitive
A4
sganesh: this is the LIKE comparison operator; also known as regular expression comparison. Used when you want to match only a part or fragment of a string. When a part of a string to compare with changes, then this operator can be used. Comparison is case-sensitive
A8
sganesh: this is the Logical AND operator that is used when you want to combine the result of more than one attribute. When you want the result of all the attribute-value comparisons to be true, this operator should be used. Both the condition on the left of this operator and the condition specified to the right of this operator should be TRUE. Example: @title="abc" and @class_name="Edit" In the above example, it is used to indicate that the statement is TRUE only when @title="abc" is TRUE and @class_name="Edit" is TRUE. NOTE: TYPICALLY DIFFERENT ATTRIBUTES ARE USED ON THE LEFT AND RIGHT OF THIS OPERATOR.
A9
sganesh: this is the Logical OR operator that is used when you want to combine the result of more than one attribute. When you want the result of any one attribute-value comparison to be true, this operator should be used. Either the condition on the left of this operator or the condition specified to the right of this operator should be TRUE. Example: @title="abc" or @title="xyz" In the above example, it is used to indicate that the statement is TRUE when weither @title="abc" is TRUE or @title="xyz" is TRUE. NOTE: TYPICALLY WHEN THIS ATTRIBUTE IS USED YOU WILL HAVE THE SAME ATTRIBUTE ON THE LEFT AND TO THE RIGHT OF THIS OPERATOR.
A13
sganesh: not equals
A14
sganesh: not like comparison. Regular expression comparison for not like. It is case-sensitive
A15
sganesh: not like comparison. Regular expression comparison for not like. It is case-insensitive
A16
sganesh: Binary AND
A17
sganesh: Not equal to a binary AND
string, numericstringstring
Grouping of and/or operator
numericstringstringnumericnumeric
Type of value on the RHS,where LHS is the attribute
When you want to group more than 2 conditions to check for "either or" OR "and", then you will need to use a parenthesis around each group.
Type of comparison
Case insensitive for stringCase insensitiveCase sensitive
Example
N/ACase sensitiveCase insensitive
Example #1:/child::wnd[(@title="x" or @title="y") and (@class_name="z")]
Note: the parenthesis are a MUST around each evaluating expression
Attribute name How do I get this value?exe_name [string]
Method #1:1. Open Windows Task Manager2. From the Applications Tab right click on the applicationfor which you want to verify the process name.3. On the right click menu - Click on Go to Processto view the process name (exe name)
Method #2:1. Process Explorer
Method #3:1. For the main logon window, look at the attributeOwnerEXE in Winspector
1. Locate the actual executable (not the shortcut) on the disk2. Right click on the EXE and select Properties.3. On the Properties window, click on the Versiontab. File Version: is the value of this attribute
1. Locate the actual executable (not the shortcut) on the disk2. Right click on the EXE and select Properties.3. On the Properties window, you will see the Other Version Information section.
Product Name = product_nameProduct Version = product_versionOriginal File name = original_file_nameInternal name = internal_nameLanguage = language
domain [string]
protocol [string] Protocol used in the URL
url [string] The entire URL of a webpage.
path [string]
port [numeric]
query_string [string]
Part of the URL between the protocol indicator (http:// or https:// or ftp:// etc.) and the first forward slash
Part of the URL after the domain before the ? (? isthe beginning of the query string in a URL)
Port number used in the URL
This attribute is always used with the @domain attribute.
Part of the URL from the ? after the domain until the end (? is included)
title [string]
class_name [string]
Window/control title. The text that is shown on awindow/construct.
This attribute is mostly applicabe to windows thathave a title bar with a title text or to static controls that contain text.
Typically all windows/controls have a class name.The class name is the indicator of the typeof window or control.
NOTE: The class name attribute for Java applications cannot be seen/retrieved using Winspector
ctrl_id [numeric]
control_name [numeric]
rel_ypos [numeric]
Control ID is a numeric identifier for child windows.
The control id atribute should be used only foridentifying child windows/controls.
Two things to note before using this as an attribute:
1. The control id value should not be = 02. The value of the control id should be constant. This is mostly the case, but in some applications, the control id can be a long random number that is subject to change or 0. Typical indicator of changing control ids = controls with long numbers as the control id or if it is zero.
Note: If Control ID = 0, this attribute should not beused.
Control name of the window control in the .NET application
Note: Only applicable to .Net applications
The relative position of a child control as you move from top-bottom.
For all the controls in the same hierarchy (sibling controls), start from the topmost point; count up and mark the controls based on their topmost position. The count starts from 1.
This attribute is typically used when two sibling controls have the same control id. The relative positioning can be used as a distinguishing attribute.
The relative position of a child control as you move from left-right.
For all the controls in the same hierarchy (sibling controls), start from the leftmost point; count up and mark the controls based on their leftmost position. The count starts from 1.
This attribute is typically used when two sibling controls have the same control id. The relative positioning can be used as a distinguishing attribute.
The client X position of a control with respect tothe parent window
(client co-ordinates with respect to the parent window)
The client Y position of a control with respect to the parent window.
(client co-ordinates with respect to the parent window)
Size of a control or window (width * height). This attribute should only be used for non-resizable controls.
Visibilty of a control/window
Note: Some windows which are visible to you might not succeed the @is_visible=1 check.
Java applets and Java applications
There is no tool available to get attribute values forjava applets. Use what the AccessStudio finder generates alongwith the Level 2 attributes that arecommon to window based applications
tag_name This is the name of the tag
inner_text This is the value of any HTML tag element.
inner_html
/@inner_text
/child::html
/descendent::form
The entire inner HTML fragment for any HTML element
This can be used to get the inner text of any HTMLelement.
NOTE: This is not an attribute but is used to getthe value of a tag or HTML element
This refers to the head or the body of a HTML document.
Example #1: URL = https://www.google.com/accounts/ServiceLogin?service=mail@domain="www.google.com" {after the https:// which is the protocolindicator and before the first forward slash after that}
Example #2: URL = www.ibm.com/travel?type=domestic@domain="www.ibm.com" {after the protocol which in this case is http:// by default since it is not specified and before the first forward slash before the word "travel".
Example: http OR https
Example #1: URL = http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1100@url = "http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1100"
Example #2: URL = http://en.wikipedia.org/wiki/IBM@url = "http://en.wikipedia.org/wiki/IBM"
Example #1: URL = http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1100@path = "/developerworks/forums/forum.jspa"
Example #2: URL = http://en.wikipedia.org/wiki/Armonk,_New_York@path = "/wiki/Armonk,_New_York"
Example #1: http://ims.encentuate.com:88/services@port=88
Example #2: https://localhost:8080/login.aspx@port = 8080
Example #1: URL=http://www.ibm.com/ibm/ideasfromibm/us/corporateservice/20081112/index.shtml?sa_campaign=message/ideas/leadspace/all/servicecorpsflash
Use Winspector to drag and drop the crosshair to the window/control.Steps: 1. Open Winspector2. From the View menu click on Window list.3. Now from the Window list pane, click and drag the red circle to the window/control of interest4. Once you highlight the window/control of interest, on the window list pane (left pane), you will see the window/control highlighted in gray.5. Right click on the window/control in the window list pane and click on Properties in the popup menu.6. You will be able to see the Window Properties (Properties for the window) in the right pane.7. In the Properties view, under the Item column, Text is the title of the window/control.
In the screenshot on cell D12 - @title="Reset Password"
Use Winspector to drag and drop the crosshair to the window/control.Steps: 1. Open Winspector2. From the View menu click on Window list.3. Now from the Window list pane, click and drag the red circle to the window/control of interest4. Once you highlight the window/control of interest, on the window list pane (left pane), you will see the window/control highlighted in gray.5. Right click on the window/control in the window list pane and click on Properties in the popup menu.6. You will be able to see the Window Properties (Properties for the window) in the right pane.7. In the Properties view, under the Item column, Class Name is the title of the window/control.
REFER TO THE PICTURE FROM WINSPECTOR IN CELL D12.
Class Name in the Item column = class_name attribute. Value = attribute value.
In the screenshot on cell D12, @class_name = "#32770"
Use Winspector to drag and drop the crosshair to the window/control.Steps: 1. Open Winspector2. From the View menu click on Window list.3. Now from the Window list pane, click and drag the red circle to the window/control of interest4. Once you highlight the window/control of interest, on the window list pane (left pane), you will see the window/control highlighted in gray.5. Right click on the window/control in the window list pane and click on Properties in the popup menu.6. You will be able to see the Window Properties (Properties for the window) in the right pane.7. In the Properties view, under the Item column, ID is the title of the window/control.
REFER TO THE PICTURE FROM WINSPECTOR IN CELL D12.
ID in the Item column = class_name attribute. Value = attribute value.
In the screenshot on cell D14, @ctrl_id = 222
AccessStudio generates the correct control name if the application is a .Net application. Controlname cannot be retrieved using Winspector. The AccessStudio finder will generate the controlname for a .Net control.
In the example on Cell D25, start moving down from the topmost point on the "Reset Password"window.
Y increases as we move from top - bottom with the initial value of Y = 1 for the first control.
This can be visualized in terms of moving a bar from top to bottom and based on the topmost Y positions of each control, we increment the relative Y position counter.
Note that the OK and Cancel button below have the same topmost Y position, and hence have the same rel_ypos = 7
In the example on cell D25:/child::wnd[@title="Reset Password"]/child::wnd[@rel_ypos = 1] identifies the edit control for the New Password input.
In the example on Cell D26, start moving down from the topmost point on the "Reset Password"window.
X increases as we move from left - right with the initial value of X = 1 for the first control on the left.
This can be visualized in terms of moving a bar from left to right and based on the leftmost X position of each control, we increment the relative X position counter.
Note that the 4 controls marked as 1, have the same leftmost X position and hence all of them have the same rel_xpos = 1
In the example on cell D26:/child::wnd[@title="Reset Password"]/child::wnd[@rel_xpos = 2 and @rel_ypos=1] identifies the edit control for the New Password input.
Typical use: When one control differs from another by only the style/child::wnd[@title="Open" and @class_name="#32770"]/child::wnd[@class_name="Button" and @ctrl_id=1 and @window_style !& 134217728]
This is the decimal value of the window extended style attribute of a window. Winspector does not give this value. You can only retrieve this value from Spy++. Spy++ will give you the hexadecimal value, which needs to be converted to decimal using a calculator (Windows scientific calculator)
You need to convert the hex # 500100A0 to decimal. Its eqvt decimal value will be 1342242976.
Use Winspector to drag and drop the crosshair to the window/control.Steps: 1. Open Winspector2. From the View menu click on Window list.3. Now from the Window list pane, click and drag the red circle to the window/control of interest4. Once you highlight the window/control of interest, on the window list pane (left pane), you will see the window/control highlighted in gray.5. Right click on the window/control in the window list pane and click on Properties in the popup menu.6. You will be able to see the Window Properties (Properties for the window) in the right pane.7. In the Properties view, under the Item column, Client size contains the width and height of a control. Multiply the values to obtain the size of the control.
Typically used to identify a window that is visible versus a hidden window that might have the same attributes.
Attributes recap you can use for Java controls:titleclass_namerel_yposrel_xpossizeis_visible
Example #1: <link href="theme/main.css" type="text/css" rel="stylesheet" />@tag_name="link"Example #2:<input type="text" name="Email" id="Email" size="18" value="" class='gaia le val'/>@tag_name="input"Example #3:<a href="http://www.ibm.com/support">Help</a>@tag_name="a"
Example #1:<a href="http://www.ibm.com/support">Help</a>@inner_text="Help"Example #2:<a href="http://www.ibm.com/support"><b>Help</b></a>In this example, the @inner_text of tag b is "Help"@inner_text="Help"
Example #1:<a href="http://www.ibm.com/support"><b>Help</b></a>@inner_html="<b>Help</b>"
Example #1:/child::html/descendent::form/child::html[@tag_name="table"]/descendent::html[@tag_name="b"] /@inner_text- Gets the inner text of a bold element that is inside a table that is inside a form
Caveats:/child::html[@tag_name="body"] will not work. This is a known issue. But when you write /child::html it implies both the HTML and the HEAD tag element nodes of the current HTML document.
Caveats:Ignores the hierarchy before it. It gives all the formsin the HTML. This is an anomaly and a known issue. It does not respect the hierarchy.