Package org.sikuli.script
Class Sikulix
java.lang.Object
org.sikuli.script.Sikulix
public class Sikulix extends Object
-
Constructor Summary
Constructors Constructor Description Sikulix() -
Method Summary
Modifier and Type Method Description static booleanbuildJarFromFolder(String targetJar, String sourceFolder)build a jar on the fly at runtime from a folder.
special for Jython: if the folder contains a __init__.py on first level, the folder will be copied to the jar root (hence preserving module folders)static booleancompileJythonFolder(String fpSource, String fpTarget)the foo.py files in the given source folder are compiled to JVM-ByteCode-classfiles foo$py.class and stored in the target folder (thus securing your code against changes).
A folder structure is preserved.static LocationgetCurrentPopLocation()static Stringinput(String msg)static Stringinput(String msg, boolean hidden)static Stringinput(String msg, String preset)static Stringinput(String msg, String title, boolean hidden)static Stringinput(String msg, String preset, String title)static Stringinput(String msg, String preset, String title, boolean hidden)request user's input as one line of text
with hidden = true:
the dialog works as password input (input text hidden as bullets)
take care to destroy the return value as soon as possible (internally the password is deleted on return)static StringinputText(String msg)static StringinputText(String msg, int lines, int width)static StringinputText(String msg, int lines, int width, String text)static StringinputText(String msg, String text)static StringinputText(String msg, String title, int lines, int width, String text)Shows a dialog request to enter text in a multiline text field
it has line wrapping on word bounds and a vertical scrollbar if neededstatic voidmain(String[] args)static booleanpopAsk(String msg)static booleanpopAsk(String msg, String title)static Locationpopat()static Locationpopat(int atx, int aty)static Locationpopat(Location at)static Locationpopat(Region at)static voidpopError(String message)static voidpopError(String message, String title)static StringpopFile(String title)static StringpopSelect(String msg, String[] options)static StringpopSelect(String msg, String[] options, String preset)static StringpopSelect(String msg, String title, String[] options)static StringpopSelect(String msg, String title, String[] options, String preset)static voidpopup(String message)static voidpopup(String message, String title)static Stringprint(String msg, Object... args)static Stringrun(String cmdline)static Stringrun(String[] cmd)static VNCScreenvncStart(String theIP, int thePort, int cTimeout, int timeout)convenience for a VNCScreen connection (use theVNCScreen.stop() to stop the connection) active screens are auto-stopped at cleanupstatic VNCScreenvncStart(String theIP, int thePort, String password, int cTimeout, int timeout)convenience for a password protected VNCScreen connection (use theVNCScreen.stop() to stop the connection) active screens are auto-stopped at cleanup
-
Constructor Details
-
Sikulix
public Sikulix()
-
-
Method Details
-
main
- Throws:
FindFailed
-
print
-
popat
-
popat
-
popat
-
popat
-
getCurrentPopLocation
-
popup
-
popup
-
popError
-
popError
-
popAsk
-
popAsk
-
popSelect
-
popSelect
-
popSelect
-
popSelect
-
popFile
-
input
request user's input as one line of text
with hidden = true:
the dialog works as password input (input text hidden as bullets)
take care to destroy the return value as soon as possible (internally the password is deleted on return)- Parameters:
msg-preset-title-hidden-- Returns:
- the text entered
-
input
-
input
-
input
-
input
-
input
-
inputText
-
inputText
-
inputText
-
inputText
-
inputText
Shows a dialog request to enter text in a multiline text field
it has line wrapping on word bounds and a vertical scrollbar if needed- Parameters:
msg- the message to display below the textfieldtitle- the title for the dialog (default: SikuliX input request)lines- the maximum number of lines visible in the text field (default 9)width- the maximum number of characters visible in one line (default 20 letters m)text- a preset text to show- Returns:
- The user's input including the line breaks.
-
run
-
run
-
vncStart
public static VNCScreen vncStart(String theIP, int thePort, String password, int cTimeout, int timeout)convenience for a password protected VNCScreen connection (use theVNCScreen.stop() to stop the connection) active screens are auto-stopped at cleanup- Parameters:
theIP- the server IPthePort- the port numberpassword- a needed password for the server in plain textcTimeout- seconds to wait for a valid connectiontimeout- value in milli-seconds during normal operation- Returns:
- a VNCScreen object
-
vncStart
convenience for a VNCScreen connection (use theVNCScreen.stop() to stop the connection) active screens are auto-stopped at cleanup- Parameters:
theIP- the server IPthePort- the port numbercTimeout- seconds to wait for a valid connectiontimeout- value in milli-seconds during normal operation- Returns:
- a VNCScreen object
-
buildJarFromFolder
build a jar on the fly at runtime from a folder.
special for Jython: if the folder contains a __init__.py on first level, the folder will be copied to the jar root (hence preserving module folders)- Parameters:
targetJar- absolute path to the created jar (parent folder must exist, jar is overwritten)sourceFolder- absolute path to a folder, the contained folder structure will be copied to the jar root level- Returns:
-
compileJythonFolder
the foo.py files in the given source folder are compiled to JVM-ByteCode-classfiles foo$py.class and stored in the target folder (thus securing your code against changes).
A folder structure is preserved. All files not ending as .py will be copied also. The target folder might then be packed to a jar using buildJarFromFolder.
Be aware: you will get no feedback about any compile problems, so make sure your code compiles error free. Currently there is no support for running such a jar, it can only be used with load()/import, but you might provide a simple script that does load()/import and then runs something based on available functions in the jar code.- Parameters:
fpSource- absolute path to a folder/folder-tree containing the stuff to be copied/compiledfpTarget- the folder that will contain the copied/compiled stuff (folder is first deleted)- Returns:
- false if anything goes wrong, true means should have worked
-