public static class SAFSPlus.Component
extends java.lang.Object
Constructor and Description |
---|
Component() |
Modifier and Type | Method and Description |
---|---|
static boolean |
AltLeftDrag(Component comp,
java.lang.String coordinates)
A Alt left mouse drag is performed on the object based on the stored coordinates relative to this object.
|
static boolean |
AssignPropertyVariable(Component comp,
java.lang.String property,
java.lang.String variable)
Assign object property to a variable.
|
static boolean |
CaptureObjectDataToFile(Component comp,
java.lang.String fileName,
java.lang.String... params)
Copy the current contents of a component's data to a file.
|
static boolean |
CapturePropertiesToFile(Component comp,
java.lang.String file,
java.lang.String... fileEncoding)
Copy all of the value properties a test object to a file.
|
static boolean |
CapturePropertyToFile(Component comp,
java.lang.String property,
java.lang.String file,
java.lang.String... fileEncoding)
Copy a propertie's value of a test object to to a file.
|
static boolean |
ClearCache(Component comp)
Some components like Tree, Menu may have a cache containing their content or time-consuming
resource, which will speed up the test. |
static boolean |
Click(Component comp,
java.lang.String... params)
Click on any visible component.
|
static boolean |
CtrlAltLeftDrag(Component comp,
java.lang.String coordinates)
A Ctrl Alt left mouse drag is performed on the object based on the stored coordinates relative to this object.
|
static boolean |
CtrlClick(Component comp,
java.lang.String... params)
Control-Click on any visible component.
|
static boolean |
CtrlLeftDrag(Component comp,
java.lang.String coordinates)
A Ctrl left mouse drag is performed on the object based on the stored coordinates relative to this object.
|
static boolean |
CtrlRightClick(Component comp,
java.lang.String... params)
Control-Right-Click on any visible component.
|
static boolean |
CtrlShiftLeftDrag(Component comp,
java.lang.String coordinates)
A Ctrl Shift left mouse drag is performed on the object based on the stored coordinates relative to this object.
|
static boolean |
DoubleClick(Component comp,
java.lang.String... params)
Double-Click on any visible component.
|
static boolean |
DragTo(Component from,
Component to,
java.lang.String... optionals)
A left mouse drag is performed from one object to another object based on the offsets values.
|
static boolean |
ExecuteScript(Component comp,
java.lang.String script,
java.lang.String... scriptParams)
Execute a simple piece of javascript on component synchronously.
|
static boolean |
GetComputedStyle(Component comp,
java.lang.String testfile)
Save component's computed CSS style to a test file.
|
static boolean |
GetGUIImage(Component comp,
java.lang.String fileName,
java.lang.String... params)
Take a screenshot of windows or component.
See Detailed Reference |
static boolean |
GetTextFromGUI(Component comp,
java.lang.String variable,
java.lang.String... params)
Incorporate OCR technology to detect the text on a GUI component and save the text to a variable.
|
static boolean |
GUIDoesExist(Component comp)
Verify the visual existence of a particular window and/or component.
|
static boolean |
GUIDoesNotExist(Component comp)
Verify the visual non-existence of a particular window and/or component.
|
static boolean |
HoverMouse(Component comp,
java.lang.String... optionals)
Hover the mouse over a component.
|
static boolean |
HoverScreenLocation(java.lang.String coordination,
java.lang.String... optionals)
Hover the mouse over a specified screen location.
|
static boolean |
InputCharacters(Component comp,
java.lang.String textvalue)
Sends key characters to the specified Component.
|
static boolean |
InputKeys(Component comp,
java.lang.String textvalue)
Sends keystrokes to the specified Component.
|
static boolean |
IsPropertyExist(Component comp,
java.lang.String property)
Verify if object's property exists or not.
|
static boolean |
IsPropertyExist(Component comp,
java.lang.String property,
java.lang.String variable)
Verify if object's property exists or not.
|
static boolean |
LeftDrag(Component comp,
java.lang.String coordinates)
A left mouse drag is performed on the object based on the stored coordinates relative to this object.
|
static boolean |
LocateScreenImage(Component comp,
java.lang.String variable,
java.lang.String... optionals)
Store the location and dimensions of a component.
|
static boolean |
RightClick(Component comp,
java.lang.String... params)
Right-Click on any visible component.
|
static boolean |
RightDrag(Component comp,
java.lang.String coordinates)
A right mouse drag is performed on the object based on the stored coordinates relative to this object.
|
static boolean |
SaveTextFromGUI(Component comp,
java.lang.String outputFile,
java.lang.String... params)
Incorporate OCR technology to detect the text on a GUI component and save the text to a file.
|
static boolean |
ShiftClick(Component comp,
java.lang.String... params)
Shift-Click on any visible component.
|
static boolean |
ShiftLeftDrag(Component comp,
java.lang.String coordinates)
A Shift left mouse drag is performed on the object based on the stored coordinates relative to this object.
|
static boolean |
ShowOnPage(Component comp,
java.lang.String... params)
Make the component visible on the page.
|
static boolean |
TypeChars(java.lang.String textvalue)
Sends key characters to the current keyboard focus via AWT Robot.
|
static boolean |
TypeEncryption(java.lang.String encryptedDataFile,
java.lang.String privateKeyFile)
Sends secret-text (such as password) to the current focused Component.
See Detailed Reference |
static boolean |
TypeKeys(java.lang.String textvalue)
Sends AWT Robot keystrokes to whatever currently has keyboard focus.
|
static boolean |
VerifyBinaryFileToFile(java.lang.String benchFile,
java.lang.String actualFile,
java.lang.String... optionals)
Verify the current contents of a binary (image) file with a benchmark file.
|
static boolean |
VerifyComputedStyle(Component comp,
java.lang.String benchfile)
Verify computed CSS style against bench mark.
|
static boolean |
VerifyFileToFile(java.lang.String benchFile,
java.lang.String actualFile,
java.lang.String... optionals)
Verify the current contents of a text file with a benchmark file (same as VerifyTextFileToFile).
|
static boolean |
VerifyGUIImageToFile(Component comp,
java.lang.String benchFile,
java.lang.String... params)
Verify the screen shot of a GUI component with a benchmark image file.
|
static boolean |
VerifyObjectDataToFile(Component comp,
java.lang.String benchFile,
java.lang.String... params)
Verify the current contents of a component's data with a benchmark file.
|
static boolean |
VerifyPropertiesSubsetToFile(Component comp,
java.lang.String benchFile,
java.lang.String... params)
Compare/Verify the value properties of a test object with a benchmark file.
Only those property names and values in the benchmark file will be compared. |
static boolean |
VerifyPropertiesToFile(Component comp,
java.lang.String benchFile,
java.lang.String... params)
Compare/Verify all of the value properties of a test object with a benchmark file.
|
static boolean |
VerifyProperty(Component comp,
java.lang.String property,
java.lang.String value)
Verify object property.
|
static boolean |
VerifyPropertyContains(Component comp,
java.lang.String property,
java.lang.String containedValue)
Verify that the value of an object property contains a string.
The property could be attribute or CSS property. |
static boolean |
VerifyPropertyContains(Component comp,
java.lang.String property,
java.lang.String containedValue,
boolean caseSensitive)
Verify that the value of an object property contains a string.
The property could be attribute or CSS property. |
static boolean |
VerifyPropertyToFile(Component comp,
java.lang.String property,
java.lang.String benchFile,
java.lang.String... params)
Verify the value of a single object property with a benchmark file.
|
static boolean |
VerifyTextFileToFile(java.lang.String benchFile,
java.lang.String actualFile,
java.lang.String... optionals)
Verify the current contents of a text file with a benchmark file (same as VerifyFileToFile).
|
static boolean |
VerifyValueContains(java.lang.String wholeString,
java.lang.String substring,
java.lang.String... optionals)
Verify that a string value contains a substring.
|
static boolean |
VerifyValueContainsIgnoreCase(java.lang.String wholeString,
java.lang.String substring,
java.lang.String... optionals)
Verify that a string value contains a substring, ignoring case.
|
static boolean |
VerifyValueDoesNotContain(java.lang.String wholeString,
java.lang.String substring,
java.lang.String... optionals)
Verify that a string value does NOT contain a substring.
|
static boolean |
VerifyValues(java.lang.String value1,
java.lang.String value2,
java.lang.String... optionals)
Verify that two string values are identical.
|
static boolean |
VerifyValuesIgnoreCase(java.lang.String value1,
java.lang.String value2,
java.lang.String... optionals)
Verify that two string values are identical, ignoring case.
|
static boolean |
VerifyValuesNotEqual(java.lang.String value1,
java.lang.String value2,
java.lang.String... optionals)
Verify that two string values are NOT identical.
|
public static boolean AssignPropertyVariable(Component comp, java.lang.String property, java.lang.String variable)
comp
- -- Component (from App Map) to get property.property
- -- attribute or CSS property.variable
- -- the name of the variable to receive the proeprty value.
String labelVar = "labelVar";
Component.AssignPropertyVariable(Map.AUT.Lable,"textContent", labelVar);
String label = SAFSPlus.GetVariableValue(labelVar);
public static boolean CaptureObjectDataToFile(Component comp, java.lang.String fileName, java.lang.String... params)
comp
- Component, (from App Map) to retrieve data.fileName
- String, The file containing the component's data.params
- optionalSAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = Component.CaptureObjectDataToFile(Map.SampleApp.ListView, "listview.dat");
boolean success = Component.CaptureObjectDataToFile(Map.SampleApp.ListView, "listview.dat", "utf-8");
boolean success = Component.CaptureObjectDataToFile(Map.SampleApp.ListView, "d:\testproj\test\listview.dat");
public static boolean CapturePropertiesToFile(Component comp, java.lang.String file, java.lang.String... fileEncoding)
comp
- Component (from App Map) to retrieve all properties.file
- String, to store all propertiesfileEncoding
- String, the encoding of the file. optional, default is the system-encoding.
Component.CapturePropertiesToFile(Map.Google.SignIn, "singin.properties");
Component.CapturePropertiesToFile(Map.Google.SignIn, "singin.properties", "UTF-8");
public static boolean CapturePropertyToFile(Component comp, java.lang.String property, java.lang.String file, java.lang.String... fileEncoding)
property
- String, the property name to get valuecomp
- Component (from App Map) to retrieve property's valuefileEncoding
- String, the encoding of the file. optional, default is the system-encoding.
Component.CapturePropertyToFile(Map.Google.SignIn, "display", "singin.dispaly.dat");
Component.CapturePropertyToFile(Map.Google.SignIn, "color", "singin.color.dat", "UTF-8");
public static boolean ClearCache(Component comp)
comp
- -- Component (from App Map) from which to clear the cache.
boolean success = Tree.ClickTextNode(Map.Google.Tree, "Root->Child1->GrandChild");
Component.ClearCache(Map.Google.Tree);
boolean success = Tree.CaptureTreeDataToFile(Map.Google.Tree, "D:\data\tree.dat");
public static boolean Click(Component comp, java.lang.String... params)
comp
- -- Component (from App Map) to Clickparams
- optional
Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
1) boolean success = Click(Map.Google.Apps);//Click at the center
2) boolean success = Click(Map.Google.Apps,"20,20");//Click at the coordinate (20,20)
3) boolean success = Click(Map.Google.Apps,"20%,30%"); // Click at the coordinate: its X value equals 20% width of component, its Y value equals 30% height of component.
4) boolean success = Click(Map.Google.Apps,"AppMapSubkey");//Click at the coordinate defined by entry "AppMapSubkey" in App Map.
5) boolean success = Click(Map.Google.Apps,"20,20", "false");//Click at the coordinate (20,20), and web-element will not be scrolled into view automatically
// one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
Pay attention: If you use percentage format in SE+, you'd better use 'Misc.Expressions(false);' first.
"AppMapSubkey" is expected to be an AppMap entry in an "Apps" section in the App Map.
See Detailed Reference
public static boolean DragTo(Component from, Component to, java.lang.String... optionals)
from
- Component, the component (from App Map) relative to which to calculate start coordinates to dragto
- Component, the component (from App Map) relative to which to calculate end coordinates to dragparams
- optionalDriverConstant.DEFAULT_SAFS_TEST_DND_RELEASE_DELAY
.Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = DragTo(Map.Google.Apps, Map.Google.Area);//Left-Drag from center of component Map.Google.Apps to center of component Map.Google.Area
boolean success = DragTo(Map.Google.Apps, Map.Google.Area, "20%,10%, %50, %60");//Left-Drag from (20%,10%) of component Map.Google.Apps to (%50, %60) of component Map.Google.Area
boolean success = DragTo(Map.Google.Apps, Map.Google.Area, "", "", "", "2000");//Left-Drag from center of component Map.Google.Apps to center of component Map.Google.Area, and hold the mouse button for 2 seconds at the component Map.Google.Area
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean ExecuteScript(Component comp, java.lang.String script, java.lang.String... scriptParams)
If the script will return a string value, call SAFSPlus.prevResults.getStatusInfo() to get it.
Object result is NOT supported yet.
This is currently ONLY supported for Selenium WebDriver Engine.
comp
- org.safs.model.Component, (from generated Map.java).script
- String, the javascript to execute.scriptParams
- optional, Script arguments must be a number, a boolean, a String, DOM Element, or a List of any combination of the above.
An exception will be thrown if the arguments do not meet these criteria.
The arguments will be made available to the JavaScript via the "arguments" variable.
#executeScript(String, Object...)
,
#executeAsyncScript(String, Object...)
SAFSPlus.ExecuteScript(
Map.Google.SignIn, // The DOM Element passed as 'arguments[0]' to the script.
"arguments[0].innerHTML=arguments[1];", // Script to set the DOM Elements innerHTML value.
"my text value"); // The value passed as 'arguments[1]' to set to innerHTML.
SAFSPlus.ExecuteScript(
Map.Google.SignIn, // The DOM Element passed as 'arguments[0]' to the script.
"return arguments[0].innerHTML;"); // A script to return the DOM Elements innerHTML.
// scriptResult should get the innerHTML value returned.
String scriptResult = SAFSPlus.prevResults.getStatusInfo();
public static boolean GetTextFromGUI(Component comp, java.lang.String variable, java.lang.String... params)
comp
- Component (from App Map) from which to retrieve text.variable
- String, The name of the variable to receive detected text.params
- optional
Component.GetTextFromGUI(Map.Google.SignIn, "signinText");
String value = SAFSPlus.GetVariableValue("signinText");
Component.GetTextFromGUI(Map.Google.SignIn, "signinText", "", "GOCR");
Component.GetTextFromGUI(Map.Google.SignIn, "signinText", "5,10, %50, %60", "TOCR", "en", "1.5");
Component.GetTextFromGUI(Map.Google.SignIn, quote("signin-partial"), "0, 0, 70%, 100%", "GOCR");
//"subarea" is defined in map file
//[SignIn]
//subarea=="0,0,50%,50%"
Component.GetTextFromGUI(Map.Google.SignIn,"SignInPartialText", "subarea");
//or
//"subarea" is defined in map file
//[ApplicationConstants]
//subarea=="0,0,50%,50%"
Component.GetTextFromGUI(Map.Google.SignIn, "SignInPartialText", Map.subarea, "TOCR");
public static boolean GetGUIImage(Component comp, java.lang.String fileName, java.lang.String... params)
comp
- Component, the component to get its image.fileName
- String, the file name to store image. Suggest to save as .png image.params
- optional
GetGUIImage(Map.Google.SignIn,"SignIn");//will be saved at <testProject>\Actuals\SignIn.bmp
GetGUIImage(Map.Google.SignIn,"c:/temp/SignIn.gif");
//Following example will store part of the SingIn image,
GetGUIImage(Map.Google.SignIn,"SignInPartial.png", "0,0,50%,50%");
//"subarea" is defined in map file
//[SignIn]
//subarea="0,0,50%,50%"
GetGUIImage(Map.Google.SignIn,"SignInPartial.png", "subarea");
//or
//"subarea" is defined in map file
//[ApplicationConstants]
//subarea="0,0,50%,50%"
GetGUIImage(Map.Google.SignIn,"SignInPartial.png", Map.subarea);
GetGUIImage(Map.Google.SignIn,"SignInPartial.png", Map.subarea());
//Filter the SingIn image and save it
GetGUIImage(Map.Google.SignIn,"SignInFiltered.gif", "", quote("Filter=0,0,10,10 60,60,10,10"));
//"filterAreas" is defined in map file
//[SignIn]
//filterAreas="Filter=0,0,10,10 60,60,10,10"
GetGUIImage(Map.Google.SignIn,"SignInFiltered.gif", "", "filterAreas");
//"filterAreas" is defined in map file
//[ApplicationConstants]
//filterAreas="Filter=0,0,10,10 60,60,10,10"
GetGUIImage(Map.Google.SignIn,"SignInFiltered.gif", "", Map.filterAreas);
GetGUIImage(Map.Google.SignIn,"SignInFiltered.gif", "", Map.filterAreas());
public static boolean GUIDoesExist(Component comp)
comp
- -- Component (from App Map).
Component.GUIDoesExist(Map.AUT.EditBox);
public static boolean GUIDoesNotExist(Component comp)
comp
- -- Component (from App Map).
Component.GUIDoesNotExist(Map.AUT.EditBox);
public static boolean HoverMouse(Component comp, java.lang.String... optionals)
comp
- org.safs.model.Component, the component to hover.optionals
- Constants.TIMEOUT_HOVERMOUSE_STAY_FOREVER
, then
the mouse will always stay there forever.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = Component.HoverMouse(Map.AUT.EditBox);//hover at the center of EditBox for 2 seconds
boolean success = Component.HoverMouse(Map.AUT.EditBox, "", String.valueOf(Constants.TIMEOUT_HOVERMOUSE_STAY_FOREVER));//hover at the center of EditBox forever.
boolean success = Component.HoverMouse(Map.AUT.EditBox, "50, 30", "1000");//hover at (50,30) of EditBox for 1 second
boolean success = Component.HoverMouse(Map.AUT.EditBox, "locKey", "3000");//locKey="500, 300" defined in map file under "EditBox" or "ApplicationConstants"
public static boolean InputKeys(Component comp, java.lang.String textvalue)
This supports special key characters like:
{Enter} = ENTER Key {Tab} = TAB Key ^ = CONTROL Key with another key ( "^s" = CONTROL + s ) % = ALT Key with another key ( "%F" = ALT + F ) + = SHIFT Key with another key ( "+{Enter}" = SHIFT + ENTER )We are generally providing this support through our generic InputKeys Support.
comp
- -- Component (from App Map).textvalue
- -- to send via input to the Component.Component.inputKeys(String)
,
SAFSPlus.quote(String)
Component.InputKeys(Map.AUT.EditBox, quote("^a"));//"Ctrl+a" Select all text of this EditBox
public static boolean TypeKeys(java.lang.String textvalue)
This supports special key characters like:
{Enter} = ENTER Key {Tab} = TAB Key ^ = CONTROL Key with another key ( "^s" = CONTROL + s ) % = ALT Key with another key ( "%F" = ALT + F ) + = SHIFT Key with another key ( "+{Enter}" = SHIFT + ENTER )We are generally providing special key support through our generic InputKeys Support.
textvalue
- -- to send via Robot to the current keyboard focus.TypeChars(String)
,
SAFSPlus.quote(String)
Component.TypeKeys(quote("^a"));//"Ctrl+a" Select all text of this EditBox
public static boolean InputCharacters(Component comp, java.lang.String textvalue)
comp
- -- Component (from App Map).textvalue
- -- to send via input to the Component.Component.inputKeys(String)
,
SAFSPlus.quote(String)
Component.InputCharacters(Map.AUT.EditBox, "Test Value");
Component.InputCharacters(Map.AUT.EditBox, quote("UTF-8"));
Component.InputCharacters(Map.AUT.EditBox, quote("^NotVariable"));
public static boolean TypeChars(java.lang.String textvalue)
textvalue
- -- to send via input by AWT Robot.TypeKeys(String)
,
SAFSPlus.quote(String)
Component.TypeChars("Test Value");
Component.TypeChars(quote("UTF-8"));
Component.TypeChars(quote("^NotVariable"));
public static boolean TypeEncryption(java.lang.String encryptedDataFile, java.lang.String privateKeyFile)
encryptedDataFile
- String, the file containing 'encrypted data' to send to the current focused Component.privateKeyFile
- String, the file containing 'private key' to decrypt the 'encrypted data'Robot.inputChars(String)
,
RSA
//D:\secretPath\private.key contains "private key", which is generated byRSA
//C:\safs\passwords\encrypted.pass contains the encrypted-data, which is encrypted byRSA
with publickeySeleniumPlus.TypeEncryption("C:\safs\passwords\encrypted.pass", "D:\secretPath\private.key" );
public static boolean IsPropertyExist(Component comp, java.lang.String property, java.lang.String variable)
comp
- -- Component (from App Map) to get property's existence.property
- -- attribute or CSS property.variable
- -- the name of the variable to receive the proeprty's existence.
String PropertyExistVariable = "PropertyExistVariable";
Component.IsPropertyExist(Map.AUT.Lable,"textContent", PropertyExistVariable);
String existence = SAFSPlus.GetVariableValue(PropertyExistVariable);
public static boolean IsPropertyExist(Component comp, java.lang.String property) throws SeleniumPlusException
comp
- -- Component (from App Map) to get property's existence.property
- -- attribute or CSS property.SeleniumPlusException
- if the execution fails.
boolean existence = Component.IsPropertyExist(Map.AUT.Lable,"textContent");
public static boolean LocateScreenImage(Component comp, java.lang.String variable, java.lang.String... optionals)
variable
- String, The root name of the collection of variables to receive the location and dimensions.
optionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
String variable = "editboxRect";
boolean success = Component.LocateScreenImage(Map.AUT.EditBox, variable);//EditBox's screen location and dimension will be store to variable "editboxRect"
String rect = GetVariableValue(variable);
String x = GetVariableValue(variable+".x");
String y = GetVariableValue(variable+".y");
String w = GetVariableValue(variable+".w");
String h = GetVariableValue(variable+".h");
boolean success = Component.LocateScreenImage(Map.AUT.EditBox, variable, RELATIVE_TO_PARENT);//EditBox's relative location and dimension will be store to variable "editboxRect"
public static boolean SaveTextFromGUI(Component comp, java.lang.String outputFile, java.lang.String... params)
comp
- Component (from App Map) from which to retrieve text.outputFile
- String, The name of the file to store detected text.params
- optional
Component.SaveTextFromGUI(Map.Google.SignIn, "signin.txt");
Component.SaveTextFromGUI(Map.Google.SignIn, "D:\data\test\signin.txt");
Component.SaveTextFromGUI(Map.Google.SignIn, "signin.txt", "", "GOCR");
Component.SaveTextFromGUI(Map.Google.SignIn, "signin.txt", "5,10, %50, %60", "TOCR", "en", "1.5");
Component.SaveTextFromGUI(Map.Google.SignIn, quote("signin-partial.txt"), "0, 0, 70%, 100%", "GOCR");
//"subarea" is defined in map file
//[SignIn]
//subarea=="0,0,50%,50%"
Component.SaveTextFromGUI(Map.Google.SignIn,"SignInPartialText.txt", "subarea");
//or
//"subarea" is defined in map file
//[ApplicationConstants]
//subarea=="0,0,50%,50%"
Component.SaveTextFromGUI(Map.Google.SignIn, "D:\data\test\SignInPartialText.txt", Map.subarea, "TOCR");
public static boolean VerifyComputedStyle(Component comp, java.lang.String benchfile)
comp
- -- Component (from App Map) to verify computed CSS style.benchfile
- -- benchmark json file name from the project benchmark dir or User
specify full path.
Component.VerifyComputedStyle(Map.Google.SignIn,"benmarkfile.json");
Component.VerifyComputedStyle(Map.Google.SignIn,"c:\\temp\\file.json");
public static boolean GetComputedStyle(Component comp, java.lang.String testfile)
comp
- -- Component (from App Map) to verify computed CSS style.testfile
- -- test json file name from the project test dir or User specify full path.
Component.GetComputedStyle(Map.Google.SignIn,"testfile.json");
Component.GetComputedStyle(Map.Google.SignIn,"c:\\temp\\file.json");
public static boolean VerifyGUIImageToFile(Component comp, java.lang.String benchFile, java.lang.String... params)
comp
- Component, the component to get its image.benchFile
- String, the benchmark file name. Suggest to compare with .png image.params
- optional
VerifyGUIImageToFile(Map.Google.SignIn,"SignIn");//will be compared with file <testProject>\Benchmarks\SignIn.bmp
VerifyGUIImageToFile(Map.Google.SignIn,"c:/benchDir/SignIn.gif");
VerifyGUIImageToFile(Map.Google.SignIn,"c:/benchDir/SignIn.gif", "", "", quote("UUID=False"));// Simple output filename, no UUID.
VerifyGUIImageToFile(Map.Google.SignIn,"c:/benchDir/SignIn.gif", "", "95");//if 95% bits match, the verification will pass.
//Following example will verify part of the SingIn image,
GetGUIImage(Map.Google.SignIn,"SignInPartial.png", quote("0,0,50%,50%"));
//"subarea" is defined in map file
//[SignIn]
//subarea="0,0,50%,50%"
VerifyGUIImageToFile(Map.Google.SignIn,"SignInPartial.png", "subarea");
//or
//"subarea" is defined in map file
//[ApplicationConstants]
//subarea="0,0,50%,50%"
VerifyGUIImageToFile(Map.Google.SignIn,"SignInPartial.png", Map.subarea);
VerifyGUIImageToFile(Map.Google.SignIn,"SignInPartial.png", Map.subarea());
//Filter the SingIn image and the bench image at certain areas and compare them
VerifyGUIImageToFile(Map.Google.SignIn,"c:/benchDir/SignIn.gif", "", "", "", quote("Filter=0,0,10,10 60,60,10,10"));
//"filterAreas" is defined in map file
//[SignIn]
//filterAreas="Filter=0,0,10,10 60,60,10,10"
VerifyGUIImageToFile(Map.Google.SignIn,"c:/benchDir/SignIn.gif", "", "", "", "filterAreas");
//"filterAreas" is defined in map file
//[ApplicationConstants]
//filterAreas="Filter=0,0,10,10 60,60,10,10"
VerifyGUIImageToFile(Map.Google.SignIn,"c:/benchDir/SignIn.gif", "", "", "", Map.filterAreas);
VerifyGUIImageToFile(Map.Google.SignIn,"c:/benchDir/SignIn.gif", "", "", "", Map.filterAreas());
public static boolean VerifyProperty(Component comp, java.lang.String property, java.lang.String value)
comp
- -- Component (from App Map) to verify property.property
- -- attribute or CSS property.value
- -- property value to be verified.public static boolean VerifyPropertyContains(Component comp, java.lang.String property, java.lang.String containedValue)
comp
- Component, (from App Map) to verify property.property
- String, attribute or CSS property.containedValue
- String, property value to be verified.public static boolean VerifyPropertyContains(Component comp, java.lang.String property, java.lang.String containedValue, boolean caseSensitive)
comp
- Component, (from App Map) to verify property.property
- String, attribute or CSS property.containedValue
- String, property value to be verified.caseSensitive
- boolean, if the comparison is case-sensitive or not.
Component.VerifyPropertyContains(Map.Google.SignIn, "font-family", "Helvetica");
Component.VerifyPropertyContains(Map.Google.SignIn, "font-family", "HELVETICA", false);
public static boolean VerifyPropertyToFile(Component comp, java.lang.String property, java.lang.String benchFile, java.lang.String... params)
comp
- Component, (from App Map) to verify property.property
- String, attribute or CSS property to verify.benchFile
- String, The file containing the value of the property to compare.params
- --SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = Component.VerifyPropertyToFile(Map.Google.SignIn, "font-family", "bench.font.family.dat");
boolean success = Component.VerifyPropertyToFile(Map.Google.SignIn, "font-family", "bench.font.family.dat", "utf-8");
public static boolean VerifyPropertiesToFile(Component comp, java.lang.String benchFile, java.lang.String... params)
comp
- Component, (from App Map) to verify property.benchFile
- String, The file containing the values of the properties to compare.params
- --SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = Component.VerifyPropertiesToFile(Map.Google.SignIn, "signin.properties");
boolean success = Component.VerifyPropertiesToFile(Map.Google.SignIn, "signin.properties", "utf-8");
public static boolean VerifyPropertiesSubsetToFile(Component comp, java.lang.String benchFile, java.lang.String... params)
comp
- Component, (from App Map) to verify property.benchFile
- String, The file containing the value of the properties to compare.params
- --SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = Component.VerifyPropertiesSubsetToFile(Map.Google.SignIn, "signinSubset.properties");
boolean success = Component.VerifyPropertiesSubsetToFile(Map.Google.SignIn, "signinSubset.properties", "utf-8");
public static boolean VerifyObjectDataToFile(Component comp, java.lang.String benchFile, java.lang.String... params)
comp
- Component, (from App Map) to retrieve data.benchFile
- String, The benchmark file containing the date to compare.params
- optional--SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = Component.VerifyObjectDataToFile(Map.SampleApp.ListView, "listview.dat");
boolean success = Component.VerifyObjectDataToFile(Map.SampleApp.ListView, "listview.dat", "utf-8");
boolean success = Component.VerifyObjectDataToFile(Map.SampleApp.ListView, "d:\testproj\bench\listview.dat");
public static boolean ShowOnPage(Component comp, java.lang.String... params)
comp
- Component, (from App Map) to be visible on page.params
- optionalSAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
//Try to make Map.SampleApp.EditBox becomes visible on page
boolean success = Component.ShowOnPage(Map.SampleApp.EditBox);
//Try to make Map.SampleApp.EditBox becomes visible on page and verify that it is shown.
boolean success = Component.ShowOnPage(Map.SampleApp.EditBox, "true");
public static boolean HoverScreenLocation(java.lang.String coordination, java.lang.String... optionals)
coordination
- String, The screen location, such as "200;400", or a mapKey defined under "ApplicationConstants" in map fileoptionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = SAFSPlus.HoverScreenLocation("500, 300", "20");
boolean success = SAFSPlus.HoverScreenLocation("locKey", "20");//locKey="500, 300" defined in map file under "ApplicationConstants"
public static boolean VerifyBinaryFileToFile(java.lang.String benchFile, java.lang.String actualFile, java.lang.String... optionals)
benchFile
- String, File used as the comparison benchmark.actualFile
- String, File used as the comparison file under test.optionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = SAFSPlus.VerifyBinaryFileToFile("signIn.png", "signIn.png");
boolean success = SAFSPlus.VerifyBinaryFileToFile("c:\bench\signIn.png", "d:\test\signIn.png");
boolean success = SAFSPlus.VerifyBinaryFileToFile("c:\bench\signIn.png", "d:\test\signIn.png", FilterMode.TOLERANCE.name, "90");
public static boolean VerifyFileToFile(java.lang.String benchFile, java.lang.String actualFile, java.lang.String... optionals)
benchFile
- String, File used as the comparison benchmark.actualFile
- String, File used as the comparison file under test.optionals
- -- NOT used yetSAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = SAFSPlus.VerifyFileToFile("benchFile.txt", "actualFile.txt");
boolean success = SAFSPlus.VerifyFileToFile("c:\bench\benchFile.txt", "d:\test\actualFile.txt");
public static boolean VerifyTextFileToFile(java.lang.String benchFile, java.lang.String actualFile, java.lang.String... optionals)
benchFile
- String, File used as the comparison benchmark.actualFile
- String, File used as the comparison file under test.optionals
- -- NOT used yetSAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = SAFSPlus.VerifyTextFileToFile("benchFile.txt", "actualFile.txt");
boolean success = SAFSPlus.VerifyTextFileToFile("c:\bench\benchFile.txt", "d:\test\actualFile.txt");
public static boolean VerifyValueContains(java.lang.String wholeString, java.lang.String substring, java.lang.String... optionals)
wholeString
- String, the string value to verify.substring
- String, the substringoptionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
String labelVar = "labelVariable";
Component.AssignPropertyVariable(Map.AUT.Lable,"textContent", labelVar);
String label = SAFSPlus.GetVariableValue(labelVar);
boolean success = SAFSPlus.VerifyValueContains(label, "labelContent");
//or
boolean success = SAFSPlus.VerifyValueContains("^"+labelVar, "labelContent");
public static boolean VerifyValueContainsIgnoreCase(java.lang.String wholeString, java.lang.String substring, java.lang.String... optionals)
wholeString
- String, the string value to verify.substring
- String, the substringoptionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
String labelVar = "labelVariable";
Component.AssignPropertyVariable(Map.AUT.Lable,"textContent", labelVar);
boolean success = SAFSPlus.VerifyValueContainsIgnoreCase("^"+labelVar, "subcontent");
public static boolean VerifyValueDoesNotContain(java.lang.String wholeString, java.lang.String substring, java.lang.String... optionals)
wholeString
- String, the string value to verify.substring
- String, the substringoptionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
String labelVar = "labelVariable";
Component.AssignPropertyVariable(Map.AUT.Lable,"textContent", labelVar);
boolean success = SAFSPlus.VerifyValueDoesNotContain("^"+labelVar, "substr");
public static boolean VerifyValues(java.lang.String value1, java.lang.String value2, java.lang.String... optionals)
value1
- String, the first value to compare.value2
- String, the second value to compare.optionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
String labelVar = "labelVariable";
Component.AssignPropertyVariable(Map.AUT.Lable,"textContent", labelVar);
String label = SAFSPlus.GetVariableValue(labelVar);
boolean success = SAFSPlus.VerifyValues(label, "labelContent");
//or
boolean success = SAFSPlus.VerifyValues("^"+labelVar, "labelContent");
public static boolean VerifyValuesIgnoreCase(java.lang.String value1, java.lang.String value2, java.lang.String... optionals)
value1
- String, the first value to compare.value2
- String, the second value to compare.optionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
String labelVar = "labelVariable";
Component.AssignPropertyVariable(Map.AUT.Lable,"textContent", labelVar);
boolean success = SAFSPlus.VerifyValuesIgnoreCase("^"+labelVar, "labelcontent");
public static boolean VerifyValuesNotEqual(java.lang.String value1, java.lang.String value2, java.lang.String... optionals)
value1
- String, the first value to compare.value2
- String, the second value to compare.optionals
- SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
String labelVar = "labelVariable";
Component.AssignPropertyVariable(Map.AUT.Lable,"textContent", labelVar);
boolean success = SAFSPlus.VerifyValuesNotEqual("^"+labelVar, "labelContent");
public static boolean CtrlClick(Component comp, java.lang.String... params)
comp
- -- Component (from App Map) to Clickparams
- optional
Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
1) boolean success = CtrlClick(Map.Google.Apps);//Control-Click at the center
2) boolean success = CtrlClick(Map.Google.Apps,"20,20");//Control-Click at the coordinate (20,20)
3) boolean success = CtrlClick(Map.Google.Apps,"20%,30%"); // Control-Click at the coordinate: its X value equals 20% width of component, its Y value equals 30% height of component.
4) boolean success = CtrlClick(Map.Google.Apps,"AppMapSubkey");//Control-Click at the coordinate defined by entry "AppMapSubkey" in App Map.
5) boolean success = CtrlClick(Map.Google.Apps,"20,20", "false");//Control-Click at the coordinate (20,20) and web-element will not be scrolled into view automatically
// one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
Pay attention: If you use percentage format in SE+, you'd better use 'Misc.Expressions(false);' first.
public static boolean CtrlRightClick(Component comp, java.lang.String... params)
comp
- -- Component (from App Map) to Clickparams
- optional
Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
1) boolean success = CtrlRightClick(Map.Google.Apps);//Control-Right-Click at the center
2) boolean success = CtrlRightClick(Map.Google.Apps,"20,20");//Control-Right-Click at the coordinate (20,20)
3) boolean success = CtrlRightClick(Map.Google.Apps,"20%,30%"); // Control-Right-Click at the coordinate: its X value equals 20% width of component, its Y value equals 30% height of component.
4) boolean success = CtrlRightClick(Map.Google.Apps,"AppMapSubkey");//Control-Right-Click at the coordinate defined by entry "AppMapSubkey" in App Map.
5) boolean success = CtrlRightClick(Map.Google.Apps,"20,20", "false");//Control-Right-Click at the coordinate (20,20) and web-element will not be scrolled into view automatically
// one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
Pay attention: If you use percentage format in SE+, you'd better use 'Misc.Expressions(false);' first.
public static boolean DoubleClick(Component comp, java.lang.String... params)
comp
- -- Component (from App Map) to Clickparams
- optional
Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
1) boolean success = DoubleClick(Map.Google.Apps);//Double-Click at the center
2) boolean success = DoubleClick(Map.Google.Apps,"20,20");//Double-Click at the coordinate (20,20)
3) boolean success = DoubleClick(Map.Google.Apps,"20%,30%"); // Double-Click at the coordinate: its X value equals 20% width of component, its Y value equals 30% height of component.
4) boolean success = DoubleClick(Map.Google.Apps,"AppMapSubkey");//Double-Click at the coordinate defined by entry "AppMapSubkey" in App Map.
5) boolean success = DoubleClick(Map.Google.Apps,"20,20", "false");//Double-Click at the coordinate (20,20) and web-element will not be scrolled into view automatically
// one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
Pay attention: If you use percentage format in SE+, you'd better use 'Misc.Expressions(false);' first.
public static boolean RightClick(Component comp, java.lang.String... params)
comp
- -- Component (from App Map) to Clickparams
- optional
Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
1) boolean success = RightClick(Map.Google.Apps);//Right-Click at the center
2) boolean success = RightClick(Map.Google.Apps,"20,20");//Right-Click at the coordinate (20,20)
3) boolean success = RightClick(Map.Google.Apps,"20%,30%"); // Right-Click at the coordinate: its X value equals 20% width of component, its Y value equals 30% height of component.
4) boolean success = RightClick(Map.Google.Apps,"AppMapSubkey");//Right-Click at the coordinate defined by entry "AppMapSubkey" in App Map.
5) boolean success = RightClick(Map.Google.Apps,"20,20", "false");//Right-Click at the coordinate (20,20) and web-element will not be scrolled into view automatically
// one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
Pay attention: If you use percentage format in SE+, you'd better use 'Misc.Expressions(false);' first.
public static boolean LeftDrag(Component comp, java.lang.String coordinates)
comp
- Component, the component (from App Map) relative to which to calculate coordinates to dragcoordinates
- String, the relative coordinates. Example: "Coords=3,10,12,20", or "coordsKey" defined in App MapSets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = LeftDrag(Map.Google.Apps,"3,10,12,20");//Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = LeftDrag(Map.Google.Apps,"Coords=3,10,12,20");//Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = LeftDrag(Map.Google.Apps,"coordsKey");//"coordsKey" is defined in map file under section [Apps]
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean ShiftLeftDrag(Component comp, java.lang.String coordinates)
comp
- Component, the component (from App Map) relative to which to calculate coordinates to dragcoordinates
- String, the relative coordinates. Example: "Coords=3,10,12,20", or "coordsKey" defined in App MapSets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = ShiftLeftDrag(Map.Google.Apps,"3,10,12,20");//Shift-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = ShiftLeftDrag(Map.Google.Apps,"Coords=3,10,12,20");//Shift-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = ShiftLeftDrag(Map.Google.Apps,"coordsKey");//"coordsKey" is defined in map file under section [Apps]
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean CtrlShiftLeftDrag(Component comp, java.lang.String coordinates)
comp
- Component, the component (from App Map) relative to which to calculate coordinates to dragcoordinates
- String, the relative coordinates. Example: "Coords=3,10,12,20", or "coordsKey" defined in App MapSets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = CtrlShiftLeftDrag(Map.Google.Apps,"3,10,12,20");//Ctrl-Shift-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = CtrlShiftLeftDrag(Map.Google.Apps,"Coords=3,10,12,20");//Ctrl-Shift-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = CtrlShiftLeftDrag(Map.Google.Apps,"coordsKey");//"coordsKey" is defined in map file under section [Apps]
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean CtrlLeftDrag(Component comp, java.lang.String coordinates)
comp
- Component, the component (from App Map) relative to which to calculate coordinates to dragcoordinates
- String, the relative coordinates. Example: "Coords=3,10,12,20", or "coordsKey" defined in App MapSets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = CtrlLeftDrag(Map.Google.Apps,"3,10,12,20");//Ctrl-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = CtrlLeftDrag(Map.Google.Apps,"Coords=3,10,12,20");//Ctrl-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = CtrlLeftDrag(Map.Google.Apps,"coordsKey");//"coordsKey" is defined in map file under section [Apps]
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean AltLeftDrag(Component comp, java.lang.String coordinates)
comp
- Component, the component (from App Map) relative to which to calculate coordinates to dragcoordinates
- String, the relative coordinates. Example: "Coords=3,10,12,20", or "coordsKey" defined in App MapSets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = AltLeftDrag(Map.Google.Apps,"3,10,12,20");//Alt-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = AltLeftDrag(Map.Google.Apps,"Coords=3,10,12,20");//Alt-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = AltLeftDrag(Map.Google.Apps,"coordsKey");//"coordsKey" is defined in map file under section [Apps]
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean CtrlAltLeftDrag(Component comp, java.lang.String coordinates)
comp
- Component, the component (from App Map) relative to which to calculate coordinates to dragcoordinates
- String, the relative coordinates. Example: "Coords=3,10,12,20", or "coordsKey" defined in App MapSets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = CtrlAltLeftDrag(Map.Google.Apps,"3,10,12,20");//Ctrl-Alt-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = CtrlAltLeftDrag(Map.Google.Apps,"Coords=3,10,12,20");//Ctrl-Alt-Left-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = CtrlAltLeftDrag(Map.Google.Apps,"coordsKey");//"coordsKey" is defined in map file under section [Apps]
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean RightDrag(Component comp, java.lang.String coordinates)
comp
- Component, the component (from App Map) relative to which to calculate coordinates to dragcoordinates
- String, the relative coordinates. Example: "Coords=3,10,12,20", or "coordsKey" defined in App MapSets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
boolean success = RightDrag(Map.Google.Apps,"3,10,12,20");//Right-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = RightDrag(Map.Google.Apps,"Coords=3,10,12,20");//Right-Drag from (3,10) to (12,20), relative to the Left Up corner of component Map.Google.Apps
boolean success = RightDrag(Map.Google.Apps,"coordsKey");//"coordsKey" is defined in map file under section [Apps]
//one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
public static boolean ShiftClick(Component comp, java.lang.String... params)
comp
- -- Component (from App Map) to Clickparams
- optional
Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
1) boolean success = ShiftClick(Map.Google.Apps);//Shift-Click at the center
2) boolean success = ShiftClick(Map.Google.Apps,"20,20");//Shift-Click at the coordination (20,20)
3) boolean success = ShiftClick(Map.Google.Apps,"20%,30%"); // Shift-Click at the coordinate: its X value equals 20% width of component, its Y value equals 30% height of component.
4) boolean success = ShiftClick(Map.Google.Apps,"AppMapSubkey");//Shift-Click at the coordination defined by entry "AppMapSubkey" in App Map.
5) boolean success = ShiftClick(Map.Google.Apps,"20,20", "false");//Shift-Click at the coordination (20,20) and web-element will not be scrolled into view automatically
// one of the above and then,
int rc = prevResults.getStatusCode(); // if useful
String info = prevResults.getStatusInfo(); // if useful
Pay attention: If you use percentage format in SE+, you'd better use 'Misc.Expressions(false);' first.
Copyright © SAS Institute. All Rights Reserved.