public class Component extends DefaultRefreshable implements IWebAccessibleInternetRole, IOperable
Modifier and Type | Field and Description |
---|---|
protected boolean |
accessible
indicate if this component follows the rules of 'Accessible Rich Internet Applications'
|
protected IOperable |
anOperableObject
Represents an object can be operated.
|
static java.lang.String |
ATTRIBUTE_CLASS
'class' a standard html attribute
|
static java.lang.String |
ATTRIBUTE_DIJITPOPUPPARENT
'dijitpopupparent' attribute used by dojo
|
static java.lang.String |
ATTRIBUTE_ID
'id' a standard html attribute
|
static java.lang.String |
ATTRIBUTE_INDEX
'index' a html attribute
|
static java.lang.String |
ATTRIBUTE_MULTIPLE
'multiple' a html attribute
|
static java.lang.String |
ATTRIBUTE_NAME
'name' a standard html attribute
|
static java.lang.String |
ATTRIBUTE_TEXT
'text' a common html attribute
|
static java.lang.String |
ATTRIBUTE_TYPE
'type' a standard html attribute
|
static java.lang.String |
ATTRIBUTE_VALUE
'value' a standard html attribute
|
static java.lang.String |
ATTRIBUTE_VISIBILITY
'visibility' a html attribute
|
static java.lang.String |
ATTRIBUTE_WIDGETID
'widgetid' attribute used by dojo
|
protected int |
delayGetContent
The delay (milliseconds) before getting content from this Component.
|
protected java.lang.String |
dijitpopupparent
dijitpopupparent is an attribute of the html-dojo popup object for this web element
its value is the id of the dojo object to which this popup is related, it may be null
|
protected java.util.Map<org.openqa.selenium.WebElement,IOperable> |
operableObjects
A cache containing IOperable objects for a certain WebElement.
|
static java.lang.String |
TAG_HTML_INPUT
'input' a standard html tag
|
static java.lang.String |
TAG_HTML_SELECT
'select' a standard html tag
|
static java.lang.String |
VALUE_CHECKBOX_ATTRIBUTE_TYPE
'checkbox' a value for standard html attribute 'type'
|
static java.lang.String |
VALUE_PASSWORD_ATTRIBUTE_TYPE
'password' a value for standard html attribute 'type'
|
static java.lang.String |
VALUE_RADIO_ATTRIBUTE_TYPE
'radio' a value for standard html attribute 'type'
|
static java.lang.String |
VALUE_SUBMIT_ATTRIBUTE_TYPE
'submit' a value for standard html attribute 'type'
|
static java.lang.String |
VALUE_TEXT_ATTRIBUTE_TYPE
'text' a value for standard html attribute 'type'
|
static java.lang.String |
VALUE_VISIBILITY_HIDDEN
value 'hidden' for 'visibility' attribute
|
static java.lang.String |
VALUE_VISIBILITY_VISIBLE
value 'visible' for 'visibility' attribute
|
protected java.lang.String |
waiRole
attribute 'role' of 'Accessible Rich Internet Applications'
|
protected java.lang.String |
widgetid
widgetid is the html-dojo object id for this web element, it may be null
|
cssClass, id, map, object, possibleRecognitionStrings, searchContext, tagName, webelement
ATTRIBUTE_ARIA_ACTIVEDDESCENDANT, ATTRIBUTE_ARIA_ATOMIC, ATTRIBUTE_ARIA_AUTOCOMPLETE, ATTRIBUTE_ARIA_BUSY, ATTRIBUTE_ARIA_CHECKED, ATTRIBUTE_ARIA_CONTROLS, ATTRIBUTE_ARIA_DESCRIBEDBY, ATTRIBUTE_ARIA_DISABLED, ATTRIBUTE_ARIA_DRIPEFFECT, ATTRIBUTE_ARIA_EXPANDED, ATTRIBUTE_ARIA_FLOWTO, ATTRIBUTE_ARIA_GRABBED, ATTRIBUTE_ARIA_HASPOPUP, ATTRIBUTE_ARIA_HIDDEN, ATTRIBUTE_ARIA_INVALID, ATTRIBUTE_ARIA_LABEL, ATTRIBUTE_ARIA_LABELDEBY, ATTRIBUTE_ARIA_LEVEL, ATTRIBUTE_ARIA_LIVE, ATTRIBUTE_ARIA_MULTISELECTABLE, ATTRIBUTE_ARIA_ORIENTATION, ATTRIBUTE_ARIA_OWNS, ATTRIBUTE_ARIA_POSINSET, ATTRIBUTE_ARIA_PRESSED, ATTRIBUTE_ARIA_READONLY, ATTRIBUTE_ARIA_RELEVANT, ATTRIBUTE_ARIA_REQUIRED, ATTRIBUTE_ARIA_SELECTED, ATTRIBUTE_ARIA_SETSIZE, ATTRIBUTE_ARIA_SORT, ATTRIBUTE_ARIA_VALUEMAX, ATTRIBUTE_ARIA_VALUEMIN, ATTRIBUTE_ARIA_VALUENOW, ATTRIBUTE_ARIA_VALUETEXT, ATTRIBUTE_WAI_ROLE, WAI_ROLE_ALERT, WAI_ROLE_ALERTDIALOG, WAI_ROLE_APPLICATION, WAI_ROLE_ARTICLE, WAI_ROLE_BANNER, WAI_ROLE_BUTTON, WAI_ROLE_CHECKBOX, WAI_ROLE_COLUMNHEADER, WAI_ROLE_COMBOBOX, WAI_ROLE_COMPLEMENTARY, WAI_ROLE_CONTENTINFO, WAI_ROLE_DEFINITION, WAI_ROLE_DIALOG, WAI_ROLE_DIRECTORY, WAI_ROLE_DOCUMENT, WAI_ROLE_FORM, WAI_ROLE_GRID, WAI_ROLE_GRIDCELL, WAI_ROLE_GROUP, WAI_ROLE_HEADING, WAI_ROLE_IMG, WAI_ROLE_LINK, WAI_ROLE_LIST, WAI_ROLE_LISTBOX, WAI_ROLE_LISTITEM, WAI_ROLE_LOG, WAI_ROLE_MAIN, WAI_ROLE_MARQUEE, WAI_ROLE_MATH, WAI_ROLE_MENU, WAI_ROLE_MENUBAR, WAI_ROLE_MENUITEM, WAI_ROLE_MENUITEMCHECKBOX, WAI_ROLE_MENUITEMRADIO, WAI_ROLE_NAVIGATION, WAI_ROLE_NOTE, WAI_ROLE_OPTION, WAI_ROLE_PRESENTATION, WAI_ROLE_PROGRESSBAR, WAI_ROLE_RADIO, WAI_ROLE_RADIOGROUP, WAI_ROLE_REGION, WAI_ROLE_ROW, WAI_ROLE_ROWGROUP, WAI_ROLE_ROWHEADER, WAI_ROLE_SCROLLBAR, WAI_ROLE_SEARCH, WAI_ROLE_SEPARATOR, WAI_ROLE_SLIDER, WAI_ROLE_SPINBUTTON, WAI_ROLE_STATUS, WAI_ROLE_TAB, WAI_ROLE_TABLIST, WAI_ROLE_TABPANEL, WAI_ROLE_TEXTBOX, WAI_ROLE_TIMER, WAI_ROLE_TOOLBAR, WAI_ROLE_TOOLTIP, WAI_ROLE_TREE, WAI_ROLE_TREEGRID, WAI_ROLE_TREEITEM
Modifier | Constructor and Description |
---|---|
protected |
Component() |
|
Component(org.openqa.selenium.WebElement component) |
Modifier and Type | Method and Description |
---|---|
protected void |
castOperable()
Cast the IOperable object to the specific one.
The subclasses will override this method as they know what specific Operable to use. Here a void implementation is given, as not all subclass need the specific Operable, such as EditBox. Cast may throw Exception, we should catch it if calling this method. This method should be called after anOperableObject has been initialized. |
void |
clearCache()
Clear the cache 'operableObjects'.
Also clear the cache associated with the IOperable objects. |
void |
clearComponentBox(java.lang.String libName)
Purpose: Remove the content from Component Box, like Edit Box, Combo box.
|
protected IOperable |
createDefaultOperable()
Create the default IOperable object for a certain specific component.
It is different from the createGenericOperable() , which will provide an IOperableto support the minimal generic functionalities, like GetGUIImage, Click, HoverMouse etc. Subclass COULD override this method to provide a default backup IOperable when other ways fail to create IOperable. |
protected IOperable |
createDOJOOperable()
Create the IOperable object for DOJO domain.
Subclass SHOULD override this method if DOJO will be supported. |
protected IOperable |
createGenericOperable()
Create the generic IOperable object to support the minimal generic functionalities, like GetGUIImage, Click, HoverMouse etc.
This generic IOperable will be used if no other specific IOperable is available. Normally, subclass should NOT override this method. |
protected IOperable |
createHTMLOperable()
Create the IOperable object for HTML domain.
Subclass SHOULD override this method if HTML will be supported. |
protected IOperable |
createOperable(org.openqa.selenium.WebElement webelement)
Create a IOperable object according to 'webelement'.
User could to override this method to provide an IOperable object, but mostly user should override createDOJOOperable() , createGenericOperable() , createHTMLOperable() and createSAPOperable() to provide specific IOperable of certain domain. |
protected IOperable |
createSAPOperable()
Create the IOperable object for SAP domain.
Subclass SHOULD override this method if SAP will be supported. |
protected boolean |
doubleCheckVerification(java.lang.String libName,
java.lang.String expectedText)
Copy the Component box's value to clipboard and compare the clipboard's value with the text we try to input.
|
java.lang.String |
getDijitpopupparent() |
Element |
getMatchedElement(TextMatchingCriterion criterion)
According to a certain 'search condition', get the matched subitem within this Component.
This method just return a null. |
java.lang.String |
getValue()
Get the contents of Component Box, like Edit Box, Combo Box.
|
java.lang.String |
getWaiRole() |
java.lang.String |
getWidgetid() |
void |
initialize(org.openqa.selenium.WebElement component)
According to WebElement, initialize necessary resources including 'embedded object', 'attribute'
and 'operable object' etc. |
void |
inputChars(java.lang.String keystrokes) |
void |
inputComponentBoxChars(java.lang.String libName,
java.lang.String text)
Purpose: Set the text as the content of Component Box.
|
void |
inputComponentBoxKeys(java.lang.String libName,
java.lang.String text)
Purpose: Set the text as the content of Component Box.
|
void |
inputKeys(java.lang.String keystrokes)
Does NOT clear any existing text in the control, but does attempt to insure the window/control has focus.
|
boolean |
isAccessible() |
protected boolean |
permitInvisible(org.openqa.selenium.WebElement component)
This method will decide if the invisible web element is permitted to be operated.
Subclass could override this method to provide the detail implementation. |
void |
setDijitpopupparent(java.lang.String dijitpopupparent) |
boolean |
setFocus()
Purpose: setFocus |
void |
setWidgetid(java.lang.String widgetid) |
protected void |
updateFields()
set/update the class's local fields through the underlying WebElement.
Especially after calling DefaultRefreshable.refresh(boolean) , the underlying WebElement may have beenrefreshed, and the associated attributes may have different value, it is recommended to call this method to update the class's local field. |
boolean |
verifyComponentBox(java.lang.String libName,
java.lang.String expectedText)
Purpose: Compare the contents of Component box to the original text.
If they are same, return true; otherwise, return false. |
getAttribute, getCssClass, getEmbeddedObject, getId, getMap, getPossibleRecognitionStrings, getSearchContext, getTagName, getWebElement, initialize, refresh, setCssClass, setId, setPossibleRecognitionStrings, setSearchContext, setTagName, setWebElement
public static final java.lang.String ATTRIBUTE_ID
public static final java.lang.String ATTRIBUTE_NAME
public static final java.lang.String ATTRIBUTE_CLASS
public static final java.lang.String ATTRIBUTE_VALUE
public static final java.lang.String ATTRIBUTE_TEXT
public static final java.lang.String ATTRIBUTE_MULTIPLE
public static final java.lang.String ATTRIBUTE_INDEX
public static final java.lang.String ATTRIBUTE_VISIBILITY
public static final java.lang.String VALUE_VISIBILITY_HIDDEN
public static final java.lang.String VALUE_VISIBILITY_VISIBLE
public static final java.lang.String ATTRIBUTE_TYPE
public static final java.lang.String VALUE_TEXT_ATTRIBUTE_TYPE
public static final java.lang.String VALUE_PASSWORD_ATTRIBUTE_TYPE
public static final java.lang.String VALUE_RADIO_ATTRIBUTE_TYPE
public static final java.lang.String VALUE_CHECKBOX_ATTRIBUTE_TYPE
public static final java.lang.String VALUE_SUBMIT_ATTRIBUTE_TYPE
public static final java.lang.String TAG_HTML_SELECT
public static final java.lang.String TAG_HTML_INPUT
public static final java.lang.String ATTRIBUTE_WIDGETID
public static final java.lang.String ATTRIBUTE_DIJITPOPUPPARENT
protected java.lang.String widgetid
protected java.lang.String dijitpopupparent
protected java.lang.String waiRole
protected boolean accessible
protected IOperable anOperableObject
protected java.util.Map<org.openqa.selenium.WebElement,IOperable> operableObjects
protected int delayGetContent
protected Component()
public Component(org.openqa.selenium.WebElement component) throws SeleniumPlusException
component
- WebElement the component to operate.SeleniumPlusException
- if the component is null or is not visiblepublic void initialize(org.openqa.selenium.WebElement component) throws SeleniumPlusException
DefaultRefreshable.initialize(Object)
will be called toDefaultRefreshable.initialize(Object)
, in the subclass, DefaultRefreshable.initialize(Object)
.component
- WebElement, the embedded WebElement object.SeleniumPlusException
- if the component is null or is not visible,
or if no appropriate IOperable instance can be got#initialize(Object)}
protected boolean permitInvisible(org.openqa.selenium.WebElement component)
component
- WebElement the component to checkinitialize(WebElement)
protected void updateFields()
DefaultRefreshable
DefaultRefreshable.refresh(boolean)
, the underlying WebElement may have beenupdateFields
in class DefaultRefreshable
DefaultRefreshable.refresh(boolean)
protected void castOperable()
anOperableObject
has been initialized.anOperableObject
,
updateFields()
protected IOperable createOperable(org.openqa.selenium.WebElement webelement)
createDOJOOperable()
, createGenericOperable()
, createHTMLOperable()
and createSAPOperable()
to provide specific webelement
- WebElement, from which the IOperable object will be createdcreateDOJOOperable()
,
createGenericOperable()
,
createHTMLOperable()
,
createSAPOperable()
protected IOperable createDOJOOperable()
createOperable(WebElement)
protected IOperable createSAPOperable()
createOperable(WebElement)
protected IOperable createHTMLOperable()
createOperable(WebElement)
protected IOperable createDefaultOperable()
createGenericOperable()
, which will provide an IOperableprotected IOperable createGenericOperable()
public void clearCache()
clearCache
in interface IOperable
public boolean isAccessible()
public java.lang.String getWaiRole()
public java.lang.String getWidgetid()
public void setWidgetid(java.lang.String widgetid)
public java.lang.String getDijitpopupparent()
public void setDijitpopupparent(java.lang.String dijitpopupparent)
public boolean setFocus() throws SeleniumPlusException
SeleniumPlusException
- if we are unable to process the keystrokes successfully.Robot.inputKeys(String)
public void inputKeys(java.lang.String keystrokes) throws SeleniumPlusException
SeleniumPlusException
- if we are unable to process the keystrokes successfully.Robot.inputKeys(String)
public void inputChars(java.lang.String keystrokes) throws SeleniumPlusException
SeleniumPlusException
public Element getMatchedElement(TextMatchingCriterion criterion) throws SeleniumPlusException
criterion
- TextMatchingCriterion, the search conditionSeleniumPlusException
public void clearComponentBox(java.lang.String libName) throws SeleniumPlusException
libName
- String, the concrete Component name of class, which calls 'clearComponentBox()' method,
like 'EditBox', 'ComboBox'.SeleniumPlusException
public void inputComponentBoxChars(java.lang.String libName, java.lang.String text) throws SeleniumPlusException
libName
- String, the concrete Component name of class, which calls 'inputComponentBoxChars()' method,
like 'EditBox', 'ComboBox'.text
- String, the content to be entered into Component box.SeleniumPlusException
public void inputComponentBoxKeys(java.lang.String libName, java.lang.String text) throws SeleniumPlusException
libName
- String, the concrete Component name of class, which calls 'inputComponentBoxKeys()' method,
like 'EditBox', 'ComboBox'.text
- String, the content to be entered into Component box.SeleniumPlusException
public java.lang.String getValue()
verifyComponentBox(String, String)
protected boolean doubleCheckVerification(java.lang.String libName, java.lang.String expectedText)
libName
- String, the concrete Component name of class, which calls 'doubleCheckVerification()' method,
like 'EditBox', 'ComboBox'.expectedText
- String, the text to verify with.public boolean verifyComponentBox(java.lang.String libName, java.lang.String expectedText)
libName
- String, the concrete Component name of class, which calls 'verifyComponentBox()' method,
like 'EditBox', 'ComboBox'.expectedText
- String, the text to to be compared to during verification.Copyright © SAS Institute. All Rights Reserved.