Today, we use Baidu search to do a single-scenario example of performance index testing. The test data is extracted from files in Excel (CSV) and XML formats. The test files used in this article can be downloaded from here.
Create an Excel file, enter the following data, and save it as a CSV file;
name use selenium Website automation testing appium APP automated testing jmeter Performance Testing Create an XML file, enter the following data, and save it as a file with a .xml suffix;
<?xml version="1.0" encoding="UTF-8"?> <tools> <tool name="qtp" /> <tool name="rtf" /> <tool name="loadrunner" /> </tools>
- Create a new JMeter Test Plan;
Create a new thread group named Data From CSV ;
- Insert a CSV Data Set Config ;
- Filename points to the file to read data, ~/jmeter/keywords.csv
- Insert a BeanShell Sampler* and enter the following in the script;
- Insert a Debug Sampler, keep the default without any modification;
- Insert an Http Request named Search Request ;
- Enter http and www.baidu.com for protocol and service respectively;
- Request type select get ;
- Add a parameter, name and value are p2 , ${name} respectively;
- Insert a View Result Tree.
Create a new thread group named Data From XML ;
- Insert an Http Request named Search Request ;
- Enter http and www.baidu.com for protocol and service respectively;
- Request type select get ;
- Add a parameter, name and value are p2 , ${__XPath(~/jmeter/keywords.xml, /tools/tool/@name)} ;
- Insert a View Result Tree.
- save and run the test plan;
- Enter the View Result Tree nodes of the two thread groups respectively to view the execution results;
- Pay attention to the keywords in the Baidu search request and confirm that they have been correctly initialized before continuing;
- Add a summary report to the first thread group;
- Add an Aggregate Report to the second thread group;
- run the entire test plan again;
- View the average, maximum, response time and other response time data in the Summary Report;
- View median and percentile response time data in the Aggregate Report, along with error rates and more.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。