def setUp(self): print("start"), self.browser = webdriver.Chrome() # self.browser = webdriver.Chrome(executable_path='/Users/xuzhen/chromedriver') sleep(3) Login.user_login(self.browser) sleep(5)
def test_login(self): username = '******' password = '******' loginService = Login() loginService.user_login(self.driver, username, password) self.driver.quit()
from selenium import webdriver from public import Login driver=webdriver.Chrome() driver.implicitly_wait(10) driver.get("http://www.acmcoder.com/index") loginService = Login() #调用登陆模块 loginService.user_login(driver) #调用退出模块 loginService.user_logout(driver)
from selenium import webdriver from public import Login driver = webdriver.Chrome() driver.implicitly_wait(10) driver.get('http://www.126.com') Login.user_login(driver) Login.user_logout(driver)
# encoding=utf-8 from selenium import webdriver from public import Login driver = webdriver.Firefox() driver.get('http://www.126.com') # 调用登录模块 Login.user_login() # 写信,删除信,收信 # ................. # 调用退出模块 Login.user_logout()