Analysis and process of conceptual point of performance testing (I.)

Source: Internet
Author: User
Tags ftp protocol

1. Recording method:

The basic process is: protocol selection → set recording options → start recording → insert command → stop recording → replay verification

Protocol selection: According to the framework of the program, such as General, B/S architecture of the program will use the HTTP protocol, of course, there are some FTP protocol, c/S architecture program is likely to use some of the less common protocol so, the agreement to choose this step, the best and for developers to communicate well OK.

To set recording options:

1) , recording preparation matters

Start Recording settings:

Application Type: You can choose the type of object you want to record, Internet applications (the recording object is a web app, browser-based), WIN32 applications (standard client that supports WIN32).

Programs to record: Set the program name that needs to be recorded, the default is IE, it is recommended not to use other three-party browser to record, so as not to appear incompatible, Firefox low version can be compatible, if you often need to record scripts, it is recommended to prepare a low version of the Firefox browser, After all, there are not many browsers that support H5 pages.

URL address: Recorded addresses, such as www.aicai.com.

Working directory: The working directory used to specify the code, which is generally good by default.

Record into Action: sets the location where the recording is stored, Vuser_init, Action, vuser_end it is necessary to note that Vuser_int/vuser_end is initialized only once, that is, no matter how many times the script loops, Each virtual user executes the Vuser_int script and the Vuser_end script separately when starting the script and ending the script. The actual execution of the loop script is the main action, so look at the pressure needs, the general pressure test body will be placed in action, but for example, before the pressure subject needs to log in, but the pressure testing business is not the main pressure test login, will be logged into the vuser_init inside.

2) , recording options

Recording Options settings:

Script: VUser scripts based on the Web (http/html) protocol are standard using the C language.

Protocols: A list of protocols, typically when a script is created, the protocol for recording the script is selected, and then the Protocol list is the protocols contained under the chosen protocol.

Recording: The recording option is used to set the recording mode used by the Web (http/html), html-based script (as the recording level for HTML operations), url-based script (as the HTTP request is the recording level).

These two recording methods can be further described here:

html-based script is the default mode, which can generate a separate function for each user operation. The url-based script captures all HTTP requests sent to the server as a result of user actions, and then records them all. url-based Script mode can even capture non-HTML applications, such as small programs and non-browser applications. Therefore, it can be understood that html-bsed script can be seen as an action-based recording, each operation of a total request, and then the total request contains the action of all requests, such as we click on the first page of this action, the action may contain a lot of pictures, Css,js. And so on, and the requests are included in a request submission. The url-based script can be seen as a URL-based recording method, in which all requests contained in each operation are sent to the server independently of the HTTP request, that is, a click on the first page of the operation, may contain css,js, pictures and more than 30 requests, Then these requests are sent separately in some order, asynchronously loaded.

The script recorded with html-based script is intuitive, easy to understand and maintainable, while the script generated from the url-based script pattern recording will look much larger, splitting a function in HTML into many separate functions, but the script is more scalable, More detailed user action information is logged. So I usually like this pattern after the experience, and this mode with the data we caught in the packet is one by one corresponding. Of course, specifically how to choose in that way is not mandatory, you can follow your own habits, but there are several requests must use Url-based script mode. For example, there is an AJAX commit business operation. The Love lottery uses this kind of submission in a lot of ways.

The choice of which mode should be based on actual needs, here are some common reference principles:

1. Browser-based applications recommend the use of html-based script

2. url-based script is not recommended for browser-based applications

3. If the browser-based application contains Java script and the script sends a request to the server, such as a paging button for the DataGrid, url-based script is recommended;

4. The HTTPS security protocol is used in browser-based applications, and it is recommended to use Url-based script mode for recording.

Date Format Extension: Some common encoding formats are converted for post-processing purposes and can be transcoded for body, Headers, Cookies, Query string four data segments. This piece of general request is directly default.

Port Mapping: Provides a processing rule for port mappings.

Correlation: Automatic association option when you open a script recording.

3), start recording

When the recording options are set, click the OK button to start the recording.

First you will see the recording Bar, then will pop up IE and automatically jump to the set page, followed by the normal operation of the page function operation, and LR will convert the operation process into one submission request.

4), insert command

You can add some commands through recording bar during the recording process. such as slicing a script, adding the start and end points of a transaction, adding a collection point, adding a comment, and so on, as needed, as appropriate, has no relevance or impact on the scripting business.

5), End recording

After recording is complete, click Stop to stop recording, the client and server interaction protocols are placed inside the generation log, and Vugen will then parse the protocol interaction to generate the script.

Reprint to: (Owenhe Source: http://www.cnblogs.com/7test/articles/4778743.html)

Analysis and process of conceptual point of performance testing (I.)

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.