示例#1
0
    def find(self, element=None, id=None, name=None, link_text=None,
             partial_link_text=None, css=None, xpath=None, tag_name=None,
             timeout=None, wait_displayed=None, highlight=None) -> ExtendedRemoteWebElement:
        """Find a WebElement

        Search criteria:
        The first argument must be: an element tuple, a CSS string,
        an XPath string, or a WebElement object.
        Keyword search criteria: id, name, link_text, partial_link_text,
        css, xpath, tag_name.
        Only one search criteria should be provided.

        Other args:
        - timeout: timeout (in seconds) to wait for element to be present.
                   by default it uses the *search_timeout* setting value
        - wait_displayed: wait for element to be displayed (visible).
                          by default uses the *wait_displayed* setting value

        :Usage:
            driver.find('div#someId > input.class')
            driver.find(('id', 'someId'))
            driver.find(id='someId')
            driver.find(xpath='//div/input', timeout=5, wait_displayed=True)

        :Returns:
          a golem.webdriver.extended_webelement.ExtendedRemoteWebElement
        """
        return common._find(self, element, id, name, link_text, partial_link_text, css,
                            xpath, tag_name, timeout, wait_displayed, highlight)
示例#2
0
    def find(self, *args, **kwargs) -> 'ExtendedRemoteWebElement':
        """Find a WebElement

        Search criteria:
        The first argument must be: an element tuple, a CSS string or
        a WebElement object.
        Keyword search criteria: id, name, link_text, partial_link_text,
        css, xpath, tag_name.
        Only one search criteria should be provided.

        Other args:
        - timeout: timeout (in seconds) to wait for element to be present.
                   by default it uses the *search_timeout* setting value
        - wait_displayed: wait for element to be displayed (visible).
                          by default uses the *wait_displayed* setting value

        :Usage:
            element.find('div#someId > input.class')
            element.find(('id', 'someId'))
            element.find(id='someId')
            element.find(xpath='//div/input', timeout=5, wait_displayed=True)

        :Returns:
          a golem.webdriver.extended_webelement.ExtendedRemoteWebElement
        """
        if len(args) == 1:
            kwargs['element'] = args[0]
        return _find(self, **kwargs)
示例#3
0
 def find(self, *args, **kwargs):
     if len(args) == 1:
         kwargs['element'] = args[0]
     return common._find(self, **kwargs)