Sunteți pe pagina 1din 54

Hierarchy specifiers

Sibling specifiers

child descendent Type (Construct type)

parent ancestor

top

btm

lhs rhs Basic attributes (Level 1)

Attributes (Level 2)

Application (Site signature) exe_name [string] file_version [string] product_name [string] product_version [string] original_file_name [string] internal_name [string] language [string]

Executable (exe) {for any executable .exe or binary .bin extension} 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]

Web page (web) Window and controls inside a window

domain [string] protocol [string] url [string]

path [string] {used a lot with web applications hosted on a portal} port [numeric] query_string [string] rel_ypos [numeric] rel_xpos [numeric] size [numeric]

Window title [string] class_name [string] Child control {control inside a window} ctrl_id [numeric] class_name [string] Window (wnd) {any control inside a window including the window itself} .Net application child control control_name [string]

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 window. rel_ypos [numeric] rel_xpos [numeric] is_visible [numeric] class_style [numeric] ypos [numeric] xpos [numeric] size [numeric] is_foreground [numeric]

Window title [string] class_name [string] Java window (jwnd) {Window/control belonging to a Java application/applet). Applets inside a webpage also fall under this category. Child control class_name [string]

Elements inside a web page or HTML document only 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 If ::html is used to treat input element like "Any HTML element in Row 15 tag_name [string] src [string] If ::input is used: 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] HTML input (input) HTML form (form) HTML frame (frame) HTML document (document) HTML anchor (anchor) form_name [string] inner_text [string] inner_html [string]

Any HTML element (html)

HTML image (img)

If ::input is used: input_index [numeric]

Basic operators for attributes = # ~

Basic operators between 2 or more attributes

and or

Advanced operators for attributes != !~ !# & !&

Type of value on the RHS, where LHS is the attribute string, numeric string string

Grouping of and/or operator 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.

numeric string string numeric numeric

Type of comparison Case insensitive for string Case insensitive Case sensitive

Example Example #1: /child::wnd[(@title="x" or @title="y") and (@class_name="z")] Note: the parenthesis are a MUST around each evaluating expression

N/A Case sensitive Case insensitive

{hierarchy specifier}{construct type}[@attrib name1{op}value1 {logical operator} attrib name2{op}value2 {logical operator Attribute name How do I get this value? exe_name [string] Method #1: 1. Open Windows Task Manager 2. From the Applications Tab right click on the application for which you want to verify the process name. 3. On the right click menu - Click on Go to Process to view the process name (exe name) Method #2: 1. Process Explorer Method #3: 1. For the main logon window, look at the attribute OwnerEXE in Winspector

file_version [string]

1. Locate the actual executable (not the shortcut) on the disk 2. Right click on the EXE and select Properties. 3. On the Properties window, click on the Version tab. File Version: is the value of this attribute

product_name [string] product_version [string] original_file_name [string] internal_name [string] language [string]

1. Locate the actual executable (not the shortcut) on the disk 2. Right click on the EXE and select Properties. 3. On the Properties window, you will see the Other Version Information section. Product Name = product_name Product Version = product_version Original File name = original_file_name Internal name = internal_name Language = language

domain [string]

Part of the URL between the protocol indicator (http:// or https:// or ftp:// etc.) and the first forward slash

protocol [string]

Protocol used in the URL

url [string]

The entire URL of a webpage.

path [string]

Part of the URL after the domain before the ? (? is the beginning of the query string in a URL)

port [numeric]

Port number used in the URL This attribute is always used with the @domain attribute.

query_string [string]

Part of the URL from the ? after the domain until the end (? is included)

title [string]

Window/control title. The text that is shown on a window/construct. This attribute is mostly applicabe to windows that have a title bar with a title text or to static controls that contain text.

class_name [string]

Typically all windows/controls have a class name. The class name is the indicator of the type of window or control.

NOTE: The class name attribute for Java applications cannot be seen/retrieved using Winspector

ctrl_id [numeric]

Control ID is a numeric identifier for child windows. The control id atribute should be used only for identifying child windows/controls. Two things to note before using this as an attribute: 1. The control id value should not be = 0 2. 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 be used.

Control name of the window control in the .NET application control_name [numeric] rel_ypos [numeric] 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.

rel_xpos [numeric]

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.

xpos [numeric]

The client X position of a control with respect to the 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) Window (control) style attribute

ypos [numeric]

window_style [numeric]

window_ex_style [numeric]

Window (control) extended style attribute

class_style [numeric]

Class style for a control.

size [numeric]

Size of a control or window (width * height). This attribute should only be used for non-resizable controls.

is_visible [numeric] 0/1

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 for java applets. Use what the AccessStudio finder generates alongwith the Level 2 attributes that are common 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

The entire inner HTML fragment for any HTML element

/@inner_text

This can be used to get the inner text of any HTML element. NOTE: This is not an attribute but is used to get the value of a tag or HTML element

/child::html

This refers to the head or the body of a HTML document.

/descendent::form

1 {logical operator} attrib name2{op}value2 {logical operator} attrib name3{op}value3] Tool name(s) 1. Process Explorer (http://download.sysinternals.com/Files/ProcessExplorer.zip) 2. Winspector (http://www.windows-spy.com/files/Winspector_setupU.exe)

Example #1: URL = https://www.google.com/accounts/ServiceLogin?service=mail @domain="www.google.com" {after the https:// which is the protocol indicator 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/ide as/leadspace/all/servicecorpsflash @query_string="?sa_campaign=message/ideas/leadspace/all/servicecorpsflash"

Use Winspector to drag and drop the crosshair to the window/control. Steps: 1. Open Winspector 2. 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 interest 4. 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 Winspector 2. 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 interest 4. 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 Winspector 2. 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 interest 4. 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. Control name cannot be retrieved using Winspector. The AccessStudio finder will generate the control name 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.

Window style attribute as seen from Spy++. #define WS_DISABLED 0x08000000L #define WS_OVERLAPPED 0x00000000L #define WS_POPUP 0x80000000L #define WS_CHILD 0x40000000L #define WS_MINIMIZE 0x20000000L #define WS_VISIBLE 0x10000000L #define WS_CLIPSIBLINGS 0x04000000L #define WS_CLIPCHILDREN 0x02000000L #define WS_MAXIMIZE 0x01000000L #define WS_CAPTION 0x00C00000L #define WS_BORDER 0x00800000L #define WS_DLGFRAME 0x00400000L #define WS_VSCROLL 0x00200000L #define WS_HSCROLL 0x00100000L #define WS_SYSMENU 0x00080000L #define WS_THICKFRAME 0x00040000L #define WS_GROUP 0x00020000L #define WS_TABSTOP 0x00010000L #define WS_MINIMIZEBOX 0x00020000L #define WS_MAXIMIZEBOX 0x00010000L #define WS_TILED WS_OVERLAPPED #define WS_ICONIC WS_MINIMIZE #define WS_SIZEBOX WS_THICKFRAME #define WS_POPUPWINDOW (WS_POPUP |\ WS_BORDER |\ WS_SYSMENU)

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. You can also use the attribute with &
WS_EX_DLGMODALFRAME 0x00000001L WS_EX_NOPARENTNOTIFY 0x00000004L WS_EX_TOPMOST 0x00000008L WS_EX_ACCEPTFILES 0x00000010L WS_EX_TRANSPARENT 0x00000020L WS_EX_MDICHILD 0x00000040L WS_EX_TOOLWINDOW 0x00000080L WS_EX_WINDOWEDGE 0x00000100L WS_EX_CLIENTEDGE 0x00000200L WS_EX_CLIENTEDGE) WS_EX_CONTEXTHELP 0x00000400L | WS_EX_TOPMOST) WS_EX_COMPOSITED 0x02000000L WS_EX_RIGHT 0x00001000L WS_EX_LEFT 0x00000000L WS_EX_RTLREADING 0x00002000L WS_EX_LTRREADING 0x00000000L WS_EX_LEFTSCROLLBAR 0x00004000L WS_EX_RIGHTSCROLLBAR 0x00000000L WS_EX_CONTROLPARENT 0x00010000L WS_EX_STATICEDGE 0x00020000L WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_PALETTEWINDOW WS_EX_NOACTIVATE (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW 0x08000000

Use Winspector to drag and drop the crosshair to the window/control. Steps: 1. Open Winspector 2. 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 interest 4. 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: title class_name rel_ypos rel_xpos size is_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 forms in the HTML. This is an anomaly and a known issue. It does not respect the hierarchy. Example: /child::html/descendent::html[@tag_name="TD"]/descendent::form In this example, it does not look for all forms under a TD, but returns the list of all forms in the entire HTML document.

path should not be used with @url

2
4 5 6 7 7

1 1 1 1

2 2

Use DOM Inspector http://www.ieinspector.com/dominspector/download.html OR For most cases, you should just open the HTML source by doing a rightclick on the page of interest and selecting "View Source" on the popup menu. Use DOM Inspector http://www.ieinspector.com/dominspector/download.html OR For most cases, you should just open the HTML source by doing a rightclick on the page of interest and selecting "View Source" on the popup menu. Use DOM Inspector http://www.ieinspector.com/dominspector/download.html OR For most cases, you should just open the HTML source by doing a rightclick on the page of interest and selecting "View Source" on the popup menu. Use DOM Inspector http://www.ieinspector.com/dominspector/download.html OR For most cases, you should just open the HTML source by doing a rightclick on the page of interest and selecting "View Source" on the popup menu.

S-ar putea să vă placă și