Why record a script

  1. In Web testing, the steps are too tedious and there are a lot of repeated steps, and manual script writing in JMeter wastes a lot of time.
  2. Too many page jumps, sometimes also need to take the previous page information, manual script is too complicated;
  3. The recording script is easy to operate, which simplifies the process from packet capture to script writing and greatly saves test time.

Two, JMeter script recording three methods

1. Record the script using JMeter proxy mode

  • Go to File –> Templates

  • Select the Recording

  • To set the port number, click Start

  • Open Internet Explorer, choose Settings > Internet Options > Connections > LAN Settings > Proxy Server, select use a proxy server for your LAN, and enter the local IP address 127.0.0.1 and port 8888

  • Perform operations in Internet Explorer
  • Click Stop to finish recording

  • Open JMeter and look. All operations have been recorded

2. Record the script using Badboy

Download it from badboy.en.softonic.com/

  • Open a Badboy

  • Enter the URL of the site you want to test in the address bar and click the red dot in the upper right corner to start recording (recording by default)

  • Click the red dot in the upper right corner after recording
  • Go to File->Export to JMeter and save as a JMeter script
  • Open JMeter and import the recorded script

3. Record the script using Blazemeter

Download address: chrome.google.com/webstore/de…

  • Click on the red dot to start recording the script (note: Before using Blazemeter to start recording, click on the upper right corner to sign in)

  • Open the page that you want to test and perform operations

  • Click stop recording when finished

  • Click Save –>JMeter(JMX)–> Save to save the recorded script

  • Open JMeter and import the recorded script

The advantages and disadvantages of the three script recording methods

1. JMeter proxy mode recording script

advantage

  • Scripts can be recorded and used using JMeter without downloading other software/plug-ins;
  • For multiple browsers (including Postman), you only need to configure the proxy.

disadvantage

  • More complex than a script recording tool;
  • The recording request is messy and not clear enough;
  • Easy to record some irrelevant requests;
  • Unable to record cookies, for website scripts, most need cookies support;

2. Record the script using Badboy

advantage

  • Do not need to configure the proxy, directly enter the URL can operate, more convenient and simple;
  • You can export the JMeter script directly;
  • Recorded scripts are more organized than JMeter agent recordings;
  • This parameter can be configured

disadvantage

  • The version of the built-in Internet Explorer is too early to modify the browser.
  • Sometimes recording is slow, especially when there are pop-ups;
  • There are omissions or conversion errors when converting to JMeter scripts;

3. Record the script using Blazemeter

advantage

  • Open Google browser to start recording, easy to operate;
  • JMeter scripts and Selenium scripts can be exported directly.
  • The recorded script is clear and organized and easy to read;

disadvantage

  • You need to download and register in Google Store to use it;
  • You can only record scripts in Chrome, not in other browsers.

Nanjing 300 Cloud Information Technology Co., LTD. (CHE 300) was founded on March 27, 2014. It is a mobile Internet enterprise rooted in Nanjing and currently located in Nanjing and Beijing. After 7 years of accumulation, the cumulative number of valuation has reached 5.2 billion times, and won the favor of many high-quality investment institutions at home and abroad, such as Sequoia Capital, SAIC Industry Fund. 300 Cloud is an outstanding domestic auto transaction and financial SaaS service provider with independent third party relying on artificial intelligence and standardization of auto transaction pricing and auto financial risk control as its core products.

Welcome to join 300 cloud, witness the booming development of the automobile industry together, look forward to walking with you hand in hand! Official website: www.sanbaiyun.com/ Email: [email protected]