def setUpClass(cls): """初始化""" cls.dr = webdriver.Chrome() cls.dr.maximize_window() cls.page = Csadmin_Page(cls.dr) # au2 csadmin cls.page.get('https://awstau-csadmin.aetos.me')
def setUpClass(cls): """初始化""" cls.dr = webdriver.Chrome() cls.dr.maximize_window() cls.page = Csadmin_Page(cls.dr) # 后台 csadmin 登录链接 cls.page.get('https://awstau-csadmin.aetos.me/index.php/Public/login') # 时间戳,用于注册用户名拼接 #cls.time_now = str(datetime.datetime.now().strftime('%m%d%H%M')) # 获取操作数据库的对象 cls.mysql = mysql_client() # 查询数据库中最新注册的用户名 cls.username = cls.mysql.get_data( "SELECT email FROM t_user_account ORDER BY userId DESC limit 1;" )[0][0]
def setUpClass(cls): """初始化""" # cls.dr = webdriver.Chrome() # <--------------------------------后加的 options = webdriver.ChromeOptions() options.add_argument('--disable-extensions') # 隐藏 GUI # options.add_argument('--headless') options.add_argument('--disable-gpu') options.add_argument('--no-sandbox') cls.dr = webdriver.Chrome(executable_path='/usr/bin/chromedriver', chrome_options=options) # 后加的--------------------------------- > cls.dr.maximize_window() cls.page = Csadmin_Page(cls.dr) # MBG cls.page.get('http://csadmin.mbgmarkets.me')
def setUpClass(cls): """初始化""" # cls.dr = webdriver.Chrome() # <--------------------------------后加的 options = webdriver.ChromeOptions() options.add_argument('--disable-extensions') # 隐藏 GUI # options.add_argument('--headless') options.add_argument('--disable-gpu') options.add_argument('--no-sandbox') cls.dr = webdriver.Chrome(executable_path='/usr/bin/chromedriver', chrome_options=options) # 后加的--------------------------------- > cls.dr.maximize_window() cls.page = Csadmin_Page(cls.dr) # 4.2 # cls.page.get('https://awstau-csadmin.aetos.me') # 4.9 BMG cls.page.get('http://awst49-admin.aetos.me/index.php/Public/login')
def setUpClass(cls): """初始化""" # <--------------zalenium cls.dr = webdriver.Remote( command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities={'browserName': 'chrome'}) # zalenium --------------> # cls.dr = webdriver.Chrome() # <--------------------------------非 zalenium # options = webdriver.ChromeOptions() # options.add_argument('--disable-extensions') # # 隐藏 GUI # # options.add_argument('--headless') # options.add_argument('--disable-gpu') # options.add_argument('--no-sandbox') # cls.dr = webdriver.Chrome(executable_path='/usr/bin/chromedriver', chrome_options=options) # 非 zalenium--------------------------------- > cls.dr.maximize_window() cls.page = Csadmin_Page(cls.dr) # MBG cls.page.get('http://csadmin.mbgmarkets.me')