ACTableau.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:AnalyticContainer 作者: DataKitchen 项目源码 文件源码
def _get_link(self, the_link, link_type, link_text):
        try:
            links = self.pydriver.find_elements(By.XPATH, "//%s" % the_link)
        except (NoSuchElementException, StaleElementReferenceException, WebDriverException), e:
            ACLogger.log_and_print_error(
                '_get_link: unable to find type(%s) links in UI, exception=%s' % (link_type, str(e)))
            return False
        clicked_it = False
        for link in links:
            if clicked_it is False and link.text == link_text:
                try:
                    link.click()
                except (NoSuchElementException, StaleElementReferenceException, WebDriverException), e:
                    ACLogger.log_and_print_error(
                        '_get_link: unable to click on type(%s) text(%s) in UI, exception=%s' % (link_type,link_text,str(e)))
                    return False
                finally:
                    clicked_it = True
                    break
        if clicked_it is False:
            ACLogger.log_and_print_error(
                '_get_link: unable to find link %s in UI ' % link_text)
            return False
        time.sleep(2)
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号