utils.py 文件源码

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

项目:automation-design-patterns 作者: paulbodean88 项目源码 文件源码
def get_selenium_driver(browser_name: str) -> Union[Chrome, Firefox]:
    """
    Return the same instance to the Selenium driver.

    :param browser_name: the name of the browser: chrome or mozilla
    :type browser_name: str
    :return: an instance of the required driver.
    :rtype: Union[Chrome, Mozilla]
    """
    if browser_name.upper() == 'CHROME':
        return SingletonFactory.build(Chrome)

    elif browser_name.upper() == 'Mozilla':
        return SingletonFactory.build(Firefox)

    else:
        raise NotImplementedError
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号