horizon_test.py 文件源码

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

项目:kolla-kubernetes 作者: openstack 项目源码 文件源码
def getDriver(self):
        count = 0
        while(True):
            try:
                ce = "http://%s:4444/wd/hub" % os.environ["HUB"]
                driver = webdriver.Remote(
                    command_executor=ce,
                    desired_capabilities={
                        "browserName": os.environ.get("browser", "firefox"),
                        "platform": "Linux"
                    }
                )
                return driver
            except WebDriverException as e:
                s = "%s" % e
                print("Got exception %s" % s)
                print("%s" % dir(s))
                if "Empty pool of VM for setup Capabilities" not in s:
                    raise
                time.sleep(5)
            if count == 60:
                raise Exception("Time out trying to get a browser")
            count += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号