首页 > 编程语言 >Java设计模式之单例设计模式实战代码【多测师】

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

时间:2022-10-26 12:32:13浏览次数:42  
标签:None 多测师 self driver DriverManagment 单例 import 设计模式

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()

 



标签:None,多测师,self,driver,DriverManagment,单例,import,设计模式
From: https://blog.51cto.com/u_15846941/5797813

相关文章