Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

LoadRunner performance testing adds things

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Transaction is used to simulate a relatively complete and meaningful business operation of a user, such as login, query, transaction, and money transfer, which can be used as a transaction, rather than each HTTP request as a transaction.

Take the mailbox system tested by the author as an example, the more basic application for mailboxes and the most frequently used by users is the function of sending and receiving emails. we can regard sending and sending email as a transaction: open the letter page, fill in the recipient, subject, content, click to send the message. When doing the performance requirements analysis, the business of the system is extracted and described as transactions in the performance script.

During the recording of the script, we can add transactions through the transaction button of the recording panel.

Also take loadrunner with WebTours as an example, the steps are as follows:

1. Type the home page of WebTours

2. Click the transaction start button and enter "login"

3. Enter the user name and password and click the login button

4. Click the transaction end button to make sure. (note: the names of the beginning and end of the transaction must be the same)

The script is as follows:

Action () {web_url ("WebTours", "URL= http://127.0.0.1:2080/WebTours/"," Resource=0 "," RecContentType=text/html "," Referer= "," Snapshot=t3.inf "," Mode=HTML ", EXTRARES," Url=../favicon.ico "," Referer= ", ENDITEM, LAST) Lr_start_transaction ("login") / / transaction start function web_submit_data ("login.pl", "Action= http://127.0.0.1:2080/WebTours/login.pl"," Method=POST "," Referer= http://127.0.0.1:2080/WebTours/nav.pl?in=home", "Mode=HTML", ITEMDATA, "Name=userSession", "Value=110409.949777238fzHQcVVpHQVzzzzHDtAHfpcHAHf", ENDITEM, "Name=username") "Value=test", ENDITEM, "Name=password", "Value=123456", ENDITEM, "Name=JSFormSubmit", "Value=on", ENDITEM, LAST) Web_submit_data ("login.pl_2", "Action= http://127.0.0.1:2080/WebTours/login.pl"," Method=POST "," RecContentType=text/html "," Referer= http://127.0.0.1:2080/WebTours/nav.pl?in=home", "Snapshot=t4.inf", "Mode=HTML", ITEMDATA, "Name=userSession" "Value=110409.949777238fzHQcVVpHQVzzzzHDtAHfpcHAHf", ENDITEM, "Name=username", "Value=test", ENDITEM, "Name=password", "Value=123456", ENDITEM, "Name=JSFormSubmit", "Value=on", ENDITEM, "Name=login.x", "Value=51", ENDITEM, "Name=login.y", "Value=12", ENDITEM, LAST) Lr_end_transaction ("login", LR_AUTO); / / transaction end function return 0;}

View the running results:

Action.c (15): Notify: Transaction "login" started.Action.c (17): web_submit_data ("login.pl") was successful, 795 body bytes, 225 header bytes [MsgId: MMSG-26386] Action.c (29): web_submit_data ("login.pl_2") was successful, 795 body bytes, 225 header bytes [MsgId: MMSG-26386] Action.c (45): Notify: Transaction "log in to ended with" Pass "status (Duration: 0.5704 Wasted Time: 0.0152).

From the running results, we can clearly see that the transaction is pass, the duration of the entire script and the elapsed time of the transaction.

The method of inserting the transaction:

The insert transaction can be performed during or after the recording of the script. You can find the part of the script where you need to add a transaction and insert it directly:

Lr_start_transaction ("transaction")

.

Lr_end_transaction (transaction, LR_AUTO)

Note: 1. The start and end functions must appear in pairs.

2. the name of the transaction must be the same.

Of course, we can also position the mouse where we want to insert the transaction and insert it through the menu bar (insert--- > start transaction/end transaction)

By now, some of the basic settings of the loadrunner script have been introduced. You wonder if there is a very important concept missing, parameterization.

The detailed explanation of LoadRunner parameterization has been introduced and will not be repeated here.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report