Turn: LoadRunner -- block technology

Source: Internet
Author: User

When LoadRunner is used, this problem is often encountered. What should I do if I loop different transactions for different times? By default, LR executes all the transactions in a unified manner. That is, although multiple transactions exist, the number of cycles they are executed is the same, so how does LR implement cycles of different transactions or cycles of different percentages in a script?

Case: In a script, what should I do if I want to implement registration for execution 3 times, login for execution 1 time, and query for execution 2 times? 3 scripts? How many times does each transaction copy in the script? This can solve the problem, but it is not the best solution. LoadRunner provides a solution to the business process, that is, block technology.

First, record the three scripts by using LoadRunner's ticket booking system. After the recording is completed, the script 6-14 contains three services: Registration, login, and query.

Next, set the number of iterations of the three businesses in the script. block technology is used here.

1) choose vuser> Run-time settings. The run-time Settings dialog box is displayed. Select the General> RUN logic tab, as shown in Figure 6-15.

 
(Click to view the large image) Figure 6-14 recording script
 
(Click to view the big chart) Figure 6-15 run logic settings

2) Select Run and insert a block, as shown in Figure 6-16.

3) Select block0 and click the insert action control button. The select actions dialog box is displayed, as shown in Figure 6-17. Select the action to be added and click OK.

 
(Click to view the larger image) Figure 6-16 insert block
 
(Click to view the larger image.) Figure 6-17 adds an action to the block.

4) Repeat the preceding operations to create two blocks, block1 and block2, and insert the corresponding action for the two blocks, as shown in Figure 6-18.

 
(Click to view the larger image) Figure 6-18 block and action are inserted

5) Delete the action outside the block and finally obtain the block Block 6-19.

 
(Click to view the larger image) Figure 6-19 Delete action outside the block

6) set block properties. There are two options: sequential and random. If you select sequential and enter a value in the following iterations, the actions in the block are executed according to the number of inputs. If you select random, you can also set the percentage of actions in the block, as shown in Figure 6-20.

 
(Click to view the larger image) Figure 6-20 block properties settings

According to the preceding case, you only need to set three blocks, insert an action in each block, and set the number of executions to 3, 1, and 2. After the setting is complete, the result is 6-21.

 
(Click to view the larger image) Figure 6-21. The setting ends.

After completing block configuration, the script runs according to the expected business model.

It is worth noting that the total number of business iterations = the number of block iterations × number of iterations, and the number of search iterations in block2 in 6-21 is 2 × 1 = 2, in the end, the search service only iterates twice.

transfer: LoadRunner -- block technology

Related Article

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.