org.safs.rational
Class CFList

java.lang.Object
  extended by org.safs.Processor
      extended by org.safs.ComponentFunction
          extended by org.safs.rational.CFComponent
              extended by org.safs.rational.CFList
Direct Known Subclasses:
CFFlexList, CFList

public class CFList
extends CFComponent


Purpose: CFList, process a List component
Lifetime: instantiated by TestStepProcessor

Since:
JUL 09, 2003
JUL 09, 2003 (DBauman) Original Release
JAN 14, 2004 (BNat) fix for the ActivatePartialMatch keyword.
JUN 29, 2004 (BNat) ClickTextItem new keyword added.
NOV 09, 2004 (CANAGL) SelectAnother and VerifyUnSelected added.
JUN 03, 2005 (Jeremy_J_Smith) VerifySelected use of String as well as TestObject.
AUG 18, 2005 (Jeremy_J_Smith) RightClickTextItem added.
Nov 22, 2005 (RFiroz) ExtendSelectionToTextItem added.
MAR 25, 2008 (JunwuMa) Added VerifyListContains,VerifyListContainsPartialMatch,VerifyListDoesNotContain and VerifyListContainsPartialMatch.
JUN 27, 2008 (LeiWang) Add mehtod getListContents() to support the .NET application
JUL 11, 2008 (LeiWang) Modify mehtod clickTextItem(),verifySelected() to support the .NET application. Modify method selectIndex() for an index bug.
JUL 22, 2008 (LeiWang) Modify method verifySelected(). Original version only take one selected item to compare. Now we will compare with all selected items. Work for awt.List, swing.JList, Forms.ListBox, Forms.ListView and their subclass. Modify method verifyItem(), .NET List has "Text" property instead of "text"
SEP 03, 2008 (JunwuMa) Added SetListContains.
SEP 11, 2008 (LeiWang) Add method clickTextItem2() to replace clickTextItem(). The old one try to find the rectangle of the item within the list, this will call application specific method to do that; The new one use RFT API and let RFT to handle locating the item in the list. Impacted keywords: ClickTextItem, RightClickTextItem, RightClickUnverifiedTextItem Modified method verifySelected(), if the list contains nothing, a null object is returned, I add some code to handle it.
DEC 22, 2008 (JunwuMa) Modify getListContents() supporting SAS.SharedUI.TreeListView, which is derived from System.Windows.Forms.ListView, also is a DotNetTable and a DotNetTree. This class combines features of ListBox, Tree and Table. Take the first column of this object as the ListBox treated as usual. Fix S0553625. Modify getListContents() and treat SAS.Shared.SASFormatInfo (list item) specifically. Fix S0554094.
FEB 24, 2009 (LeiWang) For supporting Flex list. Modify method activatePartialMatch(),clickTextItem2(),getListContents(), modifiedClickTextItem(),selectTextItem(),verifyItem(),verifySelected() Add method getListItem(),searchForListItem(),performDoubleClick(),scrollToIndex(),scrollToText()
MAR 13, 2009 (CANAGL) Renamed getListContents to be captureObjectData and refactored moving SAS-specific class information into rational.custom.CFList.
MAY 20, 2009 (CANAGL) Removed extra stripping of quotes done to param. These quotes should already be stripped in TestStepProcessor.interpretFields

Field Summary
static java.lang.String ACTIVATEPARTIALMATCH
           
static java.lang.String ACTIVATETEXTITEM
           
static java.lang.String ACTIVATEUNVERIFIEDPARTIALMATCH
           
static java.lang.String ACTIVATEUNVERIFIEDTEXTITEM
           
static java.lang.String CAPTUREITEMSTOFILE
           
static java.lang.String CLICKTEXTITEM
           
static java.lang.String EXTENDSELECTIONTOTEXTITEM
           
static java.lang.String NETLISTBOXCLASSNAME
           
static java.lang.String NETLISTVIEWCLASSNAME
           
static java.lang.String RIGHTCLICKTEXTITEM
           
static java.lang.String RIGHTCLICKUNVERIFIEDTEXTITEM
           
static java.lang.String SELECT
           
static java.lang.String SELECTANOTHERTEXTITEM
           
static java.lang.String SELECTANOTHERUNVERIFIEDTEXTITEM
           
static java.lang.String SELECTINDEX
           
static java.lang.String SELECTPARTIALMATCH
           
static java.lang.String SELECTTEXTITEM
           
static java.lang.String SELECTUNVERIFIED
           
static java.lang.String SELECTUNVERIFIEDPARTIALMATCH
           
static java.lang.String SELECTUNVERIFIEDTEXTITEM
           
static java.lang.String SETLISTCONTAINS
           
static java.lang.String SETTEXTVALUE
           
static java.lang.String VERIFYITEM
           
static java.lang.String VERIFYITEMUNSELECTED
           
static java.lang.String VERIFYLISTCONTAINS
           
static java.lang.String VERIFYLISTCONTAINSPARTIALMATCH
           
static java.lang.String VERIFYLISTDOESNOTCONTAIN
           
static java.lang.String VERIFYLISTDOESNOTCONTAINPARTIALMATCH
           
static java.lang.String VERIFYMENUITEM
           
static java.lang.String VERIFYMENUPARTIALMATCH
           
static java.lang.String VERIFYPARTIALMATCH
           
static java.lang.String VERIFYSELECTED
           
static java.lang.String VERIFYSELECTEDITEM
           
static java.lang.String VERIFYSELECTEDPARTIALMATCH
           
 
Fields inherited from class org.safs.rational.CFComponent
ALTLEFTDRAG, ASSIGNPROPERTYVARIABLE, CAPTUREOBJECTDATATOFILE, CAPTUREPROPERTIESTOFILE, CAPTUREPROPERTYTOFILE, CLEARAPPMAPCACHE, CLICK, CLOSEWINDOW, COMPONENTCLICK, CTRLALTLEFTDRAG, CTRLCLICK, CTRLLEFTDRAG, CTRLRIGHTCLICK, CTRLSHIFTLEFTDRAG, DOUBLECLICK, GETGUIIMAGE, GUIDOESEXIST, GUIDOESNOTEXIST, HOVERMOUSE, HSCROLLTO, INPUTCHARACTERS, INPUTKEYS, LEFTDRAG, MAXIMIZE, MINIMIZE, obj1, RESTORE, RIGHTCLICK, RIGHTDRAG, script, SELECTMENUITEM, SELECTMENUITEMCONTAINS, SETPOSITION, SETPROPERTYVALUE, SHIFTCLICK, SHIFTLEFTDRAG, VERIFYARRAYPROPERTYTOFILE, VERIFYBINARYFILETOFILE, VERIFYCLIPBOARDTOFILE, VERIFYFILETOFILE, VERIFYGUIIMAGETOFILE, VERIFYMENUITEMCONTAINS, VERIFYOBJECTDATATOFILE, VERIFYPROPERTY, VERIFYPROPERTYCONTAINS, VERIFYPROPERTYTOFILE, VERIFYTEXTFILETOFILE, VERIFYVALUECONTAINS, VERIFYVALUEEQUALS, VERIFYVALUES, VERIFYVALUESIGNORECASE, VSCROLLTO, WAITFORGUI, WIN_MAXIMIZED, WIN_MINIMIZED, WIN_NORMAL
 
Fields inherited from class org.safs.ComponentFunction
action, compName, mapname, utils, windowName
 
Fields inherited from class org.safs.Processor
breakpointsOn, CASE_INSENSITIVE_FLAG, CASEINSENSITIVE_FLAG, clearProxiesAlways, commandLineBreakpoint, customStr, customText, DEBUG_MESSAGE, debugStr, debugText, DEFAULT_CUSTOM_PROCESSOR_PACKAGE, DEFAULT_CUSTOM_PROCESSOR_SUBPACKAGE, DEFAULT_PROCESSOR_PACKAGE, FAILED_MESSAGE, FAILED_OK_MESSAGE, failedStr, failedText, FAILURE_DETAIL, GENERIC_MESSAGE, genericStr, genericText, LINE_FAILURE_4, log, myBreakpointsOn, otherStr, otherText, PARAM_SIZE_1, PARAM_SIZE_2, PARAM_SIZE_3, PARAM_SIZE_4, params, PASSED_MESSAGE, passedStr, passedText, PRE_TXT_SUCCESS_4, PRE_TXT_SUCCESS_5, processorConfigSet, processorMap, recordProcessed, RECTYPE_DRIVER_COMMAND, RECTYPE_DRIVER_COMMAND_F, RECTYPE_DRIVER_COMMAND_W, RECTYPE_TEST_STEP, RECTYPE_TEST_STEP_F, RECTYPE_TEST_STEP_W, SAFS_CLEARPROXIESALWAYS_ITEM, SAFS_COMMANDLINEBREAKPOINT_ITEM, SAFS_COMMANDLINEBREAKPOINT_VARIABLE, SAFS_PARAMS_FILE, SAFS_RESBUN_NAME, SAFS_SECSWAITFORCOMPONENT_ITEM, SAFS_SECSWAITFORCOMPONENT_VARIABLE, SAFS_SECSWAITFORWINDOW_ITEM, SAFS_SECSWAITFORWINDOW_VARIABLE, SAFS_TESTDOMAINS_ITEM, SAFS_TESTDOMAINS_VARIABLE, secsWaitForComponent, secsWaitForWindow, SENT_MSG_3, testDomains, testRecordData, TXT_FAILURE_1, TXT_FAILURE_2, TXT_FAILURE_3, TXT_FAILURE_4, TXT_FAILURE_5, TXT_SUCCESS_1, TXT_SUCCESS_2, TXT_SUCCESS_2a, TXT_SUCCESS_3, TXT_SUCCESS_4, TXT_SUCCESS_5, WARNING_MESSAGE, WARNING_OK_MESSAGE, warningStr, warningText
 
Constructor Summary
CFList()
          
Purpose: constructor, calls super
 
Method Summary
protected  void activatePartialMatch(GuiSubitemTestObject guiObj, java.lang.String param, boolean exact)
          
Purpose: activatePartialMatch
protected  void captureItemsToFile()
          
Purpose: captureItemsToFile
protected  java.util.List captureObjectData(TestObject guiObj)
          Note: Need to modify this method if we want to support new application type, such as Flex application
protected  void clickTextItem(GuiSubitemTestObject guiObj, java.lang.String param, boolean exact, boolean rightClick)
          Deprecated. Use clickTextItem2 instead.
protected  void clickTextItem2(GuiSubitemTestObject guiObj, java.lang.String itemToClick, boolean exact, boolean rightClick, boolean verified)
          
Note: This method can replace clickTextItem().
protected  java.lang.String getListItem(GuiTestObject guiObj, int index)
           
protected  void localProcess()
          
Purpose: process: process the testRecordData
This is our specific version.
protected  void modifiedClickTextItem(MouseModifiers mbuttons, GuiSubitemTestObject guiObj, java.lang.String param)
          
Purpose: click with various mouse buttons active
protected  void modifiedDoubleClickTextItem(MouseModifiers mbuttons, GuiSubitemTestObject guiObj, java.lang.String param)
          
Purpose: activateUnverifiedTextItem
protected  java.lang.String performDoubleClick(GuiSubitemTestObject guiObj, java.lang.String param, boolean exact, MouseModifiers mbuttons)
          Purpose: Perform a double click on the item in a list Note: Should be called by function without verification, as this method will check the existence of item
protected  boolean scrollToIndex(GuiSubitemTestObject guiObj, int index)
          Note: Scroll to the item to make it shown on screen so that click or select can be executed.
protected  boolean scrollToText(GuiSubitemTestObject guiObj, java.lang.String text)
          Note: Scroll to the item to make it shown on screen so that click or select can be executed.
protected  java.lang.String[] searchForListItem(GuiSubitemTestObject guiObj, java.lang.String param, boolean exact)
          Purpose: Search item in list
protected  void selectIndex(GuiSubitemTestObject guiObj, java.lang.String param)
          
Purpose: selectIndex
17 JUL 2008 (LeiWang) Modify index setting.
protected  boolean selectItemAtIndex(GuiSubitemTestObject guiObj, int index)
          try both click and setState(Action.select() means to select an item by index
protected  void selectPartialMatch(GuiSubitemTestObject guiObj, java.lang.String param, boolean exact)
          
Purpose: selectPartialMatch
protected  void SetListContains(GuiSubitemTestObject guiObj, java.lang.String param, java.util.Iterator piter)
          
Purpose: repeatly access each list-item of guiObj to see if its substring matches target string param.
protected  void verifyItem(GuiSubitemTestObject guiObj, java.lang.String param, java.util.Iterator piter)
          
Purpose: verifyItem
protected  void VerifyListContains(GuiSubitemTestObject guiObj, java.lang.String param, java.util.Iterator piter, boolean exact)
          
Purpose: respond to VERIFYLISTCONTAINS and VERIFYLISCONTAINSPARTIALMATCH.
protected  void VerifyListNotContain(GuiSubitemTestObject guiObj, java.lang.String param, java.util.Iterator piter, boolean exact)
          
Purpose: respond to VERIFYLISDOESNOTCONTAINMATCH and VERIFYLISDOESNOTCONTAINPARTIALMATCH
protected  void verifyMenuItem(GuiSubitemTestObject guiObj, java.lang.String param)
          
Purpose: verifyMenuItem
protected  void verifySelected(GuiSubitemTestObject guiObj, java.lang.String param, boolean partialmatch)
          
Purpose: verifySelected
protected  void verifySelected(GuiSubitemTestObject guiObj, java.lang.String param, boolean partialmatch, boolean desireSelected)
          
Purpose: verifySelected
protected  void verifyUnSelected(GuiSubitemTestObject guiObj, java.lang.String param, boolean partialmatch)
          
Purpose: verifyUnSelected
 
Methods inherited from class org.safs.rational.CFComponent
captureObjectDataToFile, checkForCoord, checkForCoord, componentClick, convertObjectValueToString, extractTreeItemsSub, findMenuBars, formatObjectData, getAppletsBrowser, getComponentRectangle, getHelpers, getObjectProperty, getObjectPropertyFromProperties, getUserObject, isDotnetDomain, isFlexDomain, isHtmlDomain, isJavaDomain, isSwtDomain, isSWTWidget, isWinDomain, listAllProperties, listAllProperties, listMethods, listNonValueProperties, listProperties, matchedPathOfMenuItem, parseWhereInfo, performClick, preformDrag, process, selectMenuItem, setPosition, tobj, verifyMenuItem
 
Methods inherited from class org.safs.ComponentFunction
action_getGuiImage, action_verifyGuiImageToFile, componentExecutedFailureMessage, componentFailureMessage, componentSuccessMessage, convertCoords, convertNum, getAlternateParams, getHelpersWorker, issueActionFailure, issueActionOnXFailure, issueErrorPerformingAction, issueErrorPerformingActionOnX, issueFileErrorFailure, issueInputRecordFailure, issueParameterCountFailure, issueParameterCountFailure, issueParameterValueFailure, issuePassedSuccess, issuePassedSuccessUsing, issueUnknownErrorFailure, isSupportedRecordType, lookupAppMapCoordReference, lookupAppMapNumReference, lookupAppMapReference, updateFromTestRecordData
 
Methods inherited from class org.safs.Processor
activateBreakpoint, checkBreakpoints, checkMyBreakpoints, delay, distributeConfigInformation, getAppMapItem, getChainedProcessor, getClassInstance, getClearProxiesAlways, getCustomProcClassNames, getCustomProcInstancePath, getLogUtilities, getParams, getProcClassNames, getProcInstance, getProcInstancePath, getRequiredField, getSecsWaitForComponent, getSecsWaitForWindow, getStandardErrorMessage, getTestRecordData, getVariable, hasChainedProcessor, initProcessorAndProcess, instanceProcessorAndProcess, isBreakpointsOn, isComponentFunctionRecord, isDriverCommandRecord, isEngineCommandRecord, isMyBreakpointsOn, isRecordProcessed, paramsFailedMsg, paramsFailedMsg, processCustomProcessor, processSubclassProcessor, setBreakpointsOn, setChainedProcessor, setClearProxiesAlways, setCommandLineBreakpoint, setCustomProcInstancePath, setLogUtilities, setMyBreakpointsOn, setParams, setProcInstance, setProcInstancePath, setRecordProcessed, setSecsWaitForComponent, setSecsWaitForWindow, setTestDomains, setTestRecordData, setVariable, standardFailureMessage, substituteVariable, validateParamSize, validProcessorClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVATETEXTITEM

public static final java.lang.String ACTIVATETEXTITEM
See Also:
Constant Field Values

ACTIVATEPARTIALMATCH

public static final java.lang.String ACTIVATEPARTIALMATCH
See Also:
Constant Field Values

ACTIVATEUNVERIFIEDPARTIALMATCH

public static final java.lang.String ACTIVATEUNVERIFIEDPARTIALMATCH
See Also:
Constant Field Values

ACTIVATEUNVERIFIEDTEXTITEM

public static final java.lang.String ACTIVATEUNVERIFIEDTEXTITEM
See Also:
Constant Field Values

CAPTUREITEMSTOFILE

public static final java.lang.String CAPTUREITEMSTOFILE
See Also:
Constant Field Values

EXTENDSELECTIONTOTEXTITEM

public static final java.lang.String EXTENDSELECTIONTOTEXTITEM
See Also:
Constant Field Values

SELECT

public static final java.lang.String SELECT
See Also:
Constant Field Values

SELECTANOTHERTEXTITEM

public static final java.lang.String SELECTANOTHERTEXTITEM
See Also:
Constant Field Values

SELECTANOTHERUNVERIFIEDTEXTITEM

public static final java.lang.String SELECTANOTHERUNVERIFIEDTEXTITEM
See Also:
Constant Field Values

SELECTTEXTITEM

public static final java.lang.String SELECTTEXTITEM
See Also:
Constant Field Values

CLICKTEXTITEM

public static final java.lang.String CLICKTEXTITEM
See Also:
Constant Field Values

RIGHTCLICKTEXTITEM

public static final java.lang.String RIGHTCLICKTEXTITEM
See Also:
Constant Field Values

RIGHTCLICKUNVERIFIEDTEXTITEM

public static final java.lang.String RIGHTCLICKUNVERIFIEDTEXTITEM
See Also:
Constant Field Values

SELECTINDEX

public static final java.lang.String SELECTINDEX
See Also:
Constant Field Values

SELECTPARTIALMATCH

public static final java.lang.String SELECTPARTIALMATCH
See Also:
Constant Field Values

SELECTUNVERIFIEDPARTIALMATCH

public static final java.lang.String SELECTUNVERIFIEDPARTIALMATCH
See Also:
Constant Field Values

SELECTUNVERIFIED

public static final java.lang.String SELECTUNVERIFIED
See Also:
Constant Field Values

SELECTUNVERIFIEDTEXTITEM

public static final java.lang.String SELECTUNVERIFIEDTEXTITEM
See Also:
Constant Field Values

SETTEXTVALUE

public static final java.lang.String SETTEXTVALUE
See Also:
Constant Field Values

SETLISTCONTAINS

public static final java.lang.String SETLISTCONTAINS
See Also:
Constant Field Values

VERIFYMENUPARTIALMATCH

public static final java.lang.String VERIFYMENUPARTIALMATCH
See Also:
Constant Field Values

VERIFYMENUITEM

public static final java.lang.String VERIFYMENUITEM
See Also:
Constant Field Values

VERIFYPARTIALMATCH

public static final java.lang.String VERIFYPARTIALMATCH
See Also:
Constant Field Values

VERIFYITEM

public static final java.lang.String VERIFYITEM
See Also:
Constant Field Values

VERIFYSELECTED

public static final java.lang.String VERIFYSELECTED
See Also:
Constant Field Values

VERIFYSELECTEDITEM

public static final java.lang.String VERIFYSELECTEDITEM
See Also:
Constant Field Values

VERIFYSELECTEDPARTIALMATCH

public static final java.lang.String VERIFYSELECTEDPARTIALMATCH
See Also:
Constant Field Values

VERIFYITEMUNSELECTED

public static final java.lang.String VERIFYITEMUNSELECTED
See Also:
Constant Field Values

VERIFYLISTCONTAINS

public static final java.lang.String VERIFYLISTCONTAINS
See Also:
Constant Field Values

VERIFYLISTCONTAINSPARTIALMATCH

public static final java.lang.String VERIFYLISTCONTAINSPARTIALMATCH
See Also:
Constant Field Values

VERIFYLISTDOESNOTCONTAIN

public static final java.lang.String VERIFYLISTDOESNOTCONTAIN
See Also:
Constant Field Values

VERIFYLISTDOESNOTCONTAINPARTIALMATCH

public static final java.lang.String VERIFYLISTDOESNOTCONTAINPARTIALMATCH
See Also:
Constant Field Values

NETLISTBOXCLASSNAME

public static final java.lang.String NETLISTBOXCLASSNAME
See Also:
Constant Field Values

NETLISTVIEWCLASSNAME

public static final java.lang.String NETLISTVIEWCLASSNAME
See Also:
Constant Field Values
Constructor Detail

CFList

public CFList()

Purpose: constructor, calls super

Method Detail

localProcess

protected void localProcess()

Purpose: process: process the testRecordData
This is our specific version. We subclass the generic CFComponent. The actions handled here are:


NOTE: the 'activate' keywords didn't seem to work on the regression test because the use the guiObject.click instead of guiObject.setState method. The latter seems to work better
Side Effects: Processor.testRecordData statusCode is set based on the result of the processing
State Read: Processor.testRecordData, Processor.params
Assumptions: none
(CANAGL) 2009.05.20 Removed extra stripping of quotes done to param. These quotes should already be stripped in TestStepProcessor.interpretFields

Overrides:
localProcess in class CFComponent

selectItemAtIndex

protected boolean selectItemAtIndex(GuiSubitemTestObject guiObj,
                                    int index)
try both click and setState(Action.select() means to select an item by index


selectIndex

protected void selectIndex(GuiSubitemTestObject guiObj,
                           java.lang.String param)
                    throws SAFSException

Purpose: selectIndex
17 JUL 2008 (LeiWang) Modify index setting. Because SAFS consider list's index start from 1; while RFT consider list's index start from 0. We must minus 1 from the index param and pass it to RFT.

Throws:
SAFSException

selectPartialMatch

protected void selectPartialMatch(GuiSubitemTestObject guiObj,
                                  java.lang.String param,
                                  boolean exact)

Purpose: selectPartialMatch

Parameters:
exact, - boolean, if true, then exact match, else partial match

clickTextItem

protected void clickTextItem(GuiSubitemTestObject guiObj,
                             java.lang.String param,
                             boolean exact,
                             boolean rightClick)
Deprecated. Use clickTextItem2 instead.


Purpose: clickTextItem Generates a coordinate-based click at the deduced location of the list item.

Parameters:
exact - boolean; if true, then exact match, else partial match
rightClick - boolean; Right click or Left click?

clickTextItem2

protected void clickTextItem2(GuiSubitemTestObject guiObj,
                              java.lang.String itemToClick,
                              boolean exact,
                              boolean rightClick,
                              boolean verified)
                       throws SAFSException

Note: This method can replace clickTextItem().

Parameters:
guiObj - TestObject represents a List GUI object.
param - The item to be clicked in the list.
exact - If it is true, an exact match when do verification.
rightClick - If it is true, perform a mouse right click.
verified - If it is true, perfrom a verification, that is to verify if parameter itemToClick can be found in the List GUI object.
Throws:
SAFSException - Will be thrown out if the list contents can not be exacted from the list object.

activatePartialMatch

protected void activatePartialMatch(GuiSubitemTestObject guiObj,
                                    java.lang.String param,
                                    boolean exact)
                             throws SAFSException

Purpose: activatePartialMatch

Throws:
SAFSException

verifyMenuItem

protected void verifyMenuItem(GuiSubitemTestObject guiObj,
                              java.lang.String param)

Purpose: verifyMenuItem


verifySelected

protected void verifySelected(GuiSubitemTestObject guiObj,
                              java.lang.String param,
                              boolean partialmatch)

Purpose: verifySelected

Parameters:
partialmatch, - if true, then partial match on selected

verifyUnSelected

protected void verifyUnSelected(GuiSubitemTestObject guiObj,
                                java.lang.String param,
                                boolean partialmatch)

Purpose: verifyUnSelected

Parameters:
partialmatch, - if true, then partial match on unselected

verifySelected

protected void verifySelected(GuiSubitemTestObject guiObj,
                              java.lang.String param,
                              boolean partialmatch,
                              boolean desireSelected)

Purpose: verifySelected

Parameters:
partialmatch - if true, then partial match on selected
desireSelected - if true, test for selected; otherwise, unselected

verifyItem

protected void verifyItem(GuiSubitemTestObject guiObj,
                          java.lang.String param,
                          java.util.Iterator piter)

Purpose: verifyItem


getListItem

protected java.lang.String getListItem(GuiTestObject guiObj,
                                       int index)
                                throws SAFSException
Parameters:
guiObj - A test object represents a list
index - An index of the item in a list
Returns:
String, the item's text at index of a list
Throws:
SAFSException

modifiedClickTextItem

protected void modifiedClickTextItem(MouseModifiers mbuttons,
                                     GuiSubitemTestObject guiObj,
                                     java.lang.String param)
                              throws SAFSException

Purpose: click with various mouse buttons active

Throws:
SAFSException

modifiedDoubleClickTextItem

protected void modifiedDoubleClickTextItem(MouseModifiers mbuttons,
                                           GuiSubitemTestObject guiObj,
                                           java.lang.String param)
                                    throws SAFSException

Purpose: activateUnverifiedTextItem

Throws:
SAFSException

captureItemsToFile

protected void captureItemsToFile()
                           throws SAFSException

Purpose: captureItemsToFile

example step commands:


T, JavaWin, JList, CaptureItemsToFile, AFileName.txt
Capture all items of JList to file AFileName.txt

Throws:
SAFSException

SetListContains

protected void SetListContains(GuiSubitemTestObject guiObj,
                               java.lang.String param,
                               java.util.Iterator piter)
                        throws SAFSException

Purpose: repeatly access each list-item of guiObj to see if its substring matches target string param. Used by keyword SetListContains.

Parameters:
guiObj - stands for JList, Html.SELECT or .NET list
param - target string
piter - Iterator in which first item is case-sensitivity.
Throws:
SAFSException

VerifyListContains

protected void VerifyListContains(GuiSubitemTestObject guiObj,
                                  java.lang.String param,
                                  java.util.Iterator piter,
                                  boolean exact)

Purpose: respond to VERIFYLISTCONTAINS and VERIFYLISCONTAINSPARTIALMATCH.

Parameters:
guiObj - stands for JList or Html.SELECT
param - target string
piter - Iterator in which first item is case-sensitivity.
exact - true means exactly matching the target string; false means partially matching.

VerifyListNotContain

protected void VerifyListNotContain(GuiSubitemTestObject guiObj,
                                    java.lang.String param,
                                    java.util.Iterator piter,
                                    boolean exact)

Purpose: respond to VERIFYLISDOESNOTCONTAINMATCH and VERIFYLISDOESNOTCONTAINPARTIALMATCH

Parameters:
guiObj - stands for JList or Html.SELECT
param - target string
piter - Iterator in which first item is case-sensitivity.
exact - true means exactly matching the target string; false means partially matching.

captureObjectData

protected java.util.List captureObjectData(TestObject guiObj)
                                    throws SAFSException
Note: Need to modify this method if we want to support new application type, such as Flex application

Overrides:
captureObjectData in class CFComponent
Parameters:
guiObj - This is the reference to the List object (java or .net or other list)
Returns:
A list contains all items of a listbox
Throws:
SAFSException

searchForListItem

protected java.lang.String[] searchForListItem(GuiSubitemTestObject guiObj,
                                               java.lang.String param,
                                               boolean exact)
                                        throws SAFSException
Purpose: Search item in list

Parameters:
guiObj - A test object represents a list
param - An item text
exact - If true, the item will be matched exactly; otherwise, it will be matched partially.
Returns:
an array that contains the index and searchedItem
Throws:
SAFSException

performDoubleClick

protected java.lang.String performDoubleClick(GuiSubitemTestObject guiObj,
                                              java.lang.String param,
                                              boolean exact,
                                              MouseModifiers mbuttons)
                                       throws SAFSException
Purpose: Perform a double click on the item in a list Note: Should be called by function without verification, as this method will check the existence of item

Parameters:
guiObj - A test object represents a list
param - An item text
exact - If true, the item will be matched exactly; otherwise, it will be matched partially.
mbuttons - A mouse modifier like left, right click etc.
Returns:
String the matched item in the list
Throws:
SAFSException

scrollToIndex

protected boolean scrollToIndex(GuiSubitemTestObject guiObj,
                                int index)
Note: Scroll to the item to make it shown on screen so that click or select can be executed.

Parameters:
guiObj - A test object representing a list
index - The item index in the list

scrollToText

protected boolean scrollToText(GuiSubitemTestObject guiObj,
                               java.lang.String text)
Note: Scroll to the item to make it shown on screen so that click or select can be executed.

Parameters:
guiObj - A test object representing a list
text - The item in the list