public class SikuliXPlugin extends PluginAncestor
The first time that you use this pllugin you may need to restart TestOptimal server and logoff and re-login your computer for SikuliX to complete the installation.
This plugin is in BETA state. Please contact Support@testoptimal.com for additional information.
Locator: control is identified by the image file stored in uimap
folder within
the model folder. Only png
files are supported.
MScriptInterface.IGNORE_INHERITED_METHOD, MScriptInterface.NOT_MSCRIPT_METHOD, MScriptInterface.TO_PLUGIN
Constructor and Description |
---|
SikuliXPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
close()
INTERNAL USE ONLY
|
org.sikuli.script.Match |
find(String uiImgFile_p)
attempts to find the UI element identified by the image passed in.
|
org.sikuli.script.Screen |
getCurScreen()
returns the current screen.
|
String |
getPluginDesc()
INTERNAL USE ONLY
|
String |
getPluginID()
INTERNAL USE ONLY
|
String |
getText(int deltaX_p,
int deltaY_p,
int width_p,
int height_p)
performs OCR on the region specified.
|
void |
initialize(MbtScriptExecutor scriptExec_p)
INTERNAL USE ONLY
|
org.sikuli.script.Screen |
selectMonitor(int monitorID_p)
set the specified monitor to be the current monitor
|
void |
setMinSimilarity(float minSimilarity_p)
sets the sensitivity for matching the image.
|
void |
setOCR(String onFlag_p)
turns on or off OCR feature.
|
void |
setSearchRegion(int x_p,
int y_p,
int w_p,
int h_p)
sets the screen region on the current screen to limit Siklul's search spacce for better
performance.
|
String |
snapScreen(int x_p,
int y_p,
int width_p,
int height_p,
String fileName_p)
takes a screen shot of the specified region on the current screen/monitor and saves it to the file specified.
|
String |
snapScreen(String fileName_p)
takes a screen shot and saves it to the file specified.
|
void |
start()
INTERNAL USE ONLY
|
org.sikuli.script.Match |
waitFor(String uiImgFile_p,
int timeoutMillis_p)
wait for the UI element up to the timeout in milliseconds.
|
boolean |
waitForVanish(String uiImgFile_p,
int timeoutMillis_p)
wait for the UI element to vanish/disappear from the screen, up to the
timeout in milliseconds specified.
|
enterInitialState, exitFinalState
public String getPluginID()
INTERNAL USE ONLY
getPluginID
in class PluginAncestor
public void initialize(MbtScriptExecutor scriptExec_p)
INTERNAL USE ONLY
this method is called at the beginning of model execution before MBT_start trigger is called. This is not a full initialization as it's missing mscriptexecutor object.public String getPluginDesc()
INTERNAL USE ONLY
getPluginDesc
in class PluginAncestor
public void start() throws Exception
INTERNAL USE ONLY
start
in class PluginAncestor
Exception
public void close()
INTERNAL USE ONLY
close
in class PluginAncestor
public String snapScreen(String fileName_p) throws Exception
Exception
public String snapScreen(int x_p, int y_p, int width_p, int height_p, String fileName_p) throws Exception
To capture screenshot of a specific screen/monitor, call $SIKULIX.selectMonitor('id') to switch to that screen/monitor before calling this function.
Exception
public org.sikuli.script.Screen getCurScreen()
public org.sikuli.script.Screen selectMonitor(int monitorID_p)
monitorID_p
- public org.sikuli.script.Match find(String uiImgFile_p)
uiImgFile_p
- name of the image file located in uimap
folder in the model folder.
You may also use absolute file path.public org.sikuli.script.Match waitFor(String uiImgFile_p, int timeoutMillis_p)
uiImgFile_p
- timeoutMillis_p
- public boolean waitForVanish(String uiImgFile_p, int timeoutMillis_p)
uiImgFile_p
- timeoutMillis_p
- public void setSearchRegion(int x_p, int y_p, int w_p, int h_p)
x_p
- y_p
- w_p
- h_p
- public void setMinSimilarity(float minSimilarity_p)
minSimilarity_p
- float value between 0 and 1 with 1 being identical. Default is 0.75.public void setOCR(String onFlag_p)
onFlag_p
- Y to turn on OCR, N to turn off OCR.public String getText(int deltaX_p, int deltaY_p, int width_p, int height_p) throws MBTException
Experimental use only.
deltaX_p
- relative x position from current UI element's x location.deltaY_p
- relative y position from current UI element's y location.width_p
- width of the target regionheight_p
- height of the target regionMBTException
Copyright TestOptimal, LLC