Interface SyriusAbstractionFacade

  • All Superinterfaces:
    AbstractionFacade

    public interface SyriusAbstractionFacade
    extends AbstractionFacade
    This interface defines the methods available when using the Syrius (FX, or Swing) modules.

    Note that a few more available methods are inherited from the generic interface AbstractionFacade.

    • Method Detail

      • isImplicitWaitEnabled

        Boolean isImplicitWaitEnabled()
        Checks whether the "implicit wait" flag is enabled.
        Returns:
        a boolean indicating whether implicit wait is enabled.
      • enableImplicitWait

        void enableImplicitWait​(Boolean enableImplicitWait)
        Sets the "implicit wait" flag. This flags defaults to true, and controls whether agent commands will wait for the UI to finish processing the requested command. The only relevant use case where this flag should be disabled is when the program is to be exited programmatically (e.g. by clicking the "File / Exit" menu item), as in this case there will not be any reaction from the system anymore after invoking the command.
        Parameters:
        enableImplicitWait - status of the "implicit wait" flag to be set.
      • takeScreenshot

        byte[] takeScreenshot()
        Takes a screenshot.
        Returns:
        the screenshot as a byte array, in PNG format.
      • getLastOpenedExternalApplication

        String getLastOpenedExternalApplication()
        Gets the URL of the last application opened by Syrius.
        Returns:
        the URL of the last application opened by Syrius.
      • blockExternalApplication

        void blockExternalApplication​(Boolean block)
        Blocks the opening of external applications.
        Parameters:
        block - whether or not external applications should be blocked.
      • setFileForNextUpload

        void setFileForNextUpload​(String filename)
        Sets the file that is to be used for the next file upload in Syrius.

        This will prevent showing the file upload dialog, instead directly feeding the given file to Syrius, as if the user had selected it in the upload dialog.

        IMPORTANT: This method will prevent exactly one upload dialog and directly set the file instead, afterwards normal Syrius behavior is restored. In other words, if you need to automate multiple file uploads, you will need to call this method multiple times, once before each upload.

        Parameters:
        filename - the name of the file to use for the next upload. It is strongly recommended to use absolute file names.
        Throws:
        RuntimeException - if the given file does not exist, or is not a normal file.
      • getTableColumnIdByHeader

        int getTableColumnIdByHeader​(String tableXpath,
                                     String header)
        Searches a table column by header.
        Parameters:
        tableXpath - the XPath of the table.
        header - the header to be searched.
        Returns:
        the index of the column having the specified header.
      • isEnabled

        boolean isEnabled​(String xpath)
        Checks whether an element is enabled and can be interacted with.
        Parameters:
        xpath - the XPath of the element to check
        Returns:
        true if the XPath matches an enabled element, false otherwise.
      • isVisible

        boolean isVisible​(String xpath)
        Checks whether an element is visible.
        Parameters:
        xpath - XPath of the element to check
        Returns:
        true if the XPath matches exactly one visible element, false otherwise.
      • sendKeys

        void sendKeys​(String xPath,
                      CharSequence... charSequences)
        Sends a sequence of characters to an element.
        Parameters:
        xPath - the XPath of the node to send the keys to.
        charSequences - the character sequences to send to the node. Example for sending Alt + P : sendKeys("/path/to/node", Keys.ALT, "p");
        See Also:
        Keys
      • rightClick

        void rightClick​(String xPath)
        Right clicks an element.
        Parameters:
        xPath - the XPath of the element.
      • doubleClick

        void doubleClick​(String xPath)
        Double clicks an element.
        Parameters:
        xPath - the XPath of the element.
      • click

        void click​(String xPath)
        Clicks an element.

        Note: for MenuItems, please use clickMenuItem() instead.

        Parameters:
        xPath - the XPath of the element.
      • getText

        String getText​(String xpath)
        Returns the textual content of an element.
        Parameters:
        xpath - the XPath of the element.
        Returns:
        the textual content of the element.
      • setText

        void setText​(String xPath,
                     String value)
        Sets the textual content of an element.
        Parameters:
        xPath - the XPath of the element.
        value - the text to be set.
      • getListItems

        List<String> getListItems​(String xPath)
        Gets the items in a list.
        Parameters:
        xPath - the XPath of the list element.
        Returns:
        the items contained in the list.
      • getListSelection

        String getListSelection​(String xPath)
        Gets the currently selected item of a list.
        Parameters:
        xPath - the XPath of the list element.
        Returns:
        the list's currently selected item.
      • setListSelection

        void setListSelection​(String xPath,
                              String value)
        Selects an item in a list.
        Parameters:
        xPath - the XPath of the list element.
        value - the item to be selected.
      • getComboBoxItems

        List<String> getComboBoxItems​(String xPath)
        Gets the items in a combo box.
        Parameters:
        xPath - the XPath of the combo box element.
        Returns:
        a list of all items of the combo box.
      • getComboBoxSelection

        String getComboBoxSelection​(String xPath)
        Gets the currently selected item of a combo box.
        Parameters:
        xPath - the XPath of the combo box element.
        Returns:
        the currently selected item of the combo box.
      • setComboBoxSelection

        void setComboBoxSelection​(String xPath,
                                  String item)
        Selects a combo box item.
        Parameters:
        xPath - the XPath of the combo box element.
        item - the item to be selected in the combo box.
      • getMultiComboItems

        List<String> getMultiComboItems​(String xPath)
        Gets all items of a multi-choice combo box, regardless of selection state.
        Parameters:
        xPath - the XPath of the multi-choice combo box element.
        Returns:
        a list of all items of the element.
      • getMultiComboSelections

        List<String> getMultiComboSelections​(String xPath)
        Gets only the selected items of a multi-choice combo box.
        Parameters:
        xPath - the XPath of the multi-choice combo box element.
        Returns:
        a list of the currently selected items of the element.
      • clearMultiComboSelections

        void clearMultiComboSelections​(String xPath)
        Sets all items of a multi-choice combo box to an unselected state.
        Parameters:
        xPath - the XPath of the multi-choice combo box element.
      • setMultiComboSelection

        void setMultiComboSelection​(String xPath,
                                    String item,
                                    Boolean selected)
        Sets the selection state of a particular multi-choice combo box item.
        Parameters:
        xPath - the XPath of the multi-choice combo box element.
        item - the item whose selection state is to be set.
        selected - the selection state to set.
      • rightClickTableRow

        void rightClickTableRow​(String tableXpath,
                                Integer rowId)
        ❗ Right clicks a table row.

        IMPORTANT: This method is equivalent to calling rightClickTableCell(tableXPath, rowId, 0), and in fact, is implemented as such. In order to keep the API clean and manageable, this method will probably be deprecated soon.

        Therefore, please use rightClickTableCell(String, Integer, Integer) instead.

        Parameters:
        tableXpath - the XPath of the table element.
        rowId - the index of the row to be interacted with.
      • doubleClickTableRow

        void doubleClickTableRow​(String tableXpath,
                                 Integer rowId)
        ❗ Double clicks a table row.

        IMPORTANT: This method is equivalent to calling doubleClickTableCell(tableXPath, rowId, 0), and in fact, is implemented as such. In order to keep the API clean and manageable, this method will probably be deprecated soon.

        Therefore, please use doubleClickTableCell(String, Integer, Integer) instead.

        Parameters:
        tableXpath - the XPath of the table element.
        rowId - the index of the row to be interacted with.
      • clickTableRow

        void clickTableRow​(String tableXpath,
                           Integer rowId)
        ❗ Clicks a table row.

        IMPORTANT: This method is equivalent to calling clickTableCell(tableXPath, rowId, 0), and in fact, is implemented as such. In order to keep the API clean and manageable, this method will probably be deprecated soon.

        Therefore, please use clickTableCell(String, Integer, Integer) instead.

        Parameters:
        tableXpath - the XPath of the table element.
        rowId - the index of the row to be interacted with.
      • getTableSize

        int getTableSize​(String tableXpath)
        Gets the number of rows of a table.
        Parameters:
        tableXpath - the XPath of the table element.
        Returns:
        the number of rows of the table.
      • getTableCellValue

        String getTableCellValue​(String tableXpath,
                                 Integer rowId,
                                 Integer colId)
        Gets the textual content of a table cell.
        Parameters:
        tableXpath - the XPath of the table element.
        rowId - the index of the row.
        colId - the index of the column.
      • rightClickTableCell

        void rightClickTableCell​(String tableXpath,
                                 Integer rowId,
                                 Integer colId)
        Right clicks a table cell.
        Parameters:
        tableXpath - the XPath of the table element.
        rowId - the index of the row to be interacted with.
        colId - the index of the column to be interacted with.
      • doubleClickTableCell

        void doubleClickTableCell​(String tableXpath,
                                  Integer rowId,
                                  Integer colId)
        Double clicks a table cell.
        Parameters:
        tableXpath - the XPath of the table element.
        rowId - the index of the row to be interacted with.
        colId - the index of the column to be interacted with.
      • clickTableCell

        void clickTableCell​(String tableXpath,
                            Integer rowId,
                            Integer colId)
        Clicks a table cell.
        Parameters:
        tableXpath - the XPath of the table element.
        rowId - the index of the row to be interacted with.
        colId - the index of the column to be interacted with.
      • isTabEnabled

        boolean isTabEnabled​(String xPath,
                             String title)
        Checks if a tab exists and is currently selected.
        Parameters:
        xPath - the XPath of the tab (Notebook) element.
        title - the title of the tab to be checked.
        Returns:
        true if the tab exists and is selected, false otherwise.
      • getTabList

        List<String> getTabList​(String xPath)
        Gets a list of tab titles.
        Parameters:
        xPath - the XPath of the tab (Notebook) element.
        Returns:
        the list of tab titles.
      • selectTab

        void selectTab​(String xPath,
                       String title)
        Selects a tab by title.
        Parameters:
        xPath - the XPath of the tab (Notebook) element.
        title - the title of the tab to be selected.
      • clickMenuItem

        void clickMenuItem​(String xPath)
        Clicks a menu item.
        Parameters:
        xPath - the XPath of the menu item element.
      • isSelected

        boolean isSelected​(String xpath)
        Checks whether a checkbox or radiobox is selected.
        Parameters:
        xpath - the XPath of the element.
        Returns:
        true if the element is selected, false otherwise.
      • select

        void select​(String xPath,
                    String value)
        Selects an element in a SelectionPanel.
        Parameters:
        xPath - the XPath of the SelectionPanel element.
        value - the label of the element to be selected.
      • expandAll

        void expandAll​(String xpath)
        ❗ Expands all nodes in a tree.

        ❗ Currently not implemented for Syrius FX.
        Parameters:
        xpath - the XPath of the tree element.