public class AIMiscActions extends AIComponent
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
libComponent, MAX_TRY_DEFAULT, maxRetry, TYPE
_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 |
---|
AIMiscActions() |
Modifier and Type | Method and Description |
---|---|
void |
a_named_web_session_is_started_for_URL(java.lang.String id,
java.lang.String browser,
java.lang.String url)
Given a specific web session id, attempt to reconnect to that web session.
|
void |
abort_testing_on_item_not_found()
enables abort on find failure which aborts testing if certain actions fail.
|
void |
accept_partial_text_matches()
enables text substring matching when comparing text values.
|
void |
an_unnamed_web_session_is_started_for_URL(java.lang.String browser,
java.lang.String url)
Generate a new uniquely named web session for the browser type and URL.
|
void |
assign_variable(java.lang.String value,
java.lang.String variable)
Store a variable by SAFS Variable Service.
|
void |
close_the_browser_session(java.lang.String id)
Close/Quit the browser session with the given id.
|
void |
close_the_last_browser_session()
Close/Quit the currently active WebDriver session.
|
void |
continue_testing_on_item_not_found()
disables abort on find failure and allows testing to continue even when certain failures occur.
|
void |
deny_partial_text_matches()
disables text substring matching when comparing text values.
|
void |
do_not_wait_if_a_component_is_not_ready()
Set 0 seconds as the timeout to wait for a component's readiness, which means we don't
wait if a component is not ready.
|
void |
focus_on_embedded_iframe(java.lang.String frameRS)
Find and switchTo an embedded iframe, if present in the current RemoteDriver session.
|
void |
focus_on_first_embedded_iframe()
Find and switchTo an embedded iframe, if present in the current RemoteDriver session.
|
void |
logDetails(boolean on)
Turn on/off "log details" to improve the performance.
|
void |
release_embedded_iframe()
Switch the frame context back to the topmost document and set the 'bypassFrameReset'
to false so that the 'frame context' can be modified again.
|
void |
stop_using_cached_components()
Stop using cached components to improve the accuracy.
|
void |
the_titled_window_is_displayed(java.lang.String title)
Verifies a browser session with the requested title is present and, if so,
makes it the currently active session.
|
void |
using_cached_components()
Using cached components to improve the test performance.
|
void |
wait_seconds_if_a_component_is_not_ready(java.lang.Integer timeout)
Given a timeout (in seconds), set it as the timeout to wait for a component's readiness.
This method will firstly set the fields 'secsWaitForWindow' and 'secsWaitForComponent' of Processor .Then it will set the 'implicit wait' for selenium if a selenium session has been started. |
void |
wait_seconds_until_a_component_is_ready(java.lang.Integer timeout) |
checkForCoord, clearHighlight, doSetText, generateCriteria, generateCriteria, getComponentRectangle, getType, highlight, ignoreCache, initComponent, localProcess, process, process, process, setText
addNonRepeatedElements, convertElementArrayToList, deduceBenchFile, deduceDiffFile, deduceProjectFile, deduceTestFile, findElementInParent, findElements, 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
@Given(value="we continue testing if an item is not found") public void continue_testing_on_item_not_found()
Cucumber Expression: "we continue testing if an item is not found"
Examples invocations:
Given we continue testing if an item is not found
Or
And we continue testing if an item is not found
Or
But we continue testing if an item is not found
abort_testing_on_item_not_found()
@Given(value="we abort testing if an item is not found") public void abort_testing_on_item_not_found()
Cucumber Expression: "we abort testing if an item is not found"
Examples invocations:
Given we abort testing if an item is not found
Or
And we abort testing if an item is not found
Or
But we abort testing if an item is not found
continue_testing_on_item_not_found()
@Given(value="we can accept partial text matches") public void accept_partial_text_matches()
Cucumber Expression: "we can accept partial text matches"
Examples invocations:
Given we can accept partial text matches
Or
And we can accept partial text matches
Or
But we can accept partial text matches
deny_partial_text_matches()
@Given(value="we cannot accept partial text matches") public void deny_partial_text_matches()
Cucumber Expression: "we cannot accept partial text matches"
Examples invocations:
Given we cannot accept partial text matches
Or
And we cannot accept partial text matches
Or
But we cannot accept partial text matches
accept_partial_text_matches()
@Given(value="testing should focus on the embedded iframe") public void focus_on_first_embedded_iframe()
Cucumber Expression: "testing should focus on the embedded iframe"
Examples invocations:
Given testing should focus on the embedded iframe
Or
And testing should focus on the embedded iframe
Or
But testing should focus on the embedded iframe
@Given(value="testing should focus on the embedded iframe {var_mapitem_or_string}") public void focus_on_embedded_iframe(java.lang.String frameRS)
Cucumber Expression: "testing should focus on the embedded iframe {var_mapitem_or_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
Examples invocations:
frameRS
- String, the string to find frame to focus. It can be
AISearchBase.initializeFrames(WebDriver)
,
release_embedded_iframe()
@Given(value="release the focused embedded iframe") public void release_embedded_iframe()
Cucumber Expression: "release the focused embedded iframe"
Examples invocations:
Given release the focused embedded iframe
Or
And release the focused embedded iframe
Or
But release the focused embedded iframe
focus_on_embedded_iframe(String)
@Given(value="a {var_or_string} session is started for URL {var_or_string}") public void an_unnamed_web_session_is_started_for_URL(java.lang.String browser, java.lang.String url) throws SAFSException
Cucumber Expression: "a {var_or_string} session is started for URL {var_or_string}"
{var_or_string} Matches TypeRegistryConfiguration.REGEX_VAR_OR_STRING
, represents a variable name (with an optional leading symbol ^) or a double-quoted-string or a single-quoted-string, such as browserName, _browserName, ^browserName, "chrome", 'firefox' etc.
The variable will be resolved as "SAFS variable", if not found then it is returned as itself.
Examples invocations:
browser
- String, the browser's name, such as "chrome", "firefox" etc.url
- String, the URL to openSAFSObjectNotFoundException
- if abort on find failure is enabled and the session is not started.SAFSException
a_named_web_session_is_started_for_URL(String, String, String)
,
close_the_last_browser_session()
,
abort_testing_on_item_not_found()
,
continue_testing_on_item_not_found()
@Given(value="a {var_or_string} {var} session is started for URL {var_or_string}") public void a_named_web_session_is_started_for_URL(java.lang.String id, java.lang.String browser, java.lang.String url) throws SAFSException
Cucumber Expression: "a {var_or_string} {var} session is started for URL {var_or_string}"
{var_or_string} Matches TypeRegistryConfiguration.REGEX_VAR_OR_STRING
, represents a variable name (with an optional leading symbol ^) or a double-quoted-string or a single-quoted-string.
{var} Matches TypeRegistryConfiguration.REGEX_VAR
, represents a variable name (with an optional leading symbol ^), such as browserName, _browserName, ^browserName etc.
It will be resolved as "SAFS variable", if not found then it is returned as itself.
Examples invocations:
If the SeleniumServer is not already running, this routine will attempt to start it using the normal StartWebBrowser invocation.
id
- String, Unique application/browser ID.browser
- String, the browser's name, such as "chrome", "firefox" etc.url
- String, the URL to openSAFSObjectNotFoundException
- if abort on find failure is enabled and the session is not found or started.SAFSException
SeleniumPlus.StartWebBrowser(String, String, String...)
,
an_unnamed_web_session_is_started_for_URL(String, String)
,
close_the_browser_session(String)
,
abort_testing_on_item_not_found()
,
continue_testing_on_item_not_found()
@Given(value="the {var_or_string} window is displayed") public void the_titled_window_is_displayed(java.lang.String title) throws SAFSException
Cucumber Expression: "the {var_or_string} window is displayed"
{var_or_string} Matches TypeRegistryConfiguration.REGEX_VAR_OR_STRING
, represents a variable name (with an optional leading symbol ^) or a double-quoted-string or a single-quoted-string.
Examples invocations:
The routine will seek out or wait for the titled session up to the current waitForWindow timeout setting.
title
- SAFSObjectNotFoundException
- if abort on find failure is enabled and the matching browser is not found.SAFSException
accept_partial_text_matches()
,
deny_partial_text_matches()
,
Processor.getSecsWaitForWindow()
,
Processor.setSecsWaitForWindow(int)
,
abort_testing_on_item_not_found()
,
continue_testing_on_item_not_found()
@Then(value="close the {var_or_string} browser session") public void close_the_browser_session(java.lang.String id) throws SAFSException
Cucumber Expression: "close the {var_or_string} browser session"
{var_or_string} Matches TypeRegistryConfiguration.REGEX_VAR_OR_STRING
, represents a variable name (with an optional leading symbol ^) or a double-quoted-string or a single-quoted-string.
Examples invocations:
SAFSObjectNotFoundException
- if abort on find failure is enabled and the session is not found and closed.SAFSException
a_named_web_session_is_started_for_URL(String, String, String)
,
abort_testing_on_item_not_found()
,
continue_testing_on_item_not_found()
@Then(value="close the browser session") public void close_the_last_browser_session() throws SAFSException
Cucumber Expression: "close the browser session"
Examples invocations:
Then close the browser session
Or
And close the browser session
SAFSObjectNotFoundException
- if abort on find failure is enabled and no session was found to close.SAFSException
an_unnamed_web_session_is_started_for_URL(String, String)
,
abort_testing_on_item_not_found()
,
continue_testing_on_item_not_found()
@Given(value="wait {int} seconds until a component is ready") public void wait_seconds_until_a_component_is_ready(java.lang.Integer timeout)
@Given(value="wait {int} seconds if a component is not ready") public void wait_seconds_if_a_component_is_not_ready(java.lang.Integer timeout)
Processor
.
Cucumber Expression: "wait {int} seconds if a component is not ready"
Examples invocations:
Given a "SAPDemoID" chrome session is started for URL "http://www.google.com"
And wait 0 seconds if a component is not ready
Given wait 10 seconds if a component is not ready
Then click the "Allow Multiple Select" checkbox
Then verify "allow multiple selection" is displayed
timeout
- WDTimeOut#implicitlyWait(long, TimeUnit)
,
do_not_wait_if_a_component_is_not_ready()
,
Processor.setSecsWaitForComponent(int)
,
Processor.setSecsWaitForWindow(int)
@Given(value="do not wait if a component is not ready") public void do_not_wait_if_a_component_is_not_ready()
Cucumber Expression: "do not wait if a component is not ready"
Examples invocations:
Given a "SAPDemoID" chrome session is started for URL "http://www.google.com"
And do not wait if a component is not ready
Given do not wait if a component is not ready
Then click the "Allow Multiple Select" checkbox
Then verify "allow multiple selection" is displayed
WDTimeOut#implicitlyWait(long, TimeUnit)
,
wait_seconds_if_a_component_is_not_ready(Integer)
@Given(value="assign {string} to {word}") public void assign_variable(java.lang.String value, java.lang.String variable)
Cucumber Expression: "assign {string} to {word}"
Example Scenario Step:
value
- String, the value to be assignedvariable
- String, the name of the variable@Given(value="using cached components") public void using_cached_components()
Cucumber Expression: "using cached components"
Examples invocations:
Given using cached components
stop_using_cached_components()
@Given(value="stop using cached components") public void stop_using_cached_components()
Cucumber Expression: "stop using cached components"
Examples invocations:
Given stop using cached components
using_cached_components()
@Given(value="log details {boolean}") public void logDetails(boolean on)
Cucumber Expression: "log details {boolean}"
Examples invocations:
Given log details on
Given log details off
Copyright © SAS Institute. All Rights Reserved.