public class AIEditBoxActions extends AIComponent
Criteria
.
Future support needs to include identifying the textfield by its @aria-labelledby or @for (or equivalent) attributes and finding the text label associated with the text field that contains the matching label text.
SeleniumPlus.Assert, SeleniumPlus.CheckBox, SeleniumPlus.ComboBox, SeleniumPlus.Component, SeleniumPlus.Counters, SeleniumPlus.EditBox, SeleniumPlus.Files, SeleniumPlus.ListView, SeleniumPlus.Logging, SeleniumPlus.Menu, SeleniumPlus.Misc, SeleniumPlus.Rest, SeleniumPlus.ScrollBar, SeleniumPlus.Strings, SeleniumPlus.TabControl, SeleniumPlus.Tree, SeleniumPlus.WDTimeOut, SeleniumPlus.Window
SAFSPlus.DriverCommand
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
_editbox_elements_xpath |
protected static java.util.List<java.lang.String> |
_editbox_map |
protected EditBox |
editbox |
static java.lang.String |
TYPE
"EditBox"
|
libComponent, MAX_TRY_DEFAULT, maxRetry
_abort_on_assert_failure, _abort_on_find_failure, _case_does_not_matter, _log_details, _substring_matches_allowed, _using_cached_component, cachedLibComponents, DEFAULT_SEPLUS_AI_DEFINITIONS, frames, frameTree, GLUE_OPT, searchContext
PRODUCT_DESCRIPTION, PRODUCT_NAME, PRODUCT_VERSION, Runner, TEMP_SELENIUM_PLUS_RS_VAR
_autorun, _autorunClassProvided, _injectDataAwareness, _isInjected, _isSPC, _junit, allowExit, ARG_AUTORUN, ARG_AUTORUN_CLASS, ARG_JUNIT, ARG_SAFSVAR, DefaultRunner, exitCode, normalizeTextForInput, prevResults, RELATIVE_TO_PARENT, RELATIVE_TO_SCREEN, springApplicationContext
Constructor and Description |
---|
AIEditBoxActions() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<org.openqa.selenium.WebElement> |
findElements(Criteria criteria)
Find the WebElements according to the search Criteria.
In this method we firstly find the WebElements by SeleniumPlus-Library (the frame may get switched if the RS containing information about frame). In not found, we try to find WebElements in AI way, Criteria's component RS will be treated as the anchor-label to search components around. |
org.openqa.selenium.WebElement |
findTextFieldFromClass(java.lang.String textlabel)
Not yet fully functional.
|
org.openqa.selenium.WebElement |
findTextFieldFromLabel(java.lang.String textlabel)
Find an EditBox-type field that is associated with the provided textlabel in some way.
Possible matches can be a TEXTAREA or INPUT tag with a 'placeholder' attribute, or any type of tag with an 'aria-placeholder' attribute, with the attribute value matching the provided textlabel. We can also match on a field if the provided textlabel matches the contents (value) of the field. We can also match on a field if the provided textlabel matches the label-component around the text-field. This routine does not yet support partial text matching, but it probably should once fully evaluated. If the editbox is not found, we will attempt to look in a child iframe, if present. |
java.util.List<org.openqa.selenium.WebElement> |
findTextFieldsFromLabel(java.lang.String textlabel)
Find all EditBox-type fields that are associated with the provided textlabel in some way.
Possible matches can be a TEXTAREA or INPUT tag with a 'placeholder' attribute, or any type of tag with an 'aria-placeholder' attribute, with the attribute value matching the provided textlabel. We can also match on a field if the provided textlabel matches the contents (value) of the field. We can also match on a field if the provided textlabel matches the label-component around the text-field. This routine does not yet support partial text matching, but it probably should once fully evaluated. We will try to search in the current frame if 'bypass frame reset' is set to true, otherwise we search in each frame. If the editbox is not found, we will attempt to find the editbox with label matched the 'textlabel' parameter. |
protected java.lang.String |
getType() |
protected void |
initComponent(org.openqa.selenium.WebElement we) |
protected static void |
loadEditBoxMap() |
protected void |
localProcess(java.lang.String action,
java.util.List<java.lang.String> parameters)
Handle the specific keywords against a specific component.
|
void |
type_in_editbox(java.lang.String action,
java.lang.String contents,
java.lang.String criteria,
java.lang.String type)
Handle the EditBoxFunctions against the text-field matching the provided textlabel.
Some actions (such as typekeys, SetTextValue, SetUnverifiedTextValue) can handle special keys |
checkForCoord, clearHighlight, doSetText, generateCriteria, generateCriteria, getComponentRectangle, highlight, ignoreCache, process, process, process, setText
addNonRepeatedElements, convertElementArrayToList, deduceBenchFile, deduceDiffFile, deduceProjectFile, deduceTestFile, findElementInParent, findElementsInParent, findSelectableItemFromText, getCachedLibComponent, getFirstIFrame, getXpathType, initializeFrames, logElementIdInfo, logElementProperties, logListElementsInfo, logMapKeyValues, main, matched, resetFrames, runCukesTest, runCukesTest, runCukesTest, runTest, saveCachedLibComponent
AbortTest, AltLeftDrag, Click, ClickUnverified, CtrlAltLeftDrag, CtrlClick, CtrlLeftDrag, CtrlRightClick, CtrlShiftLeftDrag, deduceFilterAreas, DoubleClick, executeAsyncScript, ExecuteScript, executeScript, GetGUIImage, GetGUIImage, getObject, getObject, GetVariableValue, Highlight, HoverScreenLocation, LeftDrag, Pause, PrintTestCaseSummary, PrintTestSuiteSummary, RightClick, RightDrag, SetVariableValue, ShiftClick, ShiftLeftDrag, StartTestCase, StartTestSuite, StartWebBrowser, StopTestCase, StopWebBrowser, SwitchWebBrowser, TypeChars, TypeEncryption, TypeKeys, VerifyBinaryFileToFile, VerifyFileToFile, VerifyGUIImageToFile, VerifyTextFileToFile, VerifyValueContains, VerifyValueContainsIgnoreCase, VerifyValueDoesNotContain, VerifyValues, VerifyValuesIgnoreCase, VerifyValuesNotEqual, WaitForGUI, WebDriver
_getMappedValue, _getVariable, _processArgs, _resolveDDVariables, _setVariable, action, actionGUILess, autorun, back, combineParams, command, debug, error, forward, getAllowExit, getExitCode, getRunner, iDriver, normalizeTextForInput, quote, quotePath, replaceSeparator, setAllowExit, setExitCode, setLeveledTest, setNormalizeTextForInput, setRunner, testStatusCode
public static final java.lang.String TYPE
protected EditBox editbox
protected static java.util.List<java.lang.String> _editbox_map
protected static java.lang.String _editbox_elements_xpath
protected void initComponent(org.openqa.selenium.WebElement we) throws SeleniumPlusException
initComponent
in class AIComponent
SeleniumPlusException
protected java.lang.String getType()
getType
in class AIComponent
protected java.util.List<org.openqa.selenium.WebElement> findElements(Criteria criteria)
AISearchBase
findElements
in class AISearchBase
criteria
- Criteria, the conditions helping to find elementsprotected void localProcess(java.lang.String action, java.util.List<java.lang.String> parameters) throws SAFSException
AIComponent
localProcess
in class AIComponent
action
- String, the action to performparameters
- ListSAFSException
- if target object cannot be found, or the action is not supported, or any exception has been met.public java.util.List<org.openqa.selenium.WebElement> findTextFieldsFromLabel(java.lang.String textlabel)
textlabel
- -- placeholder text or displayed text value or the label (associated with EditBox) to match against.public org.openqa.selenium.WebElement findTextFieldFromLabel(java.lang.String textlabel)
textlabel
- -- placeholder text or displayed text value to match against.protected static void loadEditBoxMap() throws SAFSObjectRecognitionException
SAFSObjectRecognitionException
public org.openqa.selenium.WebElement findTextFieldFromClass(java.lang.String textlabel) throws SAFSException
textlabel
- SAFSException
@Then(value="{editbox_action} {var_or_string} in the {var_mapitem_or_string} {editbox}") public void type_in_editbox(java.lang.String action, java.lang.String contents, java.lang.String criteria, java.lang.String type) throws SAFSException
Cucumber Expression: "{editbox_action} {var_or_string} in the {mapitem_or_string} {editbox}"
{checkbox_action} Matches TypeRegistryConfiguration.REGEX_EDITBOX_ACTION
{var_or_string} represents a variable name (with an optional leading symbol ^) or a double-quoted-string or a single-quoted-string.
{var_mapitem_or_string} Matches TypeRegistryConfiguration.REGEX_VAR_MAPITEM_OR_STRING
,
represents a variable, or a map item, such as mapID:section.item or a double-quoted-string or a single-quoted-string.
It will be parsed by TypeRegistryConfiguration
{editbox} Matches possible names referring to an "editbox", TypeRegistryConfiguration.REGEX_EDITBOX
Examples invocations:
- Then type "My Search Query" in the "Search" field
- And type "MyUserID" in the "UserId" box
- But type "Something Else" in the "Comment" textfield
- Then typechars "to delete things" in the "TextArea" textarea
- Then typekeys "^a{Delete}" in the "TextArea" textarea
- Then SetTextCharacters "+(Hello World) {a 10}" in the "TextArea" editbox
- Then SetTextValue "+(Hello World) {a 10}" in the "TextArea" editbox
- Then SetUnverifiedTextCharacters "+(Hello World)" in the "TextArea" textarea
- Then SetUnverifiedTextValue "+(Hello World)" in the "TextArea" textarea
- type something into the text-field identified by the value of map item SapDemoApp:SAPDemoPageAI.TextArea
== SapDemoApp.map file =========
[SAPDemoPageAI]
TextArea="TextArea"
================================
Then type "My Search Query" in the SapDemoApp:SAPDemoPageAI.TextArea field
action
- String, the action to perform. It should be one of TypeRegistryConfiguration.REGEX_EDITBOX_ACTION
.contents
- String, the characters/keys to inputcriteria
- String, the search-conditions helping to find the EditBoxtype
- String, the possible name referring to an "editbox"SAFSObjectNotFoundException
- if the item is not found and abort on find failure is enabled.SAFSException
AIMiscActions.abort_testing_on_item_not_found()
,
AIMiscActions.continue_testing_on_item_not_found()
,
AIComponent.process(String, String, int, List)
Copyright © SAS Institute. All Rights Reserved.