CN116820975A - Interface software testing method and system based on script and electronic equipment - Google Patents

Interface software testing method and system based on script and electronic equipment Download PDF

Info

Publication number
CN116820975A
CN116820975A CN202310792916.4A CN202310792916A CN116820975A CN 116820975 A CN116820975 A CN 116820975A CN 202310792916 A CN202310792916 A CN 202310792916A CN 116820975 A CN116820975 A CN 116820975A
Authority
CN
China
Prior art keywords
script
test
interface information
software testing
testing method
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
CN202310792916.4A
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.)
Wuhan Zhongbang Bank Co Ltd
Original Assignee
Wuhan Zhongbang Bank 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 Wuhan Zhongbang Bank Co Ltd filed Critical Wuhan Zhongbang Bank Co Ltd
Priority to CN202310792916.4A priority Critical patent/CN116820975A/en
Publication of CN116820975A publication Critical patent/CN116820975A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a script-based interface software testing method, a script-based interface software testing system and electronic equipment, and the technical key points of the script-based interface software testing method are as follows: the collector automatically collects background service interface information and presets commonly used test variables into the system in advance; the script engine generates corresponding test scripts according to the requirements of different stages through the collected interface information; pushing the test script to a remote loading machine through a command for automatic execution; the monitor monitors the state and log of each load machine executing task; after the load machine executes the task, a test report is automatically generated and pushed to the cloud. The invention realizes the automatic processing of interface information acquisition, script generation, task execution and report generation, does not need to manually maintain a test script, realizes the multi-stage operation of one-time acquisition, and solves the dilemma of great amount of manual maintenance in the past, thereby greatly improving the working efficiency.

Description

Interface software testing method and system based on script and electronic equipment
Technical Field
The present invention relates to the field of software testing technologies, and in particular, to a script-based interface software testing method, system, and electronic device.
Background
With the rapid development of the internet software industry, a software information system becomes more and more huge, and a business process becomes more and more complex. The testing work of the software information system is further subdivided into different testing phases. The existing test flow is divided into UI test, function test, interface test, pressure test and the like; because tools used in different stages are different, a large number of testers are needed, a plurality of test scripts are also maintained, and the test work is difficult to standardize and flow, so that the efficiency is low.
In view of the above problems, the demand for automated testing is increasing, which is a trend in the future of software testing.
Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides a script-based interface software testing method, a script-based interface software testing system and electronic equipment. The invention realizes the automatic processing of interface information acquisition, script generation, task execution and report generation, does not need to manually maintain a test script, realizes the multi-stage operation of one-time acquisition, and solves the dilemma of great amount of manual maintenance in the past, thereby greatly improving the working efficiency.
According to a first aspect of the present invention, there is provided a script-based interface software testing method comprising the steps of:
the collector automatically collects background service interface information and presets commonly used test variables into the system in advance;
the script engine generates corresponding test scripts according to the requirements of different stages through the collected interface information;
pushing the test script to a remote loading machine through a command for automatic execution;
the monitor monitors the state and log of each load machine executing task;
after the load machine executes the task, a test report is automatically generated and pushed to the cloud.
On the basis of the technical scheme, the invention can also make the following improvements.
Optionally, the automatic acquisition of the background service interface information by the collector includes:
integrating the collection of various interface information, preferentially collecting the interface of the swagger specification, or manually uploading the existing postman/jmeter script, and automatically collecting the interface information according to the script.
Optionally, the collection of the interface information includes, but is not limited to, collecting interfaces conforming to the swagger specification, or uploading postman script/jmeter script and other ways in which interface information may be collected.
Optionally, the script engine generates the corresponding test script according to the needs of different stages through the collected interface information, including: and carrying out modification assignment on the set field values according to different test scenes, and asserting data logic of the corresponding scenes by corresponding scenes of the back-references of the interfaces or connecting the corresponding databases.
Optionally, the pushing the test script to the remote loader by the command for automatic execution includes: the testing script is pushed to the loading machine remotely by the main service through registering the loading machine on the main service, and the testing task is automatically executed.
Optionally, the script engine includes, but is not limited to, a swagger standard specification interface/postman script/jmeter script, and other automated test tool scripts.
Optionally, the pushing the test script to the remote loader by the command for automatic execution includes: the method comprises the steps that a loading machine is registered on a main service, the main service pushes corresponding test scripts to the loading machine of a corresponding environment, the test scripts run at daily setting time or untimely calling scripts, and the correctness of the test environment and the stability of the service are covered and tested by the test scenes of the automation scripts.
Optionally, the monitor monitors a state of each load machine executing a task, and the log includes: monitoring deployment is carried out on the corresponding loading machine, the execution condition of the script is monitored, and the error reporting of the script is judged to be a code problem, an environmental problem or a test data problem through a log.
Optionally, the test method further includes: designing a service simulator; and automatically mock outputting a set of callable service from the collected interface information so as to meet the requirement that developers at each end and testers finish respective tasks in parallel.
According to a second aspect of the present invention, there is provided a script-based interface software testing system comprising:
the data acquisition module is used for automatically acquiring background service interface information by the collector;
the preset variable module is used for presetting a commonly used test variable into the system in advance;
the script generation module is used for generating corresponding test scripts according to the requirements of different stages through the collected interface information by the script engine;
the execution module is used for pushing the test script to the remote loading machine through a command to automatically execute the test script;
the monitoring module is used for monitoring the state and log of each load machine execution task through a monitor;
and the generation report module is used for automatically generating a test report after the task is executed by the loading machine and pushing the test report to the cloud.
According to a third aspect of the present invention there is provided an electronic device comprising a memory, a processor for implementing the steps of a script-based interface software testing method when executing a computer program stored in the memory.
The invention has the technical effects and advantages that:
the invention provides a script-based interface software testing method, a script-based interface software testing system and electronic equipment, which are based on a swagger specification and combined with the existing testing tools commonly used in different testing stages, wherein background service interface information is automatically collected through a collector, variables are automatically generated, a script engine automatically generates testing scripts required in different stages, the scripts are remotely sent to a loading machine for executing the scripts to be automatically executed, task states are monitored through a task monitor, and a report is automatically exported through a report engine after task execution is completed, so that testing tasks in all stages are completed.
The invention realizes the automatic processing of interface information acquisition, script generation, task execution and report generation, does not need to manually maintain a test script, realizes the multi-stage operation of one-time acquisition, and solves the dilemma of great amount of manual maintenance in the past, thereby greatly improving the working efficiency.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
FIG. 1 is a flow chart of a software testing method in the prior art according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a script-based interface software testing method according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the prior art, as shown in fig. 1 in particular, in the interface automation test phase: based on postman as interface automatic test, testers need to write automatic test scripts according to interface documents of developers, and each time interface information is adjusted, the test scripts need to be modified.
Interface pressure testing stage: based on the pressure test of jmeter serving, the tester needs to write the pressure test script of jmeter based on the interface document of developer, and once the interface information changes, the tester needs to adjust the script.
It can be appreciated that, based on the defects in the background art, according to the first aspect of the present invention, an embodiment of the present invention provides a script-based interface software testing method, specifically as shown in fig. 2, the method includes the following steps:
step 1, automatically acquiring background service interface information by a collector, and presetting a commonly used test variable into a system in advance;
specifically, in this embodiment, the interface information is automatically collected and entered into the system, and the commonly used test variables are preset into the system in advance; the interface capturer is used for capturing the interface developed or iterated in the stage and integrating the interface, and parameters required by each interface are uniformly set as variables, such as cookies, token and interface service fields;
step 2, the script engine generates corresponding test scripts according to the requirements of different stages through the collected interface information;
specifically, in this step, specifically, it includes: and 2.1, modifying and assigning the set field values according to different test scenes, and asserting the data logic of the corresponding scene of the back-reference of the interface or connecting the corresponding database.
Step 3, pushing the test script to a remote loading machine through a command for automatic execution;
specifically, the shell command is used for pushing the corresponding test script to the loader of the corresponding environment, the call script can be operated at the daily setting timing or the non-timing, and the test scene of the automatic script is used for covering and testing the correctness of the environment and the stability of the service;
step 4, monitoring the state and log of each load machine executing task by the monitor;
specifically, monitoring deployment is carried out on a corresponding load machine, the execution condition of a script is monitored, and whether the error report of the script is a code problem, an environment problem or a test data problem is judged through a log;
and 5, after the load machine executes the task, automatically generating a test report, and pushing the test report to the cloud.
Specifically, after the script is executed, a test result report is generated through a report plug-in, the report can be pushed to the cloud for a corresponding script maintainer to check through configuration setting, and can be pushed to a corresponding mailbox or a mobile phone, and an operator needs to be configured.
The specific implementation mode is described according to the flow direction of the data, which comprises the following steps: design of a collector: the module can integrate the collection of various interface information, preferentially collect the interface of the swagger specification, manually upload the existing postman/jmeter script and automatically collect the interface information according to the script;
design of a variable center: this module will test variables commonly used in the business, such as: common test constants such as name/identification number/birthday/address/age are automatically generated. File class constants may also be automatically generated, for example: head portrait picture, voice file.
Design of script engine: and generating test scripts of different stages according to requirements through the collected interface information, wherein only postman scripts/jmeter scripts/swagger scripts are supported at present, and the module can support expansion according to the support of newly adding other scripts in the later stage.
Design of an execution engine: the main service remotely pushes the test script to the loading machine through registering the loading machine on the main service, automatically executes the test task, and supports a plurality of loading machines to execute the task simultaneously.
Design of service simulator: the collected interface information can be automatically mock to obtain a set of callable service so as to meet the requirement of agile development, and developers at each end and testers can finish respective tasks in parallel.
In summary, the embodiment of the invention integrates various test tool script formats, and can be converted into a desired test script by collecting the interfaces which meet the standard specification of the swagger without manually maintaining the automated test script. And generating scripts according to the test tool requirements of different stages, and completing automatic test by issuing instructions to the loading machine. According to the collected interface information, a new set of mock service can be performed, and the agile development requirement is met.
According to a second aspect of the present invention, an embodiment of the present invention provides a script-based interface software testing system, including:
the data acquisition module is used for automatically acquiring background service interface information by the collector;
the preset variable module is used for presetting a commonly used test variable into the system in advance;
the script generation module is used for generating corresponding test scripts according to the requirements of different stages through the collected interface information by the script engine;
the execution module is used for pushing the test script to the remote loading machine through a command to automatically execute the test script;
the monitoring module is used for monitoring the state and log of each load machine execution task through a monitor;
and the generation report module is used for automatically generating a test report after the task is executed by the loading machine and pushing the test report to the cloud.
It can be understood that the script-based interface software testing system provided by the present invention corresponds to the script-based interface software testing method provided in the foregoing embodiments, and relevant technical features of the script-based interface software testing system may refer to relevant technical features of the script-based interface software testing method, which are not described herein again.
According to a third aspect of the present invention, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
the interface information is automatically collected and enters the system, and commonly used test variables are preset into the system in advance;
generating corresponding test scripts according to the requirements of different stages;
pushing the test script to a remote loading machine through a command for automatic execution;
the monitor monitors the state of each load machine executing the task and logs;
after the load machine executes the task, a test report is automatically generated and pushed to the cloud.
According to a fourth aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of;
the interface information is automatically collected and enters the system, and commonly used test variables are preset into the system in advance;
generating corresponding test scripts according to the requirements of different stages;
pushing the test script to a remote loading machine through a command for automatic execution;
the monitor monitors the state of each load machine executing the task and logs;
after the load machine executes the task, automatically generating a test report, and pushing the test report to the cloud
The embodiment of the invention completes the method of the automatic test of the interface and the pressure test of the interface based on the interface information collector, the variable center, the script engine, the execution engine, the monitor and the report center. The method is characterized in that the method is used for completing the interface automatic test/interface pressure test process and generating a test report based on an interface information collector (the mode of collecting other collectable interface information such as an interface/postman script/jmeter script conforming to the swagger specification), a variable center (automatic assignment of common variables), a script engine (other automatic test tool scripts such as a swagger standard specification interface/postman script/jmeter script), an execution engine (remote execution or local execution of a loader), a monitor and a report center, and is considered as a technical point of infringement of the embodiment of the invention.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
Finally, it should be noted that: the foregoing description is only illustrative of the preferred embodiments of the present invention, and although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described, or equivalents may be substituted for elements thereof, and any modifications, equivalents, improvements or changes may be made without departing from the spirit and principles of the present invention.

Claims (10)

1. A script-based interface software testing method, characterized in that the testing method comprises the following steps:
the collector automatically collects background service interface information and presets commonly used test variables into the system in advance;
the script engine generates corresponding test scripts according to the requirements of different stages through the collected interface information;
pushing the test script to a remote loading machine through a command for automatic execution;
the monitor monitors the state and log of each load machine executing task;
after the load machine executes the task, a test report is automatically generated and pushed to the cloud.
2. The script-based interface software testing method of claim 1, wherein the collector automatically collecting background service interface information comprises:
integrating the collection of various interface information, preferentially collecting the interface of the swagger specification, or manually uploading the existing postman/jmeter script, and automatically collecting the interface information according to the script.
3. A method of testing software of a script-based interface according to claim 2, wherein the collection of interface information includes, but is not limited to, collecting interfaces conforming to the swagger specification, or uploading postman script/jmeter script and other ways in which interface information may be collected.
4. The script-based interface software testing method of claim 1, wherein the script engine generating the corresponding test script according to the requirements of different stages through the collected interface information comprises:
and carrying out modification assignment on the set field values according to different test scenes, and asserting data logic of the corresponding scenes by corresponding scenes of the back-references of the interfaces or connecting the corresponding databases.
5. The script-based interface software testing method of claim 1, wherein the script engine comprises, but is not limited to, a swagger standard specification interface/postman script/jmeter script and other automated testing tool scripts.
6. The method of claim 1, wherein pushing the test script into the remote loader via the command for automatic execution comprises:
the method comprises the steps that a loading machine is registered on a main service, the main service pushes corresponding test scripts to the loading machine of a corresponding environment, the test scripts run at daily setting time or untimely calling scripts, and the correctness of the test environment and the stability of the service are covered and tested by the test scenes of the automation scripts.
7. The script-based interface software testing method of claim 1, wherein the monitor monitors the status of each load machine executing a task, the log comprising: monitoring deployment is carried out on the corresponding loading machine, the execution condition of the script is monitored, and the error reporting of the script is judged to be a code problem, an environmental problem or a test data problem through a log.
8. The script-based interface software testing method of claim 1, wherein the testing method further comprises: designing a service simulator; and automatically mock outputting a set of callable service from the collected interface information so as to meet the requirement that developers at each end and testers finish respective tasks in parallel.
9. A script-based interface software testing system, comprising:
the data acquisition module is used for automatically acquiring background service interface information by the collector;
the preset variable module is used for presetting a commonly used test variable into the system in advance;
the script generation module is used for generating corresponding test scripts according to the requirements of different stages through the collected interface information by the script engine;
the execution module is used for pushing the test script to the remote loading machine through a command to automatically execute the test script;
the monitoring module is used for monitoring the state and log of each load machine execution task through a monitor;
and the generation report module is used for automatically generating a test report after the task is executed by the loading machine and pushing the test report to the cloud.
10. An electronic device comprising a memory, a processor for implementing the steps of a script-based interface software testing method according to any of claims 1-8 when executing a computer program stored in the memory.
CN202310792916.4A 2023-06-29 2023-06-29 Interface software testing method and system based on script and electronic equipment Pending CN116820975A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310792916.4A CN116820975A (en) 2023-06-29 2023-06-29 Interface software testing method and system based on script and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310792916.4A CN116820975A (en) 2023-06-29 2023-06-29 Interface software testing method and system based on script and electronic equipment

Publications (1)

Publication Number Publication Date
CN116820975A true CN116820975A (en) 2023-09-29

Family

ID=88123766

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310792916.4A Pending CN116820975A (en) 2023-06-29 2023-06-29 Interface software testing method and system based on script and electronic equipment

Country Status (1)

Country Link
CN (1) CN116820975A (en)

Similar Documents

Publication Publication Date Title
CN101017457A (en) Automatically testing method of computer software
CN112181854B (en) Method, device, equipment and storage medium for generating process automation script
CN114328278B (en) Distributed simulation test method, system, readable storage medium and computer equipment
CN113010413A (en) Automatic interface testing method and device
CN115658529A (en) Automatic testing method for user page and related equipment
CN109669851A (en) Performance test script method for recording based on Selenium automation
CN114117973A (en) Logic synthesis method, device and storage medium
CN114996127A (en) Intelligent test method and system for solid state disk firmware module
CN113505073A (en) Database performance test method, device, equipment and medium
CN117421217A (en) Automatic software function test method, system, terminal and medium
CN112148616A (en) Performance test management platform
CN116820975A (en) Interface software testing method and system based on script and electronic equipment
CN116629173A (en) Verification method and device of network chip, computer equipment and storage medium
CN114168461A (en) Performance test method and system applied to domestic operating system
CN116016270A (en) Switch test management method and device, electronic equipment and storage medium
CN110825645A (en) Assembly line type full-process automatic testing method
CN112527584A (en) Software efficiency improving method and system based on script compiling and data acquisition
CN111488264A (en) Deployment scheduling method for interface performance test cluster
CN115708070A (en) Automatic interface testing method and device
CN116541270B (en) Method and device for testing adaptation verification of operating system
CN114448851B (en) Automatic data testing method and system
CN111459833B (en) Method for realizing multi-terminal multi-platform automatic test and monitoring of mobile terminal of government and enterprise
CN114253867B (en) Automatic testing method, device and system based on neural network model
CN117992323A (en) Automatic testing method and device for vehicle-mounted entertainment system and electronic equipment
CN114116470A (en) Automatic static model checking method and device

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