Java设计模式之单例设计模式实战代码【多测师】

from selenium import webdriver
from _elementtree import Element
from selenium.common.exceptions import NoSuchElementException


class DriverManagment(object):
    driver = None

    @staticmethod
    def getDriver(self):
        if DriverManagment.driver = None:
            if get_conf_browser() == "Chrome":
                DriverManagment.driver = webdriver.Firefox()
            else if:
                ...

        return DriverManagment.driver

    def closeDriver(self):
        driver.close()
        DriverManagment.driver = None;


driver = DriverManagment.getDriver()

 

posted @ 2020-05-11 21:51  多测师_树哥  阅读(134)  评论(0编辑  收藏  举报