com.appperfect.devcommon.script.windowelement
Interface WinObject

All Superinterfaces:
IScript
All Known Subinterfaces:
WinApplet, WinButton, WinCalendar, WinCheckBox, WinComboBox, WinComboListBox, WinEdit, WinFlash, WinListBox, WinListView, WinMenu, WinMenuWindow, WinRadioButton, WinScrollbar, WinSpin, WinStatic, WinStatusBar, WinTab, WinToolbar, WinTreeView

public interface WinObject
extends IScript

WinObject represents the generic window element. WinObject element can be created using createWinObject API of IScriptEngine interface. The return value is an instance of WinObject interface. Once WinObject is created, you can play events mentioned below.


Field Summary
static int micLineNext
  
static int micLinePrev
  
static int micPageNext
  
static int micPagePrev
  
static int micScrollEnd
  
static int micScrollStart
  
static int micSetPos
  
 
Method Summary
 boolean accDoDefaultAction()
 To execute the default action associated with the accessible UI element using Windows Accessibility
 boolean activate()
 To activate or bring window to focus
 void addAttribute(java.lang.String sAttributeName, java.lang.String sAttributeValue, boolean bIgnore, boolean bValidate, java.lang.String testParameterName)
 Each Web or Window Element has a set of attributes, which are used to find the desired element during execution This method is used to add a attribute to the event
 void captureImage(java.lang.String imageFilePath, boolean overrideExisting)
 To capture the window's image
 boolean click(int x, int y)
 To simulate click on WinObject
 boolean close()
 To close window
 boolean dblClick(int x, int y)
 To simulate double click on WinObject
 boolean deSelect(int index)
 To deselect item at specified index in controls like Combobox, listbox etc.
 boolean deSelectItem(java.lang.String item)
 To deselect specified item in controls like Combobox, listbox etc.
 boolean drag(int x, int y)
 To simulate drag on WinObject
 boolean dragDrop(int x, int y, int displace_x, int displace_y)
  
 boolean drop(int x, int y)
 To simulate drop on WinObject
 boolean extendSelect(int index)
 To select additional item at specified index
 boolean extendSelectItem(java.lang.String item)
 To select additional specified item
 int get_accChildCount()
 To get the accessible child count for a given UI element using Windows Accessibility
 java.lang.String get_accDescription()
 To get the accessible description property using Windows Accessibility
 int get_accHeight()
 To get the height of the UI element in screen coordinates using Windows Accessibility
 java.lang.String get_accHelp()
 To get the accessible Help property using Windows Accessibility
 java.lang.String get_accKeyboardShortcut()
 To get the accessible keyboard shortcut property using Windows Accessibility
 int get_accLocationLeft()
 To get the left position of the UI element in screen coordinates using Windows Accessibility
 int get_accLocationTop()
 To get the top position of the UI element in screen coordinates using Windows Accessibility
 java.lang.String get_accName()
 To get the accessible name property using Windows Accessibility
 java.lang.String get_accRole()
 To get the accessible role property using Windows Accessibility
 java.lang.String get_accState()
 To get the accessible State property using Windows Accessibility
 java.lang.String get_accValue()
 To get the accessible Value property using Windows Accessibility
 int get_accWidth()
 To get the width of the UI element in screen coordinates using Windows Accessibility
 java.lang.String getItem(int index)
 To get item at specified index in controls like Combobox, listbox etc.
 java.lang.String[] getItems()
 To get items in controls like Combobox, listbox, tree etc.
 int getItemsCount()
 To get items count in controls like Combobox, listbox, tree etc.
 java.lang.String getSelectedItem()
 To get selected item in controls like Combobox, listbox etc.
 java.lang.String[] getSelectedItems()
 To get selected items in controls like Combobox, listbox, tree etc.
 java.lang.String getText()
 To get the text associated with the window, like title. label etc.
 boolean hScroll(int option, int item)
 Vertically scrolls an object that has embedded scrollbars
 boolean maximize()
 To maximise window
 boolean minimize()
 To minimise window to an icon
 boolean mouseMove(int x, int y)
 To simulate mouse move on WinObject
 boolean restore()
 To restore window to previous size
 boolean rightClick(int x, int y)
 To simulate right click on WinObject
 boolean select(int index)
 To select item at specified index in controls like Combobox, listbox etc.
 boolean selectItem(java.lang.String item)
 To select specified item in controls like Combobox, listbox etc.
 boolean selectRange(int fromindex, int toIndex)
 To select range of items in multi select list box
 boolean selectRangeItem(java.lang.String fromitem, java.lang.String toItem)
 To select range of items in multi select list box
 void setBreakPoint(boolean bBreakPoint)
 This method should be called to set a breakpoint before executing task.
 void setIgnored(boolean bIgnore)
 This method should be called to ignore a task during execution.
 void setImagePath(java.lang.String sImagePath)
 This is used to set the event's image path.
 void setRecordedWhileShowingSSLCertificate(boolean flag)
 This method should be called to mark event as an event on SSL ceritiicate dialog
 void setThinkTime(int iThinkTime)
 Delay in seconds before the task is actually executed.
 void setTitle(java.lang.String sTitle)
 This method is used to set the event's title
 boolean type(java.lang.String keyBoardInput, boolean isAlphaNumeric)
 Types the specified string in the object
 boolean vScroll(int option, int item)
 Horizontally scrolls an object that has embedded scrollbars
 boolean wait(java.lang.String propertyName, java.lang.String propertyValue, long timeout)
 Will make replayer wait till specified property recieves specified value or till the specified time out period, whatever happens earlier
 
Methods inherited from interface com.appperfect.devcommon.script.IScript
getReasonForFailure, isIgnored, isTaskSuccessful, isTaskTimedOut, setReasonForFailure, setTaskSuccessful, setTaskTimedout, setTimeout
 

Field Detail

micLineNext

static final int micLineNext
See Also:
Constant Field Values

micLinePrev

static final int micLinePrev
See Also:
Constant Field Values

micPageNext

static final int micPageNext
See Also:
Constant Field Values

micPagePrev

static final int micPagePrev
See Also:
Constant Field Values

micScrollEnd

static final int micScrollEnd
See Also:
Constant Field Values

micScrollStart

static final int micScrollStart
See Also:
Constant Field Values

micSetPos

static final int micSetPos
See Also:
Constant Field Values
Method Detail

accDoDefaultAction

boolean accDoDefaultAction()
To execute the default action associated with the accessible UI element using Windows Accessibility

Returns:
true if successful, false otherwise

activate

boolean activate()
To activate or bring window to focus

Returns:
true if success, false otherwise

addAttribute

void addAttribute(java.lang.String sAttributeName,
                  java.lang.String sAttributeValue,
                  boolean bIgnore,
                  boolean bValidate,
                  java.lang.String testParameterName)
Each Web or Window Element has a set of attributes, which are used to find the desired element during execution This method is used to add a attribute to the event

Parameters:
sAttributeName - name of the attribute
sAttributeValue - value of the attribute
bIgnore - true if this attribute should be ignored; false otherwise.
bValidate - true if this attribute should be validated; false otherwise.
testParameterName - name of the TestParameter if the attribute value is parameterized

captureImage

void captureImage(java.lang.String imageFilePath,
                  boolean overrideExisting)
To capture the window's image

Parameters:
imageFilePath - file path where the image should be saved.
overrideExisting - to decide whether image should be overridden if it already exists.

click

boolean click(int x,
              int y)
To simulate click on WinObject

Parameters:
x - x corrdinate relative to window's client rect
y - y corrdinate relative to window's client rect
Returns:
true if success, false otherwise

close

boolean close()
To close window

Returns:
true if success, false otherwise

dblClick

boolean dblClick(int x,
                 int y)
To simulate double click on WinObject

Parameters:
x - x corrdinate relative to window's client rect
y - y corrdinate relative to window's client rect
Returns:
true if success, false otherwise

deSelect

boolean deSelect(int index)
To deselect item at specified index in controls like Combobox, listbox etc.

Parameters:
index - zero based index of the item to be deselected
Returns:
true if success, false otherwise

deSelectItem

boolean deSelectItem(java.lang.String item)
To deselect specified item in controls like Combobox, listbox etc.

Parameters:
item - item to deselect
Returns:
true if success, false otherwise

drag

boolean drag(int x,
             int y)
To simulate drag on WinObject

Parameters:
x - x corrdinate relative to window's client rect
y - y corrdinate relative to window's client rect
Returns:
true if success, false otherwise

dragDrop

boolean dragDrop(int x,
                 int y,
                 int displace_x,
                 int displace_y)
Parameters:
x - x corrdinate relative to window's client rect
y - y corrdinate relative to window's client rect
displace_x - pixels to move from x location
displace_y - pixels to move from y location
Returns:
true if success, false otherwise

drop

boolean drop(int x,
             int y)
To simulate drop on WinObject

Parameters:
x - x corrdinate relative to window's client rect
y - y corrdinate relative to window's client rect
Returns:
true if success, false otherwise

extendSelect

boolean extendSelect(int index)
To select additional item at specified index

Parameters:
index - zero based index of the item to be selected
Returns:
true if success, false otherwise

extendSelectItem

boolean extendSelectItem(java.lang.String item)
To select additional specified item

Parameters:
item - to select
Returns:
true if success, false otherwise

get_accChildCount

int get_accChildCount()
To get the accessible child count for a given UI element using Windows Accessibility

Returns:
the accessible child count for a given UI element using Windows Accessibility

get_accDescription

java.lang.String get_accDescription()
To get the accessible description property using Windows Accessibility

Returns:
the accessible description property using Windows Accessibility

get_accHeight

int get_accHeight()
To get the height of the UI element in screen coordinates using Windows Accessibility

Returns:
the height of the UI element in screen coordinates using Windows Accessibility

get_accHelp

java.lang.String get_accHelp()
To get the accessible Help property using Windows Accessibility

Returns:
the accessible Help property using Windows Accessibility

get_accKeyboardShortcut

java.lang.String get_accKeyboardShortcut()
To get the accessible keyboard shortcut property using Windows Accessibility

Returns:
the accessible keyboard shortcut property using Windows Accessibility

get_accLocationLeft

int get_accLocationLeft()
To get the left position of the UI element in screen coordinates using Windows Accessibility

Returns:
the left position of the UI element in screen coordinates using Windows Accessibility

get_accLocationTop

int get_accLocationTop()
To get the top position of the UI element in screen coordinates using Windows Accessibility

Returns:
the top position of the UI element in screen coordinates using Windows Accessibility

get_accName

java.lang.String get_accName()
To get the accessible name property using Windows Accessibility

Returns:
the accessible name property using Windows Accessibility

get_accRole

java.lang.String get_accRole()
To get the accessible role property using Windows Accessibility

Returns:
the accessible role property using Windows Accessibility

get_accState

java.lang.String get_accState()
To get the accessible State property using Windows Accessibility

Returns:
the accessible State property using Windows Accessibility

get_accValue

java.lang.String get_accValue()
To get the accessible Value property using Windows Accessibility

Returns:
the accessible Value property using Windows Accessibility

get_accWidth

int get_accWidth()
To get the width of the UI element in screen coordinates using Windows Accessibility

Returns:
the width of the UI element in screen coordinates using Windows Accessibility

getItem

java.lang.String getItem(int index)
To get item at specified index in controls like Combobox, listbox etc.

Parameters:
index - zero based index
Returns:
item at specified index

getItems

java.lang.String[] getItems()
To get items in controls like Combobox, listbox, tree etc.

Returns:
items in controls like Combobox, listbox, tree etc.

getItemsCount

int getItemsCount()
To get items count in controls like Combobox, listbox, tree etc.

Returns:
items count in controls like Combobox, listbox, tree etc.

getSelectedItem

java.lang.String getSelectedItem()
To get selected item in controls like Combobox, listbox etc.

Returns:
selected item in controls like Combobox, listbox etc.

getSelectedItems

java.lang.String[] getSelectedItems()
To get selected items in controls like Combobox, listbox, tree etc.

Returns:
selected items in controls like Combobox, listbox, tree etc.

getText

java.lang.String getText()
To get the text associated with the window, like title. label etc.

Returns:
the text associated with the window, like title. label etc.

hScroll

boolean hScroll(int option,
                int item)
Vertically scrolls an object that has embedded scrollbars

Parameters:
option - is a pre-defined constant indicating the direction and increment-type to scroll. Possible values are as follows : 0 Scrolls X lines down, where X is specified by the item argument 1 Scrolls X lines up, where X is specified by the item argument 2 Scrolls X pages down, where X is specified by the item argument 3 Scrolls X pages up, where X is specified by the item argument 4 Scrolls to the top of Scrollbar 5 Scrolls to the bottom of Scrollbar 6 Scrolls to the position specified by the item argument
item - this value specifies the quantity of lines or pages to scroll
Returns:
true if success, false otherwise

maximize

boolean maximize()
To maximise window

Returns:
true if success, false otherwise

minimize

boolean minimize()
To minimise window to an icon

Returns:
true if success, false otherwise

mouseMove

boolean mouseMove(int x,
                  int y)
To simulate mouse move on WinObject

Parameters:
x - x corrdinate relative to window's client rect
y - y corrdinate relative to window's client rect
Returns:
true if success, false otherwise

restore

boolean restore()
To restore window to previous size

Returns:
true if success, false otherwise

rightClick

boolean rightClick(int x,
                   int y)
To simulate right click on WinObject

Parameters:
x - x corrdinate relative to window's client rect
y - y corrdinate relative to window's client rect
Returns:
true if success, false otherwise

select

boolean select(int index)
To select item at specified index in controls like Combobox, listbox etc.

Parameters:
index - zero based index
Returns:
true if success, false otherwise

selectItem

boolean selectItem(java.lang.String item)
To select specified item in controls like Combobox, listbox etc.

Parameters:
item - item to select
Returns:
true if success, false otherwise

selectRange

boolean selectRange(int fromindex,
                    int toIndex)
To select range of items in multi select list box

Parameters:
fromindex -
toIndex -
Returns:
true if success, false otherwise

selectRangeItem

boolean selectRangeItem(java.lang.String fromitem,
                        java.lang.String toItem)
To select range of items in multi select list box

Parameters:
fromitem -
toItem -
Returns:
true if success, false otherwise

setBreakPoint

void setBreakPoint(boolean bBreakPoint)
This method should be called to set a breakpoint before executing task. In case breakpoint is set, test will wait for user's interruption before moving forward.

Parameters:
bBreakPoint - true if breakpoint should be set; false otherwise.

setIgnored

void setIgnored(boolean bIgnore)
This method should be called to ignore a task during execution.

Specified by:
setIgnored in interface IScript
Parameters:
bIgnore - true if this task should be executed; false otherwise.

setImagePath

void setImagePath(java.lang.String sImagePath)
This is used to set the event's image path.

Parameters:
sImagePath - file path of the event's image saved on disk.

setRecordedWhileShowingSSLCertificate

void setRecordedWhileShowingSSLCertificate(boolean flag)
This method should be called to mark event as an event on SSL ceritiicate dialog

Parameters:
flag - true if this event is an event on SSL ceritiicate dialog; false otherwise.

setThinkTime

void setThinkTime(int iThinkTime)
Delay in seconds before the task is actually executed.

Specified by:
setThinkTime in interface IScript
Parameters:
iThinkTime - no of seconds the engine waits before the task is actually executed.

setTitle

void setTitle(java.lang.String sTitle)
This method is used to set the event's title

Parameters:
sTitle - title of the event

type

boolean type(java.lang.String keyBoardInput,
             boolean isAlphaNumeric)
Types the specified string in the object

Parameters:
keyBoardInput - A String value. The text string to type.
isAlphaNumeric - is true if text string represents a alphanumeric key, false otherwise
Returns:
true if success, false otherwise

vScroll

boolean vScroll(int option,
                int item)
Horizontally scrolls an object that has embedded scrollbars

Parameters:
option - is a pre-defined constant indicating the direction and increment-type to scroll. Possible values are as follows : 0 Scrolls X lines forwards, where X is specified by the item argument 1 Scrolls X lines backwards, where X is specified by the item argument 2 Scrolls X pages forwards, where X is specified by the item argument 3 Scrolls X pages backwards, where X is specified by the item argument 4 Scrolls to the beginning of Scrollbar 5 Scrolls to the end of Scrollbar 6 Scrolls to the position specified by the item argument
item - this value specifies the quantity of lines or pages to scroll
Returns:
true if success, false otherwise

wait

boolean wait(java.lang.String propertyName,
             java.lang.String propertyValue,
             long timeout)
Will make replayer wait till specified property recieves specified value or till the specified time out period, whatever happens earlier

Parameters:
propertyName - name of the element's attribute for which the value should be fetched.
propertyValue - value of the attribute against which the comparision should be done
timeout - in no. of seconds, time period for which the replayer should wait to get the expected value
Returns:
true if event was executed successfully, returns false if there is any failure during execution


Copyright © 2003-2011 AppPerfect Corporation. All Rights Reserved.