Beispiel #1
0
    def wait_until_absent(self, *, fargs=None, **kwargs):
        '''
            Wait until a **GuiWidget** is absent inside this GuiElement.

            Keyword Arguments:
                fargs: A dictionary of key-value pairs for formatting the **GuiWidgetDefinition**. Use **.format(**kwargs).wait_until_absent** for more Pythonic code when formatting.
                **kwargs: Arbitrary key-value pairs used to construct a **GuiWidgetDefinition**

            Note:
                By default Wait is done until **ArjunaOption.GUIAUTO_MAX_WAIT** in the **Configuration** object associated with this **GuiElement**.

                You can pass **max_wait** argument to change this. Value is considered in seconds.
        '''
        from arjuna.tpi.guiauto.meta.locator import GuiWidgetDefinition
        wmd = GuiWidgetDefinition(fmt_args=fargs, **kwargs)._as_wmd()
        self._wait_until_absent(wmd)
Beispiel #2
0
    def locate(self, type="element", **kwargs):
        '''
            Locate a GuiWidget.

            Keyword Arguments:
                type: type of GuiWidget (element, multi_element, dropdown, radio_group)
                **kwargs: Arbitrary key-value pairs used to construct a **GuiWidgetDefinition**

            Returns:
                An object of type `GuiWidget`. Exact object type depends on the value of **type** attribute. 

            Note:
                The format key-value pairs of this `GuiWidgetDefinitionFormatter` are used to format the identifiers in the constructed **GuiWidgetDefinition**.
        '''
        return self.__creator.locate(
            GuiWidgetDefinition(type=type, fmt_args=self.__fargs, **kwargs))
Beispiel #3
0
    def __init__(self, gui, wmd, parent=None):
        self.__gui = gui
        self.__wmd = wmd
        self.__automator = gui._automator
        self.__finder = parent and parent or gui
        self._wrapped_main_element = self.__finder._wmd_finder.element(wmd)
        self.__found = False
        self.__options = None
        self.__option_locator = self._wmd.meta.option_locator is not None and self._wmd.meta.option_locator or GuiWidgetDefinition(
            type="multi_element", tags="option")

        # It is seen in some websites like Bootstrap based that both select and options are children of a main div element.
        self.__option_container_same_as_select = self._wmd.meta.option_container_locator is None and True or False
        if not self.__option_container_same_as_select:
            self.__option_container = self.__finder.element(
                self._wmd.meta.option_container_locator)

        self.__source_parser = None

        self.__find()
Beispiel #4
0
 def send_keys(self, key_chord):
     from arjuna.tpi.guiauto.meta.locator import GuiWidgetDefinition
     locator = GuiWidgetDefinition(tags="body")
     body = self.locate(locator)
     body.send_keys(key_chord)
Beispiel #5
0
 def finder(fargs=None, **kwargs):
     locator = GuiWidgetDefinition(type=name, fmt_args=fargs, **kwargs)
     return self.locate(locator)