CN111506490A - Automatic test method and device for application service interface and storage medium - Google Patents
Automatic test method and device for application service interface and storage medium Download PDFInfo
- Publication number
- CN111506490A CN111506490A CN201910095787.7A CN201910095787A CN111506490A CN 111506490 A CN111506490 A CN 111506490A CN 201910095787 A CN201910095787 A CN 201910095787A CN 111506490 A CN111506490 A CN 111506490A
- Authority
- CN
- China
- Prior art keywords
- test
- application service
- interface
- file
- testing
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
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 an automatic test method and device for an application service interface and a computer readable storage medium, belonging to the technical field of internet. The automatic test method for the application service interface comprises the steps of firstly creating a batch file and a timing task, then executing the timing task, and obtaining a test result by using an interface test tool and the batch file, thereby realizing the timed automatic script case execution and collecting test data without frequently and repeatedly executing scripts by a tester, avoiding the tester from frequently and manually collecting the test data, and only needing the tester to confirm the final test result, thereby greatly improving the efficiency of interface test and ensuring the comprehensiveness and accuracy of the interface test. The application service interface automatic test method, the application service interface automatic test device and the computer readable storage medium have the advantages of simple application mode, low implementation cost and wide application range.
Description
Technical Field
The invention relates to the technical field of internet, in particular to the technical field of internet application service, and specifically relates to an automatic test method and device for an application service interface and a computer readable storage medium.
Background
The service end of the internet application service needs to provide an interface for accessing external equipment, and testing the effectiveness and other performances of the interface is the most daily work of an application service provider.
In the interface test scheme in the prior art, return data of an interface at intervals or at fixed time points needs to be acquired, and whether the data changes according to expected results is judged. Such a test scheme generally requires a tester to frequently and manually execute a test script at regular time or at fixed point, initiate a request to an application service deployed in a server through a script case, and obtain a specific response of the service by accessing a database or a cache, thereby obtaining a test result.
In the research and practice process of the prior art, testers are required to frequently participate in manual execution of scripts, and the test work efficiency is low. On the other hand, manual operation may cause forgetting to perform the test in some cases, and the data collection and verification of the test result is incomplete, thereby affecting the test result.
Therefore, how to provide an application service interface testing method which does not require frequent repeated script execution by a tester, avoids manual collection of test data and comparison of test results, and can improve testing efficiency, comprehensiveness and accuracy becomes a problem to be solved in the field.
Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides an automatic test method, an automatic test device and a computer-readable storage medium for an application service interface, wherein the automatic test method, the automatic test device and the computer-readable storage medium are used for automatically executing a script case at regular time, collecting test data, avoiding frequent and repeated script execution by a tester, and avoiding frequent manual test data collection and test result comparison by the tester, thereby greatly improving test efficiency and ensuring test comprehensiveness and accuracy.
In order to achieve the above object, the automatic test method for application service interface of the present invention comprises the following steps:
(1) creating a batch file, wherein the batch file comprises settings for a test script case;
(2) creating a timing task, wherein the task comprises execution parameter setting of the batch processing file;
(3) and executing the timing task, and obtaining a test result by using an interface test tool and the batch processing file.
In the method for automatically testing the application service interface, the step (1) specifically comprises the following steps:
generating a test script case;
and creating a batch file, wherein the batch file comprises an execution mode for setting the test script case, a file position for setting the test script case and a test result storage position for setting the test script case.
In the method for automatically testing the application service interface, the step (2) is specifically as follows:
and creating a timing task, wherein the task comprises setting the name, the execution path, the execution mode, the starting execution time, the execution time interval and the ending execution time of the timing task.
In the method for automatically testing the application service interface, the step (3) is specifically as follows:
and executing the timing task according to the starting execution time, the execution time interval and the ending execution time, executing the batch processing file by using an interface test tool to generate a test result file, opening the test result file by using the interface test tool, and displaying a test result.
In the automatic test method for the application service interface, the test result comprises the dynamic change condition of the application service in the execution period of the timing task.
The invention also provides another automatic test method for the application service interface, which comprises the following steps:
(A) creating a batch file at a test end, wherein the batch file comprises the setting of a test script case;
(B) establishing a timing task at the test end, wherein the task comprises the execution parameter setting of the batch processing file;
(C) and the testing end executes the timing task, utilizes an interface testing tool and the batch processing file, and interacts with the server end where the application service interface is positioned to obtain a testing result.
In the method for automatically testing the application service interface, the step (a) specifically comprises the following steps:
generating a test script case at a test end;
and creating a batch file at a test end, wherein the batch file comprises an execution mode for setting the test script case, a file position for setting the test script case and a test result storage position for setting the test script case.
In the method for automatically testing the application service interface, the step (B) is specifically as follows:
the method comprises the steps of creating a timing task in a testing end, wherein the task comprises the steps of setting the name, the execution path, the execution mode, the starting execution time, the execution time interval and the ending execution time of the timing task.
In the method for automatically testing the application service interface, the step (C) is specifically as follows:
and according to the starting execution time, the execution time interval and the ending execution time, the test end executes the timing task, executes the batch processing file by using an interface test tool, interacts with the server end where the application service interface is located through the test end to generate a test result file, and opens the test result file by using the interface test tool and displays a test result.
In the automatic test method for the application service interface, the test result comprises the dynamic change condition of the application service in the execution period of the timing task.
In the automatic test method for the application service interface, before the step (A), the following steps are also included:
the testing end obtains the interface testing tool, installs the system running environment necessary for the interface testing tool, sets the environment variable, modifies the configuration information of the interface testing tool, and enables the interface testing tool to run and be called under the operating system.
The present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the above-mentioned automatic testing method for application service interfaces.
The invention also provides an automatic testing device of the application service interface, which comprises a processor and a memory, wherein the memory is stored with a computer program, and the computer program is executed by the processor to realize the automatic testing method of the application service interface.
The method comprises the steps of firstly creating a batch file and a timing task, then executing the timing task, and obtaining a test result by using an interface test tool and the batch file, thereby realizing the timed automatic script case execution and collecting test data without frequently and repeatedly executing scripts by a tester, avoiding the tester from frequently and manually collecting the test data, and only needing the tester to confirm the final test result, thereby greatly improving the efficiency of interface test and ensuring the comprehensiveness and accuracy of the interface test. The application service interface automatic test method, the application service interface automatic test device and the computer readable storage medium have the advantages of simple application mode, low implementation cost and wide application range.
Drawings
FIG. 1 is a flowchart illustrating steps of an embodiment of an automatic test method for an application service interface according to the present invention.
FIG. 2 is a flowchart illustrating steps of another embodiment of an automatic test method for an application service interface according to the present invention.
Detailed Description
In order to clearly understand the technical contents of the present invention, the following examples are given in detail.
Fig. 1 is a flowchart illustrating steps of an automatic testing method for an application service interface according to the present invention.
In one embodiment, the automatic test method for the application service interface comprises the following steps:
(1) creating a batch file, wherein the batch file comprises settings for a test script case;
(2) creating a timing task, wherein the task comprises execution parameter setting of the batch processing file;
(3) and executing the timing task, and obtaining a test result by using an interface test tool and the batch processing file.
In a preferred embodiment, the step (1) specifically comprises:
generating a test script case;
and creating a batch file, wherein the batch file comprises an execution mode for setting the test script case, a file position for setting the test script case and a test result storage position for setting the test script case.
The step (2) is specifically as follows:
and creating a timing task, wherein the task comprises setting the name, the execution path, the execution mode, the starting execution time, the execution time interval and the ending execution time of the timing task.
The step (3) is specifically as follows:
and executing the timing task according to the starting execution time, the execution time interval and the ending execution time, executing the batch processing file by using an interface test tool to generate a test result file, opening the test result file by using the interface test tool, and displaying a test result.
In a more preferred embodiment, the test result includes a dynamic change of the application service in the execution period of the timing task.
The present invention further provides another automatic testing method for an application service interface, which in an embodiment, as shown in fig. 2, includes the following steps:
(A) creating a batch file at a test end, wherein the batch file comprises the setting of a test script case;
(B) establishing a timing task at the test end, wherein the task comprises the execution parameter setting of the batch processing file;
(C) and the testing end executes the timing task, utilizes an interface testing tool and the batch processing file, and interacts with the server end where the application service interface is positioned to obtain a testing result.
In a preferred embodiment, the step (a) specifically comprises:
generating a test script case at a test end;
and creating a batch file at a test end, wherein the batch file comprises an execution mode for setting the test script case, a file position for setting the test script case and a test result storage position for setting the test script case.
The step (B) is specifically as follows:
the method comprises the steps of creating a timing task in a testing end, wherein the task comprises the steps of setting the name, the execution path, the execution mode, the starting execution time, the execution time interval and the ending execution time of the timing task.
The step (C) is specifically as follows:
and according to the starting execution time, the execution time interval and the ending execution time, the test end executes the timing task, executes the batch processing file by using an interface test tool, interacts with the server end where the application service interface is located through the test end to generate a test result file, and opens the test result file by using the interface test tool and displays a test result.
In a further preferred embodiment, the test result includes a dynamic change of the application service in the execution period of the timed task.
In a more preferred embodiment, said step (a) is preceded by the steps of:
the testing end obtains the interface testing tool, installs the system running environment necessary for the interface testing tool, sets the environment variable, modifies the configuration information of the interface testing tool, and enables the interface testing tool to run and be called under the operating system.
The invention also provides an automatic test device of the application service interface and a computer readable storage medium. The memory is the computer readable storage medium, and a computer program is stored thereon. When the computer program is executed by the processor, the automatic testing method for the application service interface according to the above embodiments is implemented.
In practical application, the automatic test method for the application service interface is adopted in order to reduce the interval between the frequent manual execution of the script and the long-time execution waiting, reduce the frequent manual data collection of the tester, and solve the problems that the tester needs to frequently participate in the manual execution of the script, the manual collection of the verification data and the like in the prior art.
The practical application of the process is illustrated in detail by the following examples.
Example 1
Step 1: downloading interface tools and building their environments
Firstly, downloading a current interface test tool (such as a Jmeter) at a test end, installing a necessary system running environment, setting environment variables, and modifying tool configuration information so that the tool can run under an operating system and be called.
Step 2: creating a batch file
Designing and compiling a test script case, creating a batch processing file, setting a script execution mode, setting a script case file position, setting a script case test result storage position, the execution sequence and times of the script, an access protocol request mode, a port number and the like, so as to realize the calling of the test script case and automatically collect test result data.
And step 3: creating timed tasks
In the test side, a timing task is created, which can be created by a command prompt, and information such as the name, execution path, execution mode, start execution time, execution time interval, end execution time, and the like of the timing task needs to be set.
And 4, step 4: checking the test result and verifying the test data
And opening a test result file in the interface test tool, and verifying whether the interface test result meets the expectation.
Example 2
The difference from the embodiment 1 is that,
the judgment of the test result may be performed on a result corresponding to one test execution time, or may be performed on the dynamic change condition of the application service in the whole timing task execution period. For example, the execution period of the timed task is 24 hours, and the execution time interval is 1 hour, that is, there are 24 test results in one day. The corresponding application service to be tested has different dynamic change conditions within 24 hours, and whether the dynamic change conditions of the application service meet the preset conditions can be judged according to the 24-time test results.
The automatic test method of the application service interface of the invention is characterized in that:
setting a timing task to execute a script case aiming at a service sensitive to data change, automatically collecting test data, and relating to a stored address of a case script, a stored address of a test result and automatic execution of the case.
And secondly, aiming at the condition that the script case needs to be frequently executed, a timing task is adopted, so that the frequent manual execution or the arrival manual execution of the script such as sitting and the like by a tester can be avoided, and the situation that the tester forgets to execute the script to collect data due to other matters is avoided.
And thirdly, setting project execution starting time, execution time interval and execution ending time to control the whole link of automatic execution for the timing task, and collecting verification test data by hands so as to facilitate the test result verification of testers.
Aiming at the condition that data of service dynamic change needs to be collected in the interface test process, a timing task automatic timing interval or fixed point execution script can be set, data are collected, and testers can directly judge whether the interface test result meets an expected result after the interface data collection and verification are completed, so that the test convenience, the usability, the maintainability and the accuracy are greatly improved, and the test efficiency of the testers is improved.
The method comprises the steps of firstly creating a batch file and a timing task, then executing the timing task, and obtaining a test result by using an interface test tool and the batch file, thereby realizing the timed automatic script case execution and collecting test data without frequently and repeatedly executing scripts by a tester, avoiding the tester from frequently and manually collecting the test data, and only needing the tester to confirm the final test result, thereby greatly improving the efficiency of interface test and ensuring the comprehensiveness and accuracy of the interface test. The application service interface automatic test method, the application service interface automatic test device and the computer readable storage medium have the advantages of simple application mode, low implementation cost and wide application range.
In this specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
Claims (13)
1. An automatic test method for an application service interface is characterized by comprising the following steps:
(1) creating a batch file, wherein the batch file comprises settings for a test script case;
(2) creating a timing task, wherein the task comprises execution parameter setting of the batch processing file;
(3) and executing the timing task, and obtaining a test result by using an interface test tool and the batch processing file.
2. The method for automatically testing an application service interface according to claim 1, wherein the step (1) specifically comprises:
generating a test script case;
and creating a batch file, wherein the batch file comprises an execution mode for setting the test script case, a file position for setting the test script case and a test result storage position for setting the test script case.
3. The method for automatically testing an application service interface according to claim 2, wherein the step (2) is specifically as follows:
and creating a timing task, wherein the task comprises setting the name, the execution path, the execution mode, the starting execution time, the execution time interval and the ending execution time of the timing task.
4. The method for automatically testing an application service interface according to claim 3, wherein the step (3) is specifically as follows:
and executing the timing task according to the starting execution time, the execution time interval and the ending execution time, executing the batch processing file by using an interface test tool to generate a test result file, opening the test result file by using the interface test tool, and displaying a test result.
5. The method as claimed in claim 4, wherein the test result includes a dynamic change of the application service in the execution cycle of the timing task.
6. An automatic test method for an application service interface is characterized by comprising the following steps:
(A) creating a batch file at a test end, wherein the batch file comprises the setting of a test script case;
(B) establishing a timing task at the test end, wherein the task comprises the execution parameter setting of the batch processing file;
(C) and the testing end executes the timing task, utilizes an interface testing tool and the batch processing file, and interacts with the server end where the application service interface is positioned to obtain a testing result.
7. The automatic test method for application service interfaces according to claim 6, wherein the step (A) specifically comprises:
generating a test script case at a test end;
and creating a batch file at a test end, wherein the batch file comprises an execution mode for setting the test script case, a file position for setting the test script case and a test result storage position for setting the test script case.
8. The method for automatically testing an application service interface according to claim 7, wherein the step (B) is specifically as follows:
the method comprises the steps of creating a timing task in a testing end, wherein the task comprises the steps of setting the name, the execution path, the execution mode, the starting execution time, the execution time interval and the ending execution time of the timing task.
9. The method for automatically testing an application service interface according to claim 8, wherein the step (C) is specifically as follows:
and according to the starting execution time, the execution time interval and the ending execution time, the test end executes the timing task, executes the batch processing file by using an interface test tool, interacts with the server end where the application service interface is located through the test end to generate a test result file, and opens the test result file by using the interface test tool and displays a test result.
10. The method as claimed in claim 9, wherein the test result includes a dynamic change of the application service in the execution cycle of the timing task.
11. The method for automatic testing of application service interfaces of claim 6, further comprising the following steps before step (A):
the testing end obtains the interface testing tool, installs the system running environment necessary for the interface testing tool, sets the environment variable, modifies the configuration information of the interface testing tool, and enables the interface testing tool to run and be called under the operating system.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for automatic testing of an application service interface of any one of claims 1 to 11.
13. An automatic testing device for application service interfaces, comprising a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the automatic testing device for application service interfaces realizes the automatic testing method for application service interfaces according to any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910095787.7A CN111506490A (en) | 2019-01-31 | 2019-01-31 | Automatic test method and device for application service interface and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910095787.7A CN111506490A (en) | 2019-01-31 | 2019-01-31 | Automatic test method and device for application service interface and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111506490A true CN111506490A (en) | 2020-08-07 |
Family
ID=71867032
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910095787.7A Pending CN111506490A (en) | 2019-01-31 | 2019-01-31 | Automatic test method and device for application service interface and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111506490A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760710A (en) * | 2020-09-29 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Task testing method and device, computer equipment and readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6662312B1 (en) * | 2000-06-30 | 2003-12-09 | Qwest Communications International Inc. | Software-testing automation system |
CN102693183A (en) * | 2012-05-30 | 2012-09-26 | 瑞斯康达科技发展股份有限公司 | Method and system for realizing automatic software testing |
EP2788865A1 (en) * | 2011-12-06 | 2014-10-15 | Freescale Semiconductor, Inc. | Method, device and computer program product for measuring user perception quality of a processing system comprising a user interface |
CN107577602A (en) * | 2017-08-25 | 2018-01-12 | 上海斐讯数据通信技术有限公司 | A kind of method of testing of APP interfaces, apparatus and system |
CN107608772A (en) * | 2017-08-23 | 2018-01-19 | 山东中创软件工程股份有限公司 | A kind of method and system of batch processing task configuration schedules |
CN107832230A (en) * | 2017-12-04 | 2018-03-23 | 中国工商银行股份有限公司 | Method of testing, equipment and system based on data tuning |
-
2019
- 2019-01-31 CN CN201910095787.7A patent/CN111506490A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6662312B1 (en) * | 2000-06-30 | 2003-12-09 | Qwest Communications International Inc. | Software-testing automation system |
EP2788865A1 (en) * | 2011-12-06 | 2014-10-15 | Freescale Semiconductor, Inc. | Method, device and computer program product for measuring user perception quality of a processing system comprising a user interface |
CN102693183A (en) * | 2012-05-30 | 2012-09-26 | 瑞斯康达科技发展股份有限公司 | Method and system for realizing automatic software testing |
CN107608772A (en) * | 2017-08-23 | 2018-01-19 | 山东中创软件工程股份有限公司 | A kind of method and system of batch processing task configuration schedules |
CN107577602A (en) * | 2017-08-25 | 2018-01-12 | 上海斐讯数据通信技术有限公司 | A kind of method of testing of APP interfaces, apparatus and system |
CN107832230A (en) * | 2017-12-04 | 2018-03-23 | 中国工商银行股份有限公司 | Method of testing, equipment and system based on data tuning |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760710A (en) * | 2020-09-29 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Task testing method and device, computer equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109302522B (en) | Test method, test device, computer system, and computer medium | |
CN108446190B (en) | Interface test method and device | |
CN105302722B (en) | CTS automatic testing method and device | |
CN107302476B (en) | Automatic testing method and system for testing asynchronous interactive system | |
CN108733569B (en) | Interface automatic testing method and device, storage medium and equipment | |
CN104375914A (en) | Automatic testing method for internal pressure changes of server | |
CN108509344B (en) | Daily cutting batch test method, equipment and readable storage medium | |
CN108132876B (en) | Embedded software object code unit testing method based on injection mode | |
CN112231206A (en) | Script editing method for application program test, computer readable storage medium and test platform | |
CN106484613A (en) | A kind of interface automated test frame based on fitnese | |
CN113505073A (en) | Database performance test method, device, equipment and medium | |
CN111563032A (en) | APP debugging method and device, computer equipment and storage medium | |
CN111462811A (en) | Automatic testing method and device, storage medium and electronic equipment | |
CN110297749B (en) | Method and terminal for testing new function | |
CN113126993B (en) | Automatic test method and system applied to vehicle detection software | |
CN109032705B (en) | Application program execution method and device, electronic equipment and readable storage medium | |
CN105095076B (en) | Method and device for testing compatibility between application software versions | |
CN111506490A (en) | Automatic test method and device for application service interface and storage medium | |
CN110749814A (en) | Automatic testing system and method for chip IC sample | |
CN110825649A (en) | Application testing method, device, equipment and storage medium | |
CN111581081B (en) | Automatic test system and method | |
CN110888807B (en) | Automatic packet grabbing method for android application | |
CN111611148B (en) | Compatibility concurrent test method and system for iOS system application software | |
CN109344064B (en) | Application remote debugging method | |
CN111813665A (en) | Big data platform interface data testing method and system based on python |
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 |