CN110750438A - Automatic test method and system for input box - Google Patents

Automatic test method and system for input box Download PDF

Info

Publication number
CN110750438A
CN110750438A CN201910823669.3A CN201910823669A CN110750438A CN 110750438 A CN110750438 A CN 110750438A CN 201910823669 A CN201910823669 A CN 201910823669A CN 110750438 A CN110750438 A CN 110750438A
Authority
CN
China
Prior art keywords
test
input box
tested
interface
test case
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
CN201910823669.3A
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.)
Beijing Neusoft Wang Hai Technology Co Ltd
Original Assignee
Beijing Neusoft Wang Hai Technology 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 Beijing Neusoft Wang Hai Technology Co Ltd filed Critical Beijing Neusoft Wang Hai Technology Co Ltd
Priority to CN201910823669.3A priority Critical patent/CN110750438A/en
Publication of CN110750438A publication Critical patent/CN110750438A/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/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/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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 application discloses an input box automatic test method and system, wherein the method comprises the following steps: creating a test project; associating an input box interface document with the created test project, wherein the input box interface document comprises interface information of each input box to be tested; configuring a uniform resource locator of a system under test; extracting interface information of each input box, and automatically generating a test case of each input box according to a preset test rule based on the extracted interface information of each input box; automatically inputting the generated test cases into corresponding input boxes of all pages of the tested system one by one, and submitting the test cases to the tested system for verification; and collecting the actual measurement result returned by the tested system aiming at each test case. The method and the system not only can automatically create the test case, but also can meet the requirement of personalized automatic test of the interface, greatly reduce the test cost and improve the test efficiency.

Description

Automatic test method and system for input box
Technical Field
The application relates to the field of electric digital data processing, in particular to an automatic test method and system for an input box.
Background
Automated testing is a process that translates human-driven test behavior into machine execution. Typically, after a test case is designed and passes review, the test is performed step by a tester according to the procedures described in the test case, resulting in a comparison of the actual results with the expected results. In the process, in order to save manpower, time or hardware resources and improve the testing efficiency, the concept of automatic testing is introduced.
The advantages of test automation are very clear compared to manual testing. Firstly, the automatic test can improve the test efficiency, so that testers can concentrate on the establishment and development of new test modules, thereby improving the test coverage rate; secondly, automated testing facilitates digital management of the test assets, so that the test assets can be reused throughout the test lifecycle. The current popular automated testing tools in the industry include: 1) selenium: the method comprises the steps that a Web tester is helped to return to an automatic testing tool on a UI (user interface) level through recording user operation; 2) postman: providing a powerful Web API and debugging of HTTP requests, which can send any type of HTTP request (GET, POST, PUT, DELETE …), and can accompany any number of parameters and Headers; 3) SoapUI: the method supports the Soap protocol and supports the import of WSDL documents to quickly develop interface tests.
The above tools can realize the automatic test of software, but obviously have different emphasis and limitations. The Selenium must record user behavior first and then modify the script check point to execute automation, so that only user operation can be simulated, but the test case cannot be automatically created. Both Postman and SoapUI are automated tools at an interface level, and cannot meet the requirement of interface personalized automatic testing.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention aims to provide an input box automatic test method and system, which can automatically create a test case and meet the requirements of interface personalized automatic test.
In order to solve the technical problem, the method for automatically testing the input box comprises the following steps:
creating a test project;
associating an input box interface document with the created test project, wherein the input box interface document comprises interface information of each input box to be tested;
configuring a uniform resource locator of a system under test;
extracting interface information of each input box, and automatically generating a test case of each input box according to a preset test rule based on the extracted interface information of each input box;
automatically inputting the generated test cases into corresponding input boxes of all pages of the tested system one by one, and submitting the test cases to the tested system for verification;
and collecting the actual measurement result returned by the tested system aiming at each test case.
As an improvement of the method of the invention, the method further comprises the following steps: judging whether the actual measurement result of the test case is consistent with the corresponding expected result; and if the measured results of more than one test case of one input box are inconsistent with the corresponding expected results, determining that the corresponding input box is not in accordance with the interface requirement.
As another improvement of the method, the method further comprises the following steps: and generating and outputting a test report, wherein the test report comprises a list of input box IDs or names, test cases, expected results and judgment of whether the actual measurement results meet the expectation.
In order to solve the above technical problems, the present invention provides an automatic test system for an input box, comprising:
the test project creating module is used for creating a test project;
the binding module is used for associating an input box interface document with the created test engineering, wherein the input box interface document comprises interface information of each input box to be tested;
the address configuration module is used for configuring a uniform resource locator of the system to be tested;
the test case generation module is used for extracting interface information of each input box and automatically generating a test case of each input box according to a preset test rule based on the extracted interface information of each input box;
the test module is used for automatically inputting the generated test cases into corresponding input boxes of all pages of the tested system one by one and submitting the input boxes to the tested system for verification;
and the collection module is used for collecting the actual measurement result returned by the tested system aiming at each test case.
As an improvement of the system of the present invention, the system further comprises:
the judging module is used for judging whether the actual measurement result of the test case is consistent with the corresponding expected result;
and the determining module is used for determining that the corresponding input box does not meet the interface requirement when the actual measurement result of more than one test case of the input box is inconsistent with the corresponding expected result.
As another improvement of the system of the present invention, the system further comprises:
and the report output module is used for generating and outputting a test report, wherein the test report comprises a list of judgment whether the input box ID or name, the test case, the expected result and the measured result meet the expectation or not.
To solve the above technical problem, the tangible computer readable medium of the present invention includes computer program code for executing the automatic test method of an input box of the present invention.
To solve the above technical problem, the present invention provides an apparatus, comprising at least one processor; and at least one memory including computer program code, the at least one memory and the computer program code configured to, with the at least one processor, cause the apparatus to perform at least some of the steps of the input box automatic test method of the present invention.
The invention can automatically generate and export the test report according to the interface document of the input box (including but not limited to the text box and the selection box) by automatically scanning and testing whether the input boxes of all pages of the tested system meet the interface requirement. The method can automatically create the test case, can meet the requirement of interface personalized automatic test, greatly reduces the test cost and improves the test efficiency.
Other features and advantages of the present invention will become more apparent from the detailed description of the embodiments of the present invention when taken in conjunction with the accompanying drawings.
Drawings
FIG. 1 is a flow chart of an embodiment of a method according to the present invention.
FIG. 2 is a schematic structural diagram of an embodiment of the apparatus according to the present invention.
For the sake of clarity, the figures are schematic and simplified drawings, which only show details which are necessary for understanding the invention and other details are omitted.
Detailed Description
Embodiments and examples of the present invention will be described in detail below with reference to the accompanying drawings.
The scope of applicability of the present invention will become apparent from the detailed description given hereinafter. It should be understood, however, that the detailed description and the specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only.
The invention is mainly used in the software industry, and is particularly suitable for the automatic test requirement of the input box in the software of the B/S architecture. The following describes the steps of the method for automatically testing an input box according to an embodiment of the present invention with reference to the flowchart shown in fig. 1.
In step S102, test projects, such as test project 1, test project 2, and so on, are created for different systems or projects.
In step S104, the corresponding input box interface document is uploaded and bound with the created test project. The input box interface document contains interface information for each input box to be tested, such as input box ID, input box name, input box type, length range, whether null is allowed, and special character requirements. An example of an input box interface document is as follows:
1) user name input box:
Figure BDA0002188371390000041
2) password input box:
Figure BDA0002188371390000042
3) telephone number input box:
4) mailbox input box:
Figure BDA0002188371390000052
in step S106, a Uniform Resource Locator (URL) of the system under test is configured.
In step S108, interface information of each input box is extracted, and a test case of each input box is automatically generated according to a preset test rule based on the extracted interface information of each input box. The test rules may be boundary value analysis rules and/or equivalence class rules and/or other known test rules.
Taking boundary value analysis and equivalence class rules as examples, the basic rule focuses on the boundary of the input space, values are taken at the positions of a minimum value (min), a value slightly lower than the minimum value (min-), a value slightly higher than the minimum value (min +), a value slightly lower than the maximum value (max-), a maximum value (max) and a value slightly higher than the maximum value (max +1) and the like, a value is taken for a valid equivalence class of the same type to be tested, and a value is also taken for an invalid equivalence class of the same type to be tested. For example, for the telephone number entry boxes listed above, the following test cases may be automatically generated according to the boundary value analysis rules:
Figure BDA0002188371390000053
in step S110, the generated test cases are used to scan and test the input frames of all the pages of the system under test, that is, the generated test cases are automatically input into the corresponding input frames of all the pages of the system under test one by one and submitted to the system under test for testing, and the system under test returns an actual measurement result according to the input of the input frames.
In step S112, the actual measurement result returned by the system under test for each test case is collected.
According to one embodiment of the method of the invention, in addition to the steps described in connection with fig. 1, the method comprises the steps of: judging whether the actual measurement result of the test case is consistent with the corresponding expected result; and if the measured results of all the test cases of an input box are consistent with the corresponding expected results, determining that the input box meets the interface requirements. Otherwise, if only the measured result of one test case in all the test cases of one input box is inconsistent with the corresponding expected result, the input box is determined to be not in accordance with the interface requirement.
According to another embodiment of the method of the present invention, generating and outputting a test report visually reflects to a programmer which portions of the input box interface are undesirable. The test report includes a list of input box IDs or names, test cases, expected results, measured results, and/or a decision of whether to agree/agree with expectations. An example of a test report is as follows:
Figure BDA0002188371390000061
fig. 2 is a schematic structural diagram of an embodiment of an input box automatic test system according to the present invention. The automatic test system for an input box of the embodiment includes: a test project creation module 202, configured to create a test project; a binding module 204, configured to associate an input box interface document with the created test project, where the input box interface document includes interface information of each input box to be tested; an address configuration module 206, configured to configure a uniform resource locator of the system under test; the test case generation module 208 is configured to extract interface information of each input box, and automatically generate a test case for each input box according to a preset test rule based on the extracted interface information of each input box; the test module 210 is configured to automatically input the generated test cases into corresponding input boxes of all pages of the system under test one by one, and submit the test cases to the system under test for verification; and the collecting module 212 is configured to collect the measured result returned by the system under test for each test case.
The particular features, structures, or characteristics of the various embodiments described herein may be combined as suitable in one or more embodiments of the invention. Additionally, in some cases, the order of steps depicted in the flowcharts and/or in the pipelined process may be modified, as appropriate, and need not be performed exactly in the order depicted. In addition, various aspects of the invention may be implemented using software, hardware, firmware, or a combination thereof, and/or other computer implemented modules or devices that perform the described functions. Software implementations of the present invention may include executable code stored in a computer readable medium and executed by one or more processors. The computer readable medium may include a computer hard drive, ROM, RAM, flash memory, portable computer storage media such as CD-ROM, DVD-ROM, flash drives, and/or other devices, for example, having a Universal Serial Bus (USB) interface, and/or any other suitable tangible or non-transitory computer readable medium or computer memory on which executable code may be stored and executed by a processor. The present invention may be used in conjunction with any suitable operating system.
As used herein, the singular forms "a", "an" and "the" include plural references (i.e., have the meaning "at least one"), unless the context clearly dictates otherwise. It will be further understood that the terms "has," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and/or groups thereof. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
The foregoing describes some preferred embodiments of the present invention, but it should be emphasized that the invention is not limited to these embodiments, but can be implemented in other ways within the scope of the inventive subject matter. The present invention can be modified and modified by those skilled in the art without departing from the scope of the present invention, and the modified and modified embodiments are also within the scope of the present invention.

Claims (10)

1. An automatic test method for an input box, the method comprising:
creating a test project;
associating an input box interface document with the created test project, wherein the input box interface document comprises interface information of each input box to be tested;
configuring a uniform resource locator of a system under test;
extracting interface information of each input box, and automatically generating a test case of each input box according to a preset test rule based on the extracted interface information of each input box;
automatically inputting the generated test cases into corresponding input boxes of all pages of the tested system one by one, and submitting the test cases to the tested system for verification;
and collecting the actual measurement result returned by the tested system aiming at each test case.
2. The method of claim 1, further comprising:
judging whether the actual measurement result of the test case is consistent with the corresponding expected result;
and if the measured results of more than one test case of one input box are inconsistent with the corresponding expected results, determining that the corresponding input box is not in accordance with the interface requirement.
3. The method of claim 2, further comprising:
and generating and outputting a test report, wherein the test report comprises an input box ID or name, a test case, an expected result, an actual measurement result and a list of judgment on consistency.
4. The method of claim 1, wherein the interface information for each input box comprises: input box ID, input box name, input box type, length range, whether null is allowed, and special character requirements.
5. The method of claim 1, wherein the predetermined test rule comprises one or more of: boundary value analysis rules and equivalence class rules.
6. An input box automatic test system, characterized in that the system comprises:
the test project creating module is used for creating a test project;
the binding module is used for associating an input box interface document with the created test engineering, wherein the input box interface document comprises interface information of each input box to be tested;
the address configuration module is used for configuring a uniform resource locator of the system to be tested;
the test case generation module is used for extracting interface information of each input box and automatically generating a test case of each input box according to a preset test rule based on the extracted interface information of each input box;
the test module is used for automatically inputting the generated test cases into corresponding input boxes of all pages of the tested system one by one and submitting the input boxes to the tested system for verification;
and the collection module is used for collecting the actual measurement result returned by the tested system aiming at each test case.
7. The system of claim 6, further comprising:
the judging module is used for judging whether the actual measurement result of the test case is consistent with the corresponding expected result;
and the determining module is used for determining that the corresponding input box does not meet the interface requirement when the actual measurement result of more than one test case of the input box is inconsistent with the corresponding expected result.
8. The system of claim 7, further comprising:
and the report output module is used for generating and outputting a test report, wherein the test report comprises an input box ID or name, a test case, an expected result, an actual measurement result and a list of judgment on consistency.
9. The system of claim 6, wherein the interface information for each input box comprises: input box ID, input box name, input box type, length range, whether null is allowed, and special character requirements.
10. The system of claim 6, wherein the predetermined test rules comprise one or more of: boundary value analysis rules and equivalence class rules.
CN201910823669.3A 2019-09-02 2019-09-02 Automatic test method and system for input box Pending CN110750438A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910823669.3A CN110750438A (en) 2019-09-02 2019-09-02 Automatic test method and system for input box

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910823669.3A CN110750438A (en) 2019-09-02 2019-09-02 Automatic test method and system for input box

Publications (1)

Publication Number Publication Date
CN110750438A true CN110750438A (en) 2020-02-04

Family

ID=69276003

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910823669.3A Pending CN110750438A (en) 2019-09-02 2019-09-02 Automatic test method and system for input box

Country Status (1)

Country Link
CN (1) CN110750438A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528408A (en) * 2016-10-19 2017-03-22 南华大学 Test system of nuclear power design program
CN108427632A (en) * 2017-02-14 2018-08-21 腾讯科技(深圳)有限公司 Automatic test approach and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528408A (en) * 2016-10-19 2017-03-22 南华大学 Test system of nuclear power design program
CN108427632A (en) * 2017-02-14 2018-08-21 腾讯科技(深圳)有限公司 Automatic test approach and device

Similar Documents

Publication Publication Date Title
CN108255730B (en) Software interface testing method, testing equipment, storage medium and device
CN109684847B (en) Automatic repairing method, device, equipment and storage medium for script loopholes
CN110798445B (en) Public gateway interface testing method and device, computer equipment and storage medium
CN108923997B (en) Cloud service node automatic testing method and device based on python
CN106681854B (en) Information verification method, device and system
CN114546738B (en) Universal test method, system, terminal and storage medium for server
CN110019067B (en) Log analysis method and system
CN114328276A (en) Test case generation method and device, and test case display method and device
CN106972983B (en) Automatic testing device and method for network interface
CN106557419B (en) Program testing method and device
CN112181845A (en) Interface testing method and device
CN110750438A (en) Automatic test method and system for input box
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN110728593A (en) Case planning method and device, electronic device, and storage medium
CN111813648A (en) Automatic testing method and device applied to App, storage medium and electronic equipment
CN114238048B (en) Automatic testing method and system for Web front-end performance
CN107797917B (en) Performance test script generation method and device
CN115146581A (en) Project management method, defect analysis method, related device and readable storage medium
CN114168461A (en) Performance test method and system applied to domestic operating system
CN114238733A (en) Key information extraction method and device, computer storage medium and electronic equipment
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN111881112A (en) Database configuration method and device and related equipment
CN112286800B (en) Auxiliary analysis method and system for functional test points
CN109144866B (en) Software testing method and software testing device based on household appliances
CN110661678B (en) Abnormity monitoring 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 801-2, floor 8, building 3, No. 22, Ronghua Middle Road, Beijing Economic and Technological Development Zone, Beijing 100176

Applicant after: Wanghai Kangxin (Beijing) Technology Co.,Ltd.

Address before: 100060 room 07, block 2, building B, No. 12, Hongda North Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Applicant before: BEIJING NEUSOFT VIEWHIGH TECHNOLOGY Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200204