求助各位大佬!!!!
JMETER中代码如下:
变量传递给参数后变成乱码,用log.info(a)也是乱码,如下:
实际的代码如下,为了从xlxs中读取测试用例,语言是python,工具是jmeter,这样子的结果,请求里面的中文都是乱码(ps:在pycharm中调试正常):
import xlrd
path = vars.get("case_path")
book = xlrd.open_workbook(path)
table = book.sheet_by_index(0)
counter = 1
row_number = table.nrows
col_number = table.ncols
vars.put("row_number",str(row_number - 1))
param_list = []
for c in range(col_number):
param_key = table.cell(0,c).value.encode("utf-8")
param_value = table.cell(counter,c).value.encode("utf-8")
#将参数名与参数值连接一起,组成lists
param_list.append( param_key + "=" + param_value )
vars.put(param_key,param_value)
param_list.sort()
请问解决了吗 遇到同样的问题