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

How to use Jmeter to record script

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to use Jmeter to record scripts". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "How to use Jmeter to record scripts"!

JMeter is a very popular and popular open source performance testing tool abroad. Like LoadRunner, it also provides a function to record and generate test scripts using a local Proxy Server.

But Jmeter and LoadRunner also have a lot of differences, so let's first take a look at the similarities and differences between the two tools:

1. The architecture of jmeter is the same as that of loadrunner. It is a process of monitoring and collecting instructions discovered by concurrent clients through intermediate agents, generating scripts for them, sending them to application servers, and monitoring the results of server feedback.

2, Jmeter installation is simple, just need to extract the Jmeter file package to C disk can be, in fact, there is no installation. If you want to execute debugging test scripts, you must install jdk and netbean plugins. The LoadRunner installation package has more than 1G, and it takes more than an hour to install on a PC with P3.0 and 1G memory. If you have installed older pirated version can not be installed new version, the solution is there, but trouble and take time.

Jmeter does not have IP spoofing, IP spoofing refers to multiple IP addresses assigned to concurrent users on a PC. This feature is useful for simulating a more realistic customer environment.LoadRunner has this feature.

4. Jmeter also provides a function to record and generate test scripts by using a local Proxy Server, but this function is not easy to use. Individual parameters of the test object have to be manually added, and an IE proxy has to be installed, such as GoogleToolbarDownloader plug-ins to capture parameters. But there is a tool called bodboy that allows you to record actions and then choose to save the script as a Jmeter script, which you can then open and modify

5, Jmeter reports are less, for analysis of test performance is not enough as a basis. If you want to know the CPU, memory and other parameters of the database server or application service, you have to write another script on the relevant server to record the performance of the server.

Jmeter does performance testing, mainly by increasing the number of thread groups, or setting the number of loops to increase concurrent users, while LoadRunner can select what kind of scene to set in the scene, and then select the number of virtual users.

7. Jmeter can implement complex test behaviors through logic controllers, which is equivalent to the test scenarios in LoadRunner.

8. Jmeter can do functional testing of web programs. Using samples in Jmeter, you can do gray box testing. LoadRunner is mainly used for performance testing.

9, Jmeter is open source, but the use of fewer people, the relevant information on the network is not comprehensive, you need to figure it out yourself, and LoadRunner is commercial software, if it is genuine, there is technical support, at the same time, the information on the network is quite a lot.

10, Jmeter script modification, mainly on the familiarity of various components in Jmeter, has been related to the mastery of some protocols, and does not depend on programming, and LoadRunner in addition to complex scene settings, but also need to master the function, modify the script.

In my opinion, Jmeter is more like a Swiss Army knife, small and functional. When I first met Jmeter, I thought it was bad, because compared to LR, it didn't have script recording function, maybe not, but I don't know.

So let's take a look at two ways to record scripts with Jmeter:

The first method: recording scripts via bodboy.

Badboy is a great Web automation tool, and if you use it for non-commercial purposes, or if you use it for commercial purposes but the number of machines installed with Badboy does not exceed 5, you don't have to pay anything for it. Perhaps as a promotional tactic, Badboy provides the ability to export web test scripts directly to JMeter scripts, and this feature is very easy to use and very simple. You can take your first steps in the open source world by following these experimental steps.

1. Open the badboy tool, click the red circle button on the work column, and enter the address of the tested project in the address column.

After recording, click the black button next to the toolbar to end recording.

Select File →Export to Jmeter…

2. Open the Jmeter tool, select File--> Open, select the file (.jmx type) just saved, and import the file.

The second method is to record scripts through JMeter's own settings.

This method was discovered by me (despise my ignorance, hee hee ~!), I think the method is simpler.

1. Open the JMeter tool

Create a thread group (right-click Test Plan---> Add---> Thread Group)

Create an http proxy server (right-click on Desk---> Add---> Non-Test Component---> http proxy server)

The complete setup is shown below:

2. Let's set up IE browser

IE---> Internet Properties---> Connections---> local area network settings

Set it to the local IP. Note that the port number should be consistent with the port number on Jmeter. The default is port 8080.

3. Now click on the "Start" button on jmeter, open the browser and enter the URL of the web project you want to record. jmeter will automatically record the pages you visit in IE.

At this point, I believe everyone has a deeper understanding of "how to use Jmeter to record scripts," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

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

Network Security

Wechat

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

12
Report