xlrd模块的操作:https://www.jianshu.com/p/f2c9dff344c6
新建一个Excel表格,内容如下:
案例说明:通过Excel数据来定义测试用例的参数。
import xlrd, ddt, unittest, time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def readData():
"读取数据"
book = xlrd.open_workbook(
r"D:\OneDrive\Code\Pycharm_Code\Test_Framework\Test_Automation\selenium3_code\DATA\DataInfo_0304.xlsx", 'r')
table = book.sheet_by_index(0) # 获取第一个sheet
newRows = []
for rowValue in range(1, table.nrows