WebRunner.py 文件源码

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

项目:PyWebRunner 作者: IntuitiveWebSolutions 项目源码 文件源码
def _wait_for(self, wait_function, **kwargs):
        '''
        Wrapper to handle the boilerplate involved with a custom wait.

        Parameters
        ----------
        wait_function: func
            This can be a builtin selenium wait_for class,
            a special wait_for class that implements the __call__ method,
            or a lambda function
        timeout: int
            The number of seconds to wait for the given condition
            before throwing an error.
            Overrides WebRunner.timeout

        '''
        try:
            wait = WebDriverWait(self.browser, kwargs.get('timeout') or self.timeout)
            wait.until(wait_function)
        except TimeoutException:
            if self.driver == 'Gecko':
                print("Geckodriver can't use the text_to_be_present_in_element_value wait for some reason.")
            else:
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号