企业微信实战(一)作业帖

企业微信实战一,罗海龙
https://github.com/lhlgxyf33/Lagou2QiHomework.git

王明哲企业微信实战一
https://github.com/WMZ5123/webdriver/tree/master/test_selenium

刘伟-企业微信01-作业
https://github.com/huanxingshi01/python04.git

企业微信01-作业-钱语歌
https://github.com/echoqyg/lagouproject/tree/master/test_selenium

https://github.com/yanbin0424/test_cookie

王小刚作业:
https://github.com/yuguo100tianqing/lagou2qiprj/commit/fc3562abb25b2f067fd75fff526e591ebf6c3340

张立雨087646作业
https://github.com/en-one/cekai_pythoncode/tree/master/web%20企业微信实战一

刘羽 企业微信实战一
https://github.com/elsa-liu/lagou2QProject/tree/master/pythoncode/work_weixin_homework/workweixin_1

https://github.com/haiqing999/test_selenium01.git

https://github.com/zhangwanli-marker/Lagouzuoye/tree/master/web/Testcase_wx

贾潇冰-作业

作业一,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

企业微信实战一
https://github.com/sidneyharris/untitled

窦晖_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()

浏览器复用:
https://github.com/xiaotang0531/xiaotanghomework/blob/master/test_selenium/test_copybrowser.py

使用cookie登录:
https://github.com/xiaotang0531/xiaotanghomework/blob/master/test_selenium/test_cookies.py