1、爬取禅道上的测试用例

from time import sleep

from selenium import webdriver

import xlwt

CaseNo = 1
# 创建一个workbook 设置编码
workbook = xlwt.Workbook(encoding='utf-8')
# 创建一个worksheet
worksheet = workbook.add_sheet('测试用例', cell_overwrite_ok=True)
worksheet.write(0, 0, label='用例编号')
worksheet.write(0, 1, label='所属产品')
worksheet.write(0, 2, label='所属模块')
worksheet.write(0, 3, label='前置条件')
worksheet.write(0, 4, label='用例类型')
worksheet.write(0, 5, label='测试标题')
worksheet.write(0, 6, label='测试步骤')
worksheet.write(0, 7, label='预期结果')
worksheet.write(0, 8, label='编制人员')
sleep(2)
# option = webdriver.ChromeOptions()
# option.add_argument('headless')
# a = webdriver.Chrome(chrome_options=option)
a = webdriver.Chrome()
a.maximize_window()
a.get('http://xxx.xx.xxx.xxx/zentao/user-login.html')
a.find_element_by_id

你可能感兴趣的:(工作相关)