def __call__(self, driver):
     try:
         elements = EC._find_elements(driver, self.locator)
         return len(elements) > self.count
     except StaleElementReferenceException:
         print '[-] an Error occured!!'
         return False
Пример #2
0
 def __call__(self, driver):
     try:
         # decides if there are any new tweets on the page
         elements = EC._find_elements(driver, self.locator)
         return len(elements) > self.count
     except selenium.common.exceptions.StaleElementReferenceException:
         return False
Пример #3
0
 def __call__(self, driver):
     elements = [
         element
         for element in EC._find_elements(driver, self.locator)
         if EC._element_if_visible(element)
     ]
     return elements if len(elements) == 2 else False
Пример #4
0
    def __call__(self, driver):
        try:
            elements = EC._find_elements(driver, self.locator)
            new_count = len(elements)

            return new_count > self.init_count

        except StaleElementReferenceException:
            return False
Пример #5
0
 def __call__(self, driver):
     try:
         elements = EC._find_elements(driver, self.locator)
         for elem in elements:
             if self.text in elem.text:
                 return True
         return False
     except StaleElementReferenceException:
         return False
Пример #6
0
 def __call__(self, driver):
     try:
         elements = EC._find_elements(driver, self.locator)
         for elem in elements:
             if self.text in elem.text:
                 return True
         return False
     except StaleElementReferenceException:
         return False
Пример #7
0
 def __call__(self, driver):
     try:
         elements = _find_elements(driver, self.locator)
         visible_elements = []
         for e in elements:
             element_visible = _element_if_visible(e)
             if element_visible:
                 visible_elements.append(element_visible)
         return visible_elements if len(visible_elements) > 0 and len(
             visible_elements) == len(elements) else False
     except StaleElementReferenceException:
         return False
Пример #8
0
    def __call__(self, driver):
        try:
            folders = _find_elements(driver, self.locator)
            for folder in folders:
                # time.sleep(0.25)
                if folder.is_displayed():
                    if folder.text == self.name:
                        return folder

            return False
        except StaleElementReferenceException:
            return False
Пример #9
0
    def __call__(self, driver):
        try:
            folders = _find_elements(driver, self.locator)
            for folder in folders:
                # time.sleep(0.25)
                if folder.is_displayed():
                    if folder.text == self.name:
                        return folder

            return False
        except StaleElementReferenceException:
            return False
 def __call__(self, driver):
     try:
         elements  = EC._find_elements(driver, self.locator)
         for element in elements:
             attribute = element.get_attribute(self.attribute)
             if attribute == self.value:
                 return True
             
         return False
     except StaleElementReferenceException:
         log.exception()
         return False
Пример #11
0
 def __call__(self, driver):
     try:
         count = len(EC._find_elements(driver, self.locator))
         return count > self.count
     except StaleElementReferenceException:
         return False
Пример #12
0
 def __call__(self, driver):
   elements = [element for element in EC._find_elements(driver, self.locator) if EC._element_if_visible(element)]
   return elements if len(elements) == 2 else False
Пример #13
0
 def __call__(self, web_driver):
     try:
         elements = EC._find_elements(web_driver, self.locator)
         return len(elements) > self.count
     except StaleElementReferenceException:
         return False
Пример #14
0
 def __call__(self, driver):
     try:
         elements = EC._find_elements(driver, self.locator)
         return len(elements) > self.count
     except:
         return False
 def __call__(self, driver):
     try:
         elements = EC._find_elements(driver, self.locator)
         return len(elements) > self.count
     except StaleElementReferenceException:
         return False
 def __call__(self, driver):
     elems = expected_conditions._find_elements(driver, self.locator)
     if elems is not None and len(elems) > 1:
         return True
     else:
         return False