public static class SeleniumPlus.Misc extends SAFSPlus.Misc
SAFSPlus.Misc
and it provides more convenient wrapper APIs related to Selenium.SAFSPlus.Misc
is a sub-class of DriverCommand
.SAFSPlus.Misc
,
SAFSPlus.DriverCommand
Constructor and Description |
---|
Misc() |
Modifier and Type | Method and Description |
---|---|
static boolean |
AlertAccept(java.lang.String... optionals)
Accept (Clicking OK button) the Alert Dialog associated with a browser.
This command will wait 2 seconds by default for the presence of Alert. |
static boolean |
AlertDismiss(java.lang.String... optionals)
Dismiss (Clicking Cancel button) the Alert Dialog associated with a browser.
This command will wait 2 seconds by default for the presence of Alert. |
static int |
GetCheckAlertTimeout()
Get the current 'Check Alert Timeout' value.
|
static boolean |
IsAlertPresent(java.lang.String... optionals)
Test the presence of an Alert Dialog associated with a browser.
This command will wait 2 seconds by default for the presence of Alert. |
static void |
SetCheckAlertTimeout(int seconds)
Set the 'Check Alert Timeout'.
|
static boolean |
SetClickCapture(boolean on)
Turn on/off 'click capture'.
Note: Calling this will not write success/failure message into the test log. |
GetAppMapValue, GetAppMapValue, GetAppMapValue, GetMillisBetweenRecords, IsComponentExists, isExpressionsOn, ResolveExpression, SwitchWindow
AssignClipboardVariable, CallJUnit, CallRemote, CallScript, CallTestNG, CaptureMousePositionOnScreen, ClearAllVariables, ClearAppMapCache, ClearArrayVariables, ClearClipboard, CloseApplication, CloseApplicationMap, CopyVariableValueEx, Delay, DeleteNetworkConditions, Expressions, GetNetworkConditions, GetRegistryKeyValue, GetRegistryKeyValue, GetSystemDate, GetSystemDateTime, GetSystemTime, GetURL, Highlight, LaunchApplication, OnGUIExistsGotoBlockID, OnGUINotExistGotoBlockID, Pause, SaveClipboardToFile, SaveURLToFile, ScrollWheel, SendMail, SetApplicationMap, SetClipboard, SetImageDebug, SetImageFuzzyMatching, SetMillisBetweenRecords, SetMultipleThreadSearch, SetNetworkConditions, SetVariableValueEx, SetVariableValues, StartWebBrowser, StopWebBrowser, TakeScreenShot, TakeScreenShot, UseWebBrowser, VerifyClipboardToFile, VerifyURLContent, VerifyURLToFile, WaitForGUI, WaitForGUI, WaitForGUIGone, WaitForPropertyValue, WaitForPropertyValueGone, WaitForRegistryKeyExists, WaitForRegistryKeyValue
public static boolean SetClickCapture(boolean on)
To make sure that 'click' action happens, we use 'ClickCapture' to monitor 'click event' of the target component.
But sometimes for some reason, even click does happen, the 'ClickCapture' cannot receive the 'click event' and this will
cause different kinds of troubles. At this situation, to avoid this problem 'click capture' could be turned off.
Later, we could always to turn on 'click capture' to guarantee that click happens.
on
- boolean, if true then the 'click capture' will be turned on; otherwise turned off.public static boolean IsAlertPresent(java.lang.String... optionals) throws SeleniumPlusException
optionals
- String
SeleniumPlusException
- if there is any un-expected error.SAFSPlus#StartWebBrowser(String, String, String...)
1) boolean success = IsAlertPresent();//Test the presence of Alert (belongs to current browser) with 2 seconds timeout.
2) boolean success = IsAlertPresent("0");//Test the presence of Alert (belongs to current browser) immediately
3) boolean success = IsAlertPresent("5", "browser-id");//Test the presence of Alert (belongs to browser identified by "browser-id"),
//before that it will wait 5 seconds for the presence of the Alert
public static boolean AlertAccept(java.lang.String... optionals)
optionals
- String
SAFSPlus#StartWebBrowser(String, String, String...)
1) boolean success = AlertAccept();//Close Alert (belongs to current browser) by clicking the OK button
2) boolean success = AlertAccept("5");//Close Alert (belongs to current browser) by clicking the OK button,
//before that it will wait 5 seconds for the presence of the Alert
3) boolean success = AlertAccept("5", "browser-id");//Close Alert (belongs to browser identified by "browser-id") by clicking the OK button,
//before that it will wait 5 seconds for the presence of the Alert
public static boolean AlertDismiss(java.lang.String... optionals)
optionals
- String
SAFSPlus#StartWebBrowser(String, String, String...)
1) boolean success = AlertAccept();//Close Alert (belongs to current browser) by clicking the Cancel button
2) boolean success = AlertAccept("5");//Close Alert (belongs to current browser) by clicking the Cancel button,
//before that it will wait 5 seconds for the presence of the Alert
3) boolean success = AlertAccept("5", "browser-id");//Close Alert (belongs to browser identified by "browser-id") by clicking the Cancel button,
//before that it will wait 5 seconds for the presence of the Alert
public static void SetCheckAlertTimeout(int seconds)
seconds
- int, the value of time to set.public static int GetCheckAlertTimeout()
Copyright © SAS Institute. All Rights Reserved.