Class Sikulix


  • public class Sikulix
    extends Object
    • Constructor Detail

      • Sikulix

        public Sikulix()
    • Method Detail

      • popat

        public static Location popat​(int atx,
                                     int aty)
      • popat

        public static Location popat()
      • getCurrentPopLocation

        public static Location getCurrentPopLocation()
      • popup

        public static void popup​(String message)
      • popup

        public static void popup​(String message,
                                 String title)
      • popError

        public static void popError​(String message)
      • popError

        public static void popError​(String message,
                                    String title)
      • popAsk

        public static boolean popAsk​(String msg)
      • popAsk

        public static boolean popAsk​(String msg,
                                     String title)
      • input

        public static String input​(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)
        Parameters:
        msg -
        preset -
        title -
        hidden -
        Returns:
        the text entered
      • input

        public static String input​(String msg,
                                   boolean hidden)
      • inputText

        public static String inputText​(String msg)
      • inputText

        public static String inputText​(String msg,
                                       int lines,
                                       int width)
      • inputText

        public static String inputText​(String msg,
                                       int lines,
                                       int width,
                                       String text)
      • inputText

        public static String inputText​(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 needed
        Parameters:
        msg - the message to display below the textfield
        title - 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.
      • 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 IP
        thePort - the port number
        password - a needed password for the server in plain text
        cTimeout - seconds to wait for a valid connection
        timeout - value in milli-seconds during normal operation
        Returns:
        a VNCScreen object
      • vncStart

        public static VNCScreen vncStart​(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 cleanup
        Parameters:
        theIP - the server IP
        thePort - the port number
        cTimeout - seconds to wait for a valid connection
        timeout - value in milli-seconds during normal operation
        Returns:
        a VNCScreen object
      • buildJarFromFolder

        public static boolean buildJarFromFolder​(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)
        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

        public static boolean compileJythonFolder​(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. 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/compiled
        fpTarget - the folder that will contain the copied/compiled stuff (folder is first deleted)
        Returns:
        false if anything goes wrong, true means should have worked