CN112817857A - Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment - Google Patents

Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment Download PDF

Info

Publication number
CN112817857A
CN112817857A CN202110163274.2A CN202110163274A CN112817857A CN 112817857 A CN112817857 A CN 112817857A CN 202110163274 A CN202110163274 A CN 202110163274A CN 112817857 A CN112817857 A CN 112817857A
Authority
CN
China
Prior art keywords
jmeter
jenkins
test
website
automatically monitoring
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
CN202110163274.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.)
Shenzhen Sekorm Component Network Co Ltd
Original Assignee
Shenzhen Sekorm Component Network 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 Shenzhen Sekorm Component Network Co Ltd filed Critical Shenzhen Sekorm Component Network Co Ltd
Priority to CN202110163274.2A priority Critical patent/CN112817857A/en
Publication of CN112817857A publication Critical patent/CN112817857A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment. The method includes the steps that a JMeter test software tool is utilized to simulate a common user to send requests to test a website by adding thread groups, then default protocol types and IP addresses of all requests are configured by adding HTTP request default values, then parameterization setting is carried out by adding variables defined by a user, then whether the result of request response is an expected result is judged by adding test case requests and assertions through a simple controller, finally JMeter test case scripts are executed circularly in fixed frequency time through Jenkins configuration, when a failed test case exists, a mail notification is sent, a detailed test report is returned, and therefore automatic monitoring of website abnormality is completed. The invention can automatically monitor the website abnormity, reduce the labor cost and improve the website monitoring efficiency.

Description

Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment
Technical Field
The invention relates to the technical field of software automation test, in particular to a method for automatically monitoring website abnormity based on JMeter and JenKins and computer equipment.
Background
Various problems are easy to occur along with the increasing complexity, frequent updating iteration and increasing of the user quantity of the website functions, so that the experience of the user is influenced due to the fact that individual page display is abnormal or the functions cannot be normally used. Because the manual testing workload is too large and the automatic monitoring cannot be achieved, an automatic method for monitoring whether the website is normal is needed.
Apache JMeter is a Java-based testing tool developed by the Apache organization. The method can be used for performing interface test, pressure test and performance test on software, and can also be applied to checking element contents of WEB pages. Jenkins is an open source software project, is a continuous integration tool developed based on Java and is used for monitoring continuous and repeated work and enabling continuous and automatic integration of software.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and a computer device for automatically monitoring website abnormality based on JMeter and JenKins, aiming at the above-mentioned defects in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: a method for automatically monitoring website abnormity based on JMeter and Jenkins is constructed, and comprises the following steps:
s101, adding a thread group in a test plan of a JMeter test tool, defining the thread group name of the thread group, wherein the thread attribute of the thread group uses a default value;
s102, adding a configuration element under the thread group: HTTP request default values, including a configuration protocol type, an IP address domain name, and a port number;
s103, adding a configuration element under the thread group: the user-defined variables comprise variable names, variable values and variable descriptions to be used in the configuration test cases;
s104, adding a configuration element under the thread group: an HTTP Cookie manager and an HTTP cache manager;
s105, adding a plurality of logic controllers under the thread group according to the functional module to be tested: a simple controller;
s106, adding a sampler under the simple controller: HTTP request, setting HTTP request method, path and parameter of test page;
s107, adding an assertion under the HTTP request: responding to the assertion, capturing response data returned by the test page request, and selecting a part to be checked to copy and add the part to be checked into the response assertion;
s108, dividing all test pages into corresponding simple controllers according to functional modules, and adding the HTTP request and the response assertion;
s109, adding a monitor under the thread group: viewing fruit bearing trees and an aggregation report;
s110, uploading the compiled Jmeter script to a code management tool Gitlab;
and S111, creating a project in Jenkins, executing the Jmeter script, and generating a test report.
Further, in the method for automatically monitoring website anomalies based on JMETER and JENKINS of the present invention, the step S107 of capturing response data returned by the test page request and selecting a part of copies to be checked to be added to the response assertion includes:
and grabbing response data returned by the test page request through a browser F12 developer tool and selecting a part to be checked to copy and add the part to be checked into the response message.
Further, in the method for automatically monitoring website abnormalities based on JMETER and JENKINS of the present invention, the step S111 includes:
s1111, building a free-style project on a Jenkins management page;
s1112, selecting a Gitlab path for storing the Jmeter script by source code management;
s1113, constructing a trigger, and setting a preset time interval to automatically construct once;
s1114, configuring a construction environment;
s1115, setting a construction mode, setting all success conditions in the construction step, and generating a test report in a preset storage directory after a Jmeter project is constructed.
Further, in the method for automatically monitoring the website abnormality based on JMETER and JENKINS, whether the test report is abnormal or not is judged, and if the test report is abnormal, a reminding message is sent.
Further, in the method for automatically monitoring website abnormalities based on JMETER and JENKINS of the present invention, the determining whether the test report is abnormal includes:
and searching whether all the success rate keywords exist in the test report, wherein the success rate keywords correspond to the success conditions.
Further, in the method for automatically monitoring website abnormality based on JMETER and JENKINS of the present invention, the sending of the reminding information includes:
and sending reminding information through a preset mailbox.
Further, in the method for automatically monitoring website abnormality based on JMETER and JENKINS of the present invention, the preset time interval is 30 minutes.
In addition, the invention also provides computer equipment, which comprises a memory and a processor;
the memory is used for storing a computer program;
the processor is used for executing the computer program stored in the memory to realize the method for automatically monitoring the website abnormity based on JMETER and JENKINS.
The method for automatically monitoring the website abnormity based on JMeter and Jenkins and the computer equipment have the following beneficial effects: the invention can automatically monitor the website abnormity, reduce the labor cost and improve the website monitoring efficiency.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart of a method for automatically monitoring website anomalies based on JMeter and Jenkins according to an embodiment;
fig. 2 is a flowchart of a method for automatically monitoring website abnormalities based on JMeter and JenKins according to an embodiment.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
In a preferred embodiment, referring to fig. 1, the method for automatically monitoring website abnormality based on JMeter and JenKins of this embodiment includes the following steps:
s101, adding a thread group in a test plan of the JMeter test tool, defining the thread group name of the thread group, and using a default value for the thread attribute of the thread group.
S102, adding configuration elements under the thread group: HTTP request defaults including configuration protocol type, IP address domain name and port number.
S103, adding configuration elements under the thread group: and the user-defined variables comprise variable names, variable values and variable descriptions to be used in the configuration test cases.
S104, adding configuration elements under the thread group: an HTTP Cookie manager and an HTTP cache manager.
S105, adding a plurality of logic controllers under the thread group according to the functional module to be tested: and (4) a simple controller.
S106, adding a sampler under a simple controller: and the HTTP request is used for setting an HTTP request method, a path and parameters of the test page.
S107, adding an assertion under the HTTP request: and in response to the assertion, capturing response data returned by the test page request and selecting a part of copy to be checked to be added into the response assertion.
And S108, adding HTTP requests and response assertions in the corresponding simple controllers according to the functional module division of all the test pages.
S109, adding a monitor under the thread group: and checking the fruiting tree and the aggregation report.
And S110, uploading the written Jmeter script to a code management tool Gitlab, and recording a Gitlab path stored in the Jmeter script.
S111, creating a project execution Jmeter script in Jenkins, and generating a test report.
In the method for automatically monitoring website anomalies based on JMETER and JENKINS, the step S107 of capturing response data returned by the test page request and selecting a partial copy to be checked to be added to the response assertion includes: the response data returned by the test page request is grabbed by the browser F12 developer tool and the partial copy to be checked is selected and added to the response assertion.
Referring to fig. 2, in a method for automatically monitoring website abnormality based on JMETER and JENKINS of the present embodiment, step S111 includes:
s1111, creating a free style project on the Jenkins management page.
S1112, source code management selects a Gitlab path for storing the Jmeter script.
And S1113, constructing a trigger, and setting a preset time interval to automatically construct once.
S1114, configuring and constructing the environment.
S1115, setting a construction mode, setting all success conditions in the construction step, and generating a test report in a preset storage directory after a Jmeter project is constructed. Html report the test report is alternatively a testreport.
In the method for automatically monitoring website abnormality based on JMETER and JENKINS of the present embodiment, it is determined whether the test report is abnormal, and if so, a warning message is sent. For example, when the test case script has a failed case, sending a mail notification and returning a detailed test report to check the specific failed case;
in the method for automatically monitoring website abnormality based on JMETER and JENKINS of the present embodiment, the determining whether the test report is abnormal includes: and searching whether all success rate keywords exist in the test report or not, wherein the success rate keywords correspond to success conditions.
In the method for automatically monitoring website abnormalities based on JMETER and JENKINS of the present embodiment, sending out the reminding message includes: and sending reminding information through a preset mailbox.
In the method for automatically monitoring website abnormality based on JMETER and JENKINS of the present embodiment, the preset time interval is 30 minutes, and the time can be selected according to the requirement.
In the method for automatically monitoring the website abnormality based on JMeter and Jenkins, a JMeter testing software tool is used for simulating a common user to send a request to test the website by adding a thread group, then default protocol types and IP addresses of all the requests are configured by adding HTTP request default values, then parameterization setting is carried out by adding variables defined by the user, then a test case request and assertion are added through a simple controller to judge whether the result of the request response is an expected result, finally JMeter test case scripts are executed circularly in fixed frequency time by Jenkins configuration, and when a failed test case exists, a mail notification is sent and a detailed test report is returned, so that the automatic monitoring of the website abnormality is completed.
In a preferred embodiment, the computer apparatus of an embodiment comprises a memory and a processor; the memory is used for storing a computer program; the processor is used for executing the computer program stored in the memory to realize the method for automatically monitoring the website abnormity based on JMETER and JENKINS. The computer equipment of the embodiment can automatically monitor the website abnormity, reduce the labor cost and improve the website monitoring efficiency.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above embodiments are merely illustrative of the technical ideas and features of the present invention, and are intended to enable those skilled in the art to understand the contents of the present invention and implement the present invention, and not to limit the scope of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention should be covered by the claims of the present invention.

Claims (8)

1. A method for automatically monitoring website abnormity based on JMeter and Jenkins is characterized by comprising the following steps:
s101, adding a thread group in a test plan of a JMeter test tool, defining the thread group name of the thread group, wherein the thread attribute of the thread group uses a default value;
s102, adding a configuration element under the thread group: HTTP request default values, including a configuration protocol type, an IP address domain name, and a port number;
s103, adding a configuration element under the thread group: the user-defined variables comprise variable names, variable values and variable descriptions to be used in the configuration test cases;
s104, adding a configuration element under the thread group: an HTTP Cookie manager and an HTTP cache manager;
s105, adding a plurality of logic controllers under the thread group according to the functional module to be tested: a simple controller;
s106, adding a sampler under the simple controller: HTTP request, setting HTTP request method, path and parameter of test page;
s107, adding an assertion under the HTTP request: responding to the assertion, capturing response data returned by the test page request, and selecting a part to be checked to copy and add the part to be checked into the response assertion;
s108, dividing all test pages into corresponding simple controllers according to functional modules, and adding the HTTP request and the response assertion;
s109, adding a monitor under the thread group: viewing fruit bearing trees and an aggregation report;
s110, uploading the compiled Jmeter script to a code management tool Gitlab;
and S111, creating a project in Jenkins, executing the Jmeter script, and generating a test report.
2. The method for automatically monitoring website abnormality based on JMETER and JENKINS as claimed in claim 1, wherein said step S107 of grabbing response data returned from the test page request and selecting the partial copy to be checked to be added to said response assertion includes:
and grabbing response data returned by the test page request through a browser F12 developer tool and selecting a part to be checked to copy and add the part to be checked into the response message.
3. The method for automatically monitoring website abnormality based on JMETER and JENKINS as claimed in claim 1, wherein said step S111 comprises:
s1111, building a free-style project on a Jenkins management page;
s1112, selecting a Gitlab path for storing the Jmeter script by source code management;
s1113, constructing a trigger, and setting a preset time interval to automatically construct once;
s1114, configuring a construction environment;
s1115, setting a construction mode, setting all success conditions in the construction step, and generating a test report in a preset storage directory after a Jmeter project is constructed.
4. The method for automatically monitoring website abnormalities based on JMETER and JENKINS as claimed in claim 3, wherein it is determined whether said test report is abnormal, and if so, a reminder message is issued.
5. The method for automatically monitoring website abnormality based on JMETER and JENKINS as claimed in claim 4, wherein said determining whether said test report is abnormal comprises:
and searching whether all the success rate keywords exist in the test report, wherein the success rate keywords correspond to the success conditions.
6. The method for automatically monitoring website abnormality based on JMETER and JENKINS as claimed in claim 3, wherein said issuing of the reminding message comprises:
and sending reminding information through a preset mailbox.
7. The method for automatically monitoring website abnormality based on JMETER and JENKINS as claimed in claim 3, wherein the preset time interval is 30 minutes.
8. A computer device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor is used for executing the computer program stored in the memory to realize the method for automatically monitoring website abnormality based on JMETER and JENKINS as claimed in any one of claims 1 to 7.
CN202110163274.2A 2021-02-05 2021-02-05 Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment Pending CN112817857A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110163274.2A CN112817857A (en) 2021-02-05 2021-02-05 Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110163274.2A CN112817857A (en) 2021-02-05 2021-02-05 Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment

Publications (1)

Publication Number Publication Date
CN112817857A true CN112817857A (en) 2021-05-18

Family

ID=75861905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110163274.2A Pending CN112817857A (en) 2021-02-05 2021-02-05 Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment

Country Status (1)

Country Link
CN (1) CN112817857A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656302A (en) * 2021-08-16 2021-11-16 杭州安恒信息技术股份有限公司 WAF rule automatic testing method, system, storage medium and terminal equipment
CN113778861A (en) * 2021-08-16 2021-12-10 深圳市世强元件网络有限公司 Page element automatic testing method and device based on Jmeter and computer terminal
CN114154169A (en) * 2021-12-06 2022-03-08 南方电网深圳数字电网研究院有限公司 Jenkins and JMeter-based automatic test method and device
CN114629810A (en) * 2022-02-21 2022-06-14 深圳市世强元件网络有限公司 Current limiting strategy testing method, system, computer readable medium and electronic equipment
CN115037794A (en) * 2022-06-07 2022-09-09 抖音视界(北京)有限公司 Data acquisition method and device, computer equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344076A (en) * 2018-10-22 2019-02-15 浙江执御信息技术有限公司 A kind of automatic interface testing method and its device based on JMeter and Jenkins
CN109597761A (en) * 2018-12-03 2019-04-09 四川长虹电器股份有限公司 A kind of automatic interface testing method based on Jmeter
CN110740071A (en) * 2018-07-18 2020-01-31 优信拍(北京)信息科技有限公司 network interface monitoring method, device and system
CN111552633A (en) * 2020-03-27 2020-08-18 深圳壹账通智能科技有限公司 Interface abnormal call testing method and device, computer equipment and storage medium
CN111610967A (en) * 2020-04-08 2020-09-01 曙光信息产业(北京)有限公司 Continuous integration and deployment method and device based on cloud management platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740071A (en) * 2018-07-18 2020-01-31 优信拍(北京)信息科技有限公司 network interface monitoring method, device and system
CN109344076A (en) * 2018-10-22 2019-02-15 浙江执御信息技术有限公司 A kind of automatic interface testing method and its device based on JMeter and Jenkins
CN109597761A (en) * 2018-12-03 2019-04-09 四川长虹电器股份有限公司 A kind of automatic interface testing method based on Jmeter
CN111552633A (en) * 2020-03-27 2020-08-18 深圳壹账通智能科技有限公司 Interface abnormal call testing method and device, computer equipment and storage medium
CN111610967A (en) * 2020-04-08 2020-09-01 曙光信息产业(北京)有限公司 Continuous integration and deployment method and device based on cloud management platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BIGSEC: "Jemter简单介绍与搭配Jenkins实现自动化测试实践", 《HTTPS://BLOG.CSDN.NET/BIGSEC/ARTICLE/DETAILS/78029989》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656302A (en) * 2021-08-16 2021-11-16 杭州安恒信息技术股份有限公司 WAF rule automatic testing method, system, storage medium and terminal equipment
CN113778861A (en) * 2021-08-16 2021-12-10 深圳市世强元件网络有限公司 Page element automatic testing method and device based on Jmeter and computer terminal
CN114154169A (en) * 2021-12-06 2022-03-08 南方电网深圳数字电网研究院有限公司 Jenkins and JMeter-based automatic test method and device
CN114629810A (en) * 2022-02-21 2022-06-14 深圳市世强元件网络有限公司 Current limiting strategy testing method, system, computer readable medium and electronic equipment
CN115037794A (en) * 2022-06-07 2022-09-09 抖音视界(北京)有限公司 Data acquisition method and device, computer equipment and readable storage medium
CN115037794B (en) * 2022-06-07 2024-06-14 抖音视界有限公司 Data acquisition method, device, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN112817857A (en) Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment
US7340649B2 (en) System and method for determining fault isolation in an enterprise computing system
US8150674B2 (en) Automated testing platform for event driven systems
CN106294101B (en) The page gets test method and device ready
Skopik et al. Semi-synthetic data set generation for security software evaluation
Turnbull The art of monitoring
CN110659202A (en) Client automatic testing method and device
CN110460476B (en) Network operation and maintenance management method
WO2020231745A1 (en) Analyzing time-series data in an automated application testing system
CN110147327B (en) Multi-granularity-based web automatic test management method
CN112260885B (en) Industrial control protocol automatic test method, system, device and readable storage medium
US10635407B2 (en) Identification of differences between scripts for testing applications
CN112882927A (en) Interface automatic testing method, device, equipment and medium
CN108021431B (en) Web data interaction based Hive management method and system
US20130318499A1 (en) Test script generation
CN114077540A (en) Interface test system and interface test method
CN112019404A (en) Method and device for automatically testing FC-AE-1553 communication protocol chip
CN110691005A (en) Website monitoring system and method
CN114268569B (en) Configurable network operation and maintenance acceptance test method and device
Costa et al. Taxonomy of performance testing tools: a systematic literature review
CN114385498A (en) Performance test method, system, computer equipment and readable storage medium
CN113726808A (en) Website monitoring method, device, equipment and storage medium
Paz et al. Comparative Analysis of Web Platform Assessment Tools.
CN116795723B (en) Chain unit test processing method and device and computer equipment
Rodestock Visualizing and explaining the scaling behavior of self-adaptive microservice systems in kubernetes

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: 20210518