CN110336717A - A method of it recording HTTP operation requests and automatically generates performance test script - Google Patents

A method of it recording HTTP operation requests and automatically generates performance test script Download PDF

Info

Publication number
CN110336717A
CN110336717A CN201910740435.2A CN201910740435A CN110336717A CN 110336717 A CN110336717 A CN 110336717A CN 201910740435 A CN201910740435 A CN 201910740435A CN 110336717 A CN110336717 A CN 110336717A
Authority
CN
China
Prior art keywords
http
script
operation requests
jmeter
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910740435.2A
Other languages
Chinese (zh)
Inventor
张兰
常清雪
肖建
廖雷
马小勤
徐曼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201910740435.2A priority Critical patent/CN110336717A/en
Publication of CN110336717A publication Critical patent/CN110336717A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of methods that recording HTTP operation requests automatically generate performance test script, the HTTP operation requests of web application are recorded using http proxy server as system proxy server and by remotely connecting in a manner of record the HTTP operation requests of mobile APP, and record all HTTP requests, script file is saved as according to the HTTP operation requests that screening and filter condition filter out needs, script file is opened in LoadRunner and JMeter automatically parses generation LoadRunner and JMeter pressure survey script, after http proxy server exits, it is automatically logged out agency.Method of the invention is easy to operate to be not necessarily to manual setting, and LoadRunner and JMeter pressure can be quickly generated and survey script, it effectively solves the problems, such as that manual setting agency is needed just to can be carried out recording and need to manually log off browser agent after recording in LoadRunner or JMeter of the existing technology.

Description

A method of it recording HTTP operation requests and automatically generates performance test script
Technical field
The present invention relates to software performance test technical field, in particular to a kind of automatically generating property of recording HTTP operation requests The method of energy test script.
Background technique
All sectors of society has been spread in web application, mobile APP, has brought convenience to people's lives, is applied using web It is more and more with the user of mobile APP and frequency is higher and higher, it is also more next to the performance requirement of web application, mobile APP accordingly It is higher.A large number of users is simulated using LoadRunner JMeter software concurrently at present while the mode accessed carrys out feasibility It can test, the performance of evaluation system is carried out with the result data of performance test, understands the reliability and stability of system.
There are the compatibility issue of browser, different LoadRunner versions when recording web application by LoadRunner The browser version of support is also different, such as: LordRunner12 is supported to Internet Explorer 11, Chrome version The recording of 30 and Firefox version 23 is recorded using Internet Explorer, the other versions of Chrome, Firefox When need to make proxy settings and can just record.LoadRunner12 records the process of web script to the browser that do not support: beating The Virtual User Generator- > new script for opening Loadrunner12 selects Web (HTTP/HTML) in pop-up box Then agreement clicks creation button -> pop-up start Recording window, selects corresponding recording type (Internet Applications), browser is selected, selection needs the address web to be tested, selects browser installation addresses, and click is recorded and set It sets button, selects network to carry out the setting of LoadRunner proxy server -> in agency and menu is set, click newly-increased button, bullet Increase proxy server newly out and the page be set, above input system server address (IP or domain name do not have to write http: //) and Port numbers, Service Id selects http and listening port number, after being provided with, clicks confirming button, LoadRunner generation Reason be provided with -> carry out browser agent setting again, browser agency be arranged the page, input the machine address (127.0.0.1) and port numbers, the listening port number that need to ensure to be arranged in the port numbers and LoadRunner is consistent -> It after LoadRunner12 agency is provided with browser agent, clicks and records button, dialog box, IE Path selection are recorded in pop-up Wplus_init_wsock.exe file of the proxy server of LR under LoadRunner12 installation directory under bin catalogue -> set It is clicked after the completion of setting and records button, pop up recording interface and proxy server.It can be in incompatible clear of LoadRunner12 It lookes on device and inputs the server address that you need to record, start to execute the operation to be recorded in a browser, LoadRunner is opened After beginning recording -> recording, clicking terminates to record, and closes the agency of browser, not so will cause the consequence that can not enter net.This Sample LoadRunner realizes the function of recording different browsers different editions browser by agency.
The process of JMeter recording web script: JMeter, addition " http proxy server " -> configuration HTTP Proxy are opened After server -> " starting " button starting HTTP Proxy -> configuration browser agency -> Jmeter and browser agent are set up, Start to execute the operation to be recorded in a browser, JMeter starts only to close agency service just after recording -> recording stops Webpage can be opened.
LoadRunner realize support all browsers record and Jmeter realize recording function require setting act on behalf of into The recording of row Http script, LoadRunner/JMeter record script by the way of agency, and the data of client request can be first It is dealt into proxy server (transcripter), transcripter forwards the data to server end;The response data of server end first issues record Device processed, then responds to client by transcripter.
The content for script that LoadRunner and JMeter is recorded is all request datas of web page, a web page meeting There are multiple HTTP request datas, these data include the static requests such as dynamic requests and js, css, jpg;Ability after recording It checks script and the script recorded is optimized, delete unwanted request.Therefore LoadRunner and JMeter is recorded There are problems that when script manual setting agency it is complicated for operation and can not real time inspection record situation, and record after the completion of need Cancel the agency of browser manually.
Summary of the invention
It is insufficient the purpose of the present invention is overcoming in above-mentioned background technique, a kind of recording HTTP operation requests are provided and are automatically generated The method of performance test script, manual setting agency it is complicated for operation and can not real time inspection record situation aiming at the problem that, with And manually cancel browser agency problem, method of the invention be it is a kind of can rewrite automatically HTTP Proxy record HTTP operation foot The method that browser agent is automatically logged out after this, this method is easy to operate, and can quickly generate LoadRunner and JMeter pressure Power test script.
In order to reach above-mentioned technical effect, the present invention takes following technical scheme:
A method of it recording HTTP operation requests and automatically generates performance test script, comprising the following steps:
A. it opens and records program, listening port is set;
B. browser default uses System Agent or setting mobile phone wifi agent, wherein browser agent and agency service The agent address and listening port of device are consistent;
C. start http proxy server, act on behalf of and start as local system;
D. HTTP request is recorded, test application is opened and carries out clicking operation, program is recorded and grabs and record application HTTP operation requests data;
E. screen and filter HTTP request selection;
F. playback has the script of remarks;
G. it selects all with remarks and the successful request data of playback, script is saved with certain format;
H. recording program is exited, agency is automatically logged out, it is 0 that ProxyEnable value in registration table, which is arranged on windows,;
I. script file is opened in LoadRunner12 or JMeter, automatically parses generation pressure and surveys script.
It further, is specifically that listening port is set as not used port numbers when listening port is set in the step A.
It further, is specially the host name for the mobile phone wifi agent set in the step B, when mobile phone wifi agent is set The IP address of computer where http proxy server, port numbers are to record the listening port number of program setting.
Further, the step E is specially all HTTP requests for record, according to domain name, type and returns to shape State code is filtered, the record that only display needs, and the operation requests needed is selected to record and add remarks, and record HTTP is accordingly grasped Make title and sequence.
Further, the step F is specially in the HTTP request sequence for recording program, and selection has the request of remarks And played back by operation order, check the correctness of script.
Further, it in the step G, if desired opens in loadrunner and is then protected with the document form of saz format It deposits;If desired opening in JMeter selects derived type for JMeter, with the preservation of jmx file format.
Further, the step I specifically: the file that saz format is opened in LoadRunner12 automatically generates The test script that LoadRunner can be identified;Jmx script file is opened in JMeter automatically generates the survey that JMeter can be identified Training sheet.
Compared with prior art, the present invention have it is below the utility model has the advantages that
The method that recording HTTP operation requests of the invention automatically generate performance test script, is made with http proxy server The HTTP operation requests of web application are recorded for system proxy server and record mobile APP's by way of remotely connecting HTTP operation requests, and all HTTP requests are recorded, the HTTP operation requests of needs are filtered out according to screening and filter condition Save as script file, in LoadRunner and JMeter open script file automatically parse generate LoadRunner and JMeter pressure surveys script, after http proxy server exits, is automatically logged out agency, and this method is easy to operate to be not necessarily to manual setting, And can quickly generate LoadRunner and JMeter pressure survey script, effectively solve LoadRunner of the existing technology or It needs manual setting agency just to can be carried out recording in JMeter and needs the problem of manually logging off browser agent after recording.
Detailed description of the invention
Fig. 1 is the method flow schematic diagram that recording HTTP operation requests of the invention automatically generate performance test script.
Specific embodiment
Below with reference to the embodiment of the present invention, the invention will be further elaborated.
Embodiment:
Embodiment one:
As shown in Figure 1, a kind of method recorded HTTP operation requests and automatically generate performance test script, including following step It is rapid:
Step 1: opening and record program, and listening port is arranged, listening port is specifically set as not used port numbers; Can specifically be ordered by " netstat-ano " can check used port, and listening port number is set as not used port Number, as listening port number is 8888 in the present embodiment.
Step 2: browser default uses System Agent or setting mobile phone wifi agent, wherein records web application It is executed when HTTP operation requests script, browser default records mobile application using System Agent or setting mobile phone wifi agent Shi Ze executes the operation of setting mobile phone wifi agent in this step;
Specifically, the agent address and listening port of browser agent and proxy server are consistent, mobile phone is set It is specially the IP address of computer where the entitled http proxy server of host for the mobile phone wifi agent set, port when wifi agent Number for record program setting listening port number.
Step 3: starting http proxy server is acted on behalf of as local system and is started;It modifies on windows in registration table ProxyServer value, for example http=127.0.0.0.1:8888 and ProxyEnable value be 1.
Step 4: record HTTP request opens test application and carries out clicking operation, records program and grabs and record application HTTP operation requests data.
Step 5: screening and filtering HTTP request selection;Specially for all HTTP requests of record, according to domain name, Type and return status code are filtered, and the record that only display needs selects the operation requests needed to record and add remarks, note Record HTTP corresponding operating title and sequence.
Step 6: playback has the script of remarks;Specially in the HTTP request sequence for recording program, selection is with standby The request of note is simultaneously played back by operation order, checks the correctness of script.
Step 7: selection is all to have remarks and the successful request data of playback, saves script with certain format;If needing It to open in loadrunner and then be saved with the document form of saz format;If desired selection export class is opened in JMeter Type is JMeter, with the preservation of jmx file format.
Step 8: exiting recording program, is automatically logged out agency, ProxyEnable value is in registration table on setting windows 0。
Step 9: opening script file in LoadRunner12 or JMeter, automatically parses generation pressure and surveys script;Specifically For the file for opening saz format in LoadRunner12, the test script that LoadRunner can be identified is automatically generated;? Jmx script file is opened in JMeter automatically generates the test script that JMeter can be identified.
In the practical application of this method, web application is usually browser end/server-side application, this kind of to apply journey Generally by Google, the browsers such as red fox are run sequence;And browser and server is communicated based on http protocol; Mobile application is typically also to be interacted by HTTP and background service, therefore can be worked with http proxy server form Program, allow data to pass through from proxy server, realize monitor and be truncated to the purpose of data to record HTTP operation requests.
When proxy server as HTTP, listening port number is arranged in the program to be worked in the form of http proxy server, Proxy server passes through all HTTP operations of listening port monitor log;Http proxy server program and browser are mounted in this It on electromechanical brain, that is, needs to monitor all HTTP request datas in the machine, the IP of the machine is 127.0.0.1;The generation of HTTP Reason server is started in the form of System Agent, and the value that can modify the ProxyServer on windows in registration table automatically is HTTP =127.0.0.1: listening port number and ProxyEnable value are 1, indicate to enable proxy server.Http proxy server is wanted The HTTP request data for grabbing mobile application can be realized by way of remotely connecting and record HTTP operation requests.In mobile phone Wifi agent is set in the network of end, the IP address of computer, end where the entitled http proxy server program of proxy server host Slogan is listening port number, is achieved that long-range connection after being arranged in this way.
After starting http proxy server, general browser default is arranged using System Agent, if the generation of browser Reason setting had been modified, then needed to be rearranged into and be arranged using System Agent, the agency of such browser will be automatically made The agent address and listening port of proxy server realize the HTTP Proxy of the listening port number in the machine, such agency service Device can monitored data.
Proxy server with browser, perhaps establish after connection browser or mobile application and take to target by mobile application The request that business device is sent can all pass through proxy server, and hereafter all HTTP requests can all be asked by this proxy server Forwarding is asked, and records all HTTP requests.Each HTTP request all includes request data and response data, according to domain name, Type returns to status code and is filtered the record that display needs, then screens the HTTP requests of needs and save as script file, Script file is opened in LoadRunner or JMeter automatically parses generation LoadRunner or JMeter pressure survey script. Agency can be automatically logged out by acting on behalf of after web server exits, be 0 by ProxyEnable value in registration table on modification windows Mode does not enable proxy server to nullify agency, thus will not influence other program
It is understood that the principle that embodiment of above is intended to be merely illustrative of the present and the exemplary implementation that uses Mode, however the present invention is not limited thereto.For those skilled in the art, essence of the invention is not being departed from In the case where mind and essence, various changes and modifications can be made therein, these variations and modifications are also considered as protection scope of the present invention.

Claims (7)

1. a kind of method recorded HTTP operation requests and automatically generate performance test script, which comprises the following steps:
A. it opens and records program, listening port is set;
B. browser default uses System Agent or setting mobile phone wifi agent, wherein browser agent and proxy server Agent address and listening port are consistent;
C. start http proxy server, act on behalf of and start as local system;
D. HTTP request is recorded, test application is opened and carries out clicking operation, records the HTTP behaviour that program grabs and records application Make request data;
E. screen and filter HTTP request selection;
F. playback has the script of remarks;
G. it selects all with remarks and the successful request data of playback, script is saved with certain format;
H. recording program is exited, agency is automatically logged out, it is 0 that ProxyEnable value in registration table, which is arranged on windows,;
I. script file is opened in LoadRunner12 or JMeter, automatically parses generation pressure and surveys script.
2. a kind of method recorded HTTP operation requests and automatically generate performance test script according to claim 1, special Sign is, is specifically that listening port is set as not used port numbers when listening port being arranged in the step A.
3. a kind of method recorded HTTP operation requests and automatically generate performance test script according to claim 1 or 2, It is characterized in that, is specially the host entitled HTTP generation for the mobile phone wifi agent set in the step B, when mobile phone wifi agent is set The IP address of computer where managing server, port numbers are to record the listening port number of program setting.
4. a kind of method recorded HTTP operation requests and automatically generate performance test script according to claim 3, special Sign is that the step E is specially all HTTP requests for record, is carried out according to domain name, type and return status code Filter, the record that only display needs select the operation requests needed record and add remarks, record HTTP corresponding operating title and suitable Sequence.
5. a kind of method recorded HTTP operation requests and automatically generate performance test script according to claim 4, special Sign is that the step F is specially in the HTTP request sequence for recording program, and request of the selection with remarks is simultaneously suitable by operating Sequence is played back, and checks the correctness of script.
6. a kind of method recorded HTTP operation requests and automatically generate performance test script according to claim 5, special Sign is, in the step G, if desired opens in loadrunner and is then saved with the document form of saz format;If desired exist Opening in JMeter selects derived type for JMeter, with the preservation of jmx file format.
7. a kind of method recorded HTTP operation requests and automatically generate performance test script according to claim 6, special Sign is, the step I specifically: the file that saz format is opened in LoadRunner12 automatically generates LoadRunner energy The test script of identification;Jmx script file is opened in JMeter automatically generates the test script that JMeter can be identified.
CN201910740435.2A 2019-08-12 2019-08-12 A method of it recording HTTP operation requests and automatically generates performance test script Pending CN110336717A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910740435.2A CN110336717A (en) 2019-08-12 2019-08-12 A method of it recording HTTP operation requests and automatically generates performance test script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910740435.2A CN110336717A (en) 2019-08-12 2019-08-12 A method of it recording HTTP operation requests and automatically generates performance test script

Publications (1)

Publication Number Publication Date
CN110336717A true CN110336717A (en) 2019-10-15

Family

ID=68149284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910740435.2A Pending CN110336717A (en) 2019-08-12 2019-08-12 A method of it recording HTTP operation requests and automatically generates performance test script

Country Status (1)

Country Link
CN (1) CN110336717A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817874A (en) * 2021-03-02 2021-05-18 北京字节跳动网络技术有限公司 User interface test method, device, equipment and medium
CN112817699A (en) * 2021-02-23 2021-05-18 汇链通供应链科技(上海)有限公司 Batch deployment automation performance testing method and terminal device
CN112860561A (en) * 2021-02-23 2021-05-28 汇链通供应链科技(上海)有限公司 Automatic performance testing method and terminal device
CN115001991A (en) * 2022-08-02 2022-09-02 北京聚合盈创科技有限公司 Recording method and device based on performance test and storage medium
CN115277511A (en) * 2022-06-23 2022-11-01 安徽希施玛数据科技有限公司 Recording method, recording device, electronic device, and computer-readable storage medium
CN115426407A (en) * 2022-08-30 2022-12-02 北京捷科智诚科技有限公司 Server-side proxy script recording method and system
CN117729253A (en) * 2024-02-18 2024-03-19 上海任意门科技有限公司 Chat scene reproduction method, system, storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103581343A (en) * 2013-11-28 2014-02-12 蓝盾信息安全技术股份有限公司 Http (hyper text transport protocol) request recording method
CN104579822A (en) * 2014-12-10 2015-04-29 华南理工大学 Automatic performance test system and method of mobile application based on Http protocol

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103581343A (en) * 2013-11-28 2014-02-12 蓝盾信息安全技术股份有限公司 Http (hyper text transport protocol) request recording method
CN104579822A (en) * 2014-12-10 2015-04-29 华南理工大学 Automatic performance test system and method of mobile application based on Http protocol

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FIREINWIND: "Jmeter使用之脚本录制回放 转", 《IT610》 *
发条程: "性能测试篇 :Jmeter HTTP代理服务器录制压力脚本", 《博客园》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817699A (en) * 2021-02-23 2021-05-18 汇链通供应链科技(上海)有限公司 Batch deployment automation performance testing method and terminal device
CN112860561A (en) * 2021-02-23 2021-05-28 汇链通供应链科技(上海)有限公司 Automatic performance testing method and terminal device
CN112817874A (en) * 2021-03-02 2021-05-18 北京字节跳动网络技术有限公司 User interface test method, device, equipment and medium
CN115277511A (en) * 2022-06-23 2022-11-01 安徽希施玛数据科技有限公司 Recording method, recording device, electronic device, and computer-readable storage medium
CN115001991A (en) * 2022-08-02 2022-09-02 北京聚合盈创科技有限公司 Recording method and device based on performance test and storage medium
CN115426407A (en) * 2022-08-30 2022-12-02 北京捷科智诚科技有限公司 Server-side proxy script recording method and system
CN115426407B (en) * 2022-08-30 2024-06-07 北京捷科智诚科技有限公司 Recording method and system for proxy script of server
CN117729253A (en) * 2024-02-18 2024-03-19 上海任意门科技有限公司 Chat scene reproduction method, system, storage medium and electronic equipment
CN117729253B (en) * 2024-02-18 2024-05-03 上海任意门科技有限公司 Chat scene reproduction method, system, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN110336717A (en) A method of it recording HTTP operation requests and automatically generates performance test script
CN107402880B (en) Test method and electronic equipment
US10095609B1 (en) Intermediary for testing content and applications
CN102272757B (en) Method for server-side logging of client browser state through markup language
US20060101404A1 (en) Automated system for tresting a web application
US7739282B1 (en) Method and system for tracking client software use
US20170161059A1 (en) Management of multiple application programming interface versions for development environments
JP2008117093A (en) User operation recording/reproducing method and device
CN109800135B (en) Information processing method and terminal
US20020103896A1 (en) HTTP transaction monitor
JP2012008853A (en) Operation reproduction method of web application and system
JP5476326B2 (en) Web operation recording and reproducing method and apparatus
US10331418B2 (en) State machine representation of a development environment deployment process
US20060047496A1 (en) Method, system and program product for recording and replaying target service interaction data
CN107395747B (en) High-expansion method based on STF platform
GB2356783A (en) Monitoring of services provided over a network
Kälber et al. Forensic application-fingerprinting based on file system metadata
CN106776318A (en) A kind of test script method for recording and system
US8819631B2 (en) System and method for self dependent web automation
CN111797340B (en) Service packaging system for user-defined extraction flow
CN103581343A (en) Http (hyper text transport protocol) request recording method
US7765284B2 (en) Dynamically modified, multiple-platform computer programs, and methods and apparatus utilizing same
JP4636775B2 (en) Network monitoring system
US8271879B2 (en) Workstation management application
US10394534B2 (en) Framework for flexible logging of development environment deployment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191015