企业微信实战一,罗海龙
https://github.com/lhlgxyf33/Lagou2QiHomework.git
王小刚作业:
https://github.com/yuguo100tianqing/lagou2qiprj/commit/fc3562abb25b2f067fd75fff526e591ebf6c3340
刘羽 企业微信实战一
https://github.com/elsa-liu/lagou2QProject/tree/master/pythoncode/work_weixin_homework/workweixin_1
贾潇冰-作业
作业一,test_cookie.py
https://github.com/Cat-Zhou/pythonTest/blob/master/selenium_test/test_cookie.py
和test_login_debug.py
https://github.com/Cat-Zhou/pythonTest/blob/master/selenium_test/test_login_debug.py
窦晖_web自动化作业1
https://github.com/latesir/lagouLessonPython/tree/master/autoTest/work_webAutoTest
import json
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
class TestWechatLogin():
def test_debug_login(self):
self.option = Options()
self.option.debugger_address = "localhost:9222"
self.driver = webdriver.Chrome(options=self.option)
self.driver.get("https://work.weixin.qq.com/wework_admin/frame")
WebDriverWait(self.driver, 5).until(expected_conditions.element_to_be_clickable((By.ID, 'menu_index')))
def test_get_cookies(self):
self.driver = webdriver.Chrome()
self.driver.get("https://work.weixin.qq.com/wework_admin/loginpage_wx")
WebDriverWait(self.driver, 15).until(expected_conditions.element_to_be_clickable((By.ID, 'menu_index')))
with open('wxCookies.json', 'w') as f:
json.dump(self.driver.get_cookies(), f)
self.driver.quit()
def test_cookie_login(self):
self.driver = webdriver.Chrome()
self.driver.get("https://work.weixin.qq.com/wework_admin/loginpage_wx")
with open('wxCookies.json', 'r') as f:
cookieList = json.load(f)
for cookie in cookieList:
self.driver.add_cookie(cookie)
while True:
self.driver.refresh()
if WebDriverWait(self.driver, 5).until(expected_conditions.element_to_be_clickable((By.ID, 'menu_index'))):
break
self.driver.quit()