Web interface Test JMeter interface Test Automation second bomb (misguided)

Source: Internet
Author: User

Through the input-by-entry method, it is very easy to test more than dozens of interfaces of more than 300 test cases into the sampler-http request, the fixed test environment run up also

Feel good. Unexpectedly in the new server environment to run the use case, the problem comes: Modify the parameter maintenance script, such as the cost is too big!

Script parameters are written dead, modified to each request to open to enter parameter values, a bit of pit ...

In order to solve this problem, decided to take all the parameters extracted processing, using Excel file to do data-driven, as follows:

1, problem analysis

To do data-driven through an Excel table, you first have to allow JMeter to read the rows and columns specified in the table. Taking into account the personal code ability to catch the urgency, choose to use CSV Data set config

Components. Before using it is the feeling always start reading from the first line of the table, so try to modify the source code so that it can read the specified Excel table row.

2, modify JMeter source code

First look at the CSV Data set config component interface

From the above component interface, there is no function to read the line, in order to enable the CSV Data set config can automatically read the table specified row, referring to the following link method

http://zfy421.iteye.com/blog/2322251, added the ability to read rows for CSV Data set config, such as:

With it you can care how to set up test cases in an Excel or CSV file

3. Design Use Cases

Use case Excel format as shown, there are use case numbers, expectations, parameters, and so on, you can use JMeter to read any row of any column of tabular data,

There seems to be nothing wrong with it.

4. Take a look at the modified test script

Struggled to adjust, but the amount of script did not decrease ...

5. Summary

I would like to be able to detach the test script and test data by reading Excel, this is done, but unfortunately I will read the CSV file line number is dead, causing the back in the old

The inconvenience caused by the change of the line number in the case of the new plus use case. One of the parameters listed in the table is not advisable to try, the interface becomes uneven, the original intention is to let others look

Understand, but also did not bring a reduction in maintenance workload.

Of course I found out later if, saw a new glimmer of light, and decided to re-come.

Web interface Test JMeter interface Test Automation second bomb (misguided)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.