使用 CSV 数据集配置元素读取 Excel 文件
Read Excel file with CSV Data Set Config Element
我正在 JMeter 上构建一个项目,我想读取一个带有 CSV 数据集配置的 Excel 文件,以避免使用 Groovy 来读取它。
你知道这是否可能吗?如果没有,任何其他 JMeter 元素都可以帮助我逐行阅读 Excel 文件?
非常感谢,
此致,
CSV Data Set Config is only able to read text files, as per Wikipedia:
A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values.
如果您的数据文件是像 .xls or .xslx 这样的二进制文件,不幸的是 CSV 数据集配置将无济于事,您有以下选择:
Export .xls or .xlsx file to CSV using MS Excel 或同等学历
如果出于任何原因您无法使用第 1 点,您可以阅读 Apache POI libraries to read the Excel file formats in JSR223 Test Elements like it's described in How to Implement Data Driven Testing in your JMeter Test 文章。
您还可以查看 Busy Developers' Guide to HSSF and XSSF Features 一些代码片段,其中涉及 reading/writing 数据 from/to Excel 文件
我正在 JMeter 上构建一个项目,我想读取一个带有 CSV 数据集配置的 Excel 文件,以避免使用 Groovy 来读取它。
你知道这是否可能吗?如果没有,任何其他 JMeter 元素都可以帮助我逐行阅读 Excel 文件?
非常感谢,
此致,
CSV Data Set Config is only able to read text files, as per Wikipedia:
A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values.
如果您的数据文件是像 .xls or .xslx 这样的二进制文件,不幸的是 CSV 数据集配置将无济于事,您有以下选择:
Export .xls or .xlsx file to CSV using MS Excel 或同等学历
如果出于任何原因您无法使用第 1 点,您可以阅读 Apache POI libraries to read the Excel file formats in JSR223 Test Elements like it's described in How to Implement Data Driven Testing in your JMeter Test 文章。
您还可以查看 Busy Developers' Guide to HSSF and XSSF Features 一些代码片段,其中涉及 reading/writing 数据 from/to Excel 文件