CN109828905B - Automatic test method, device, computer device and storage medium - Google Patents

Automatic test method, device, computer device and storage medium Download PDF

Info

Publication number
CN109828905B
CN109828905B CN201811537730.XA CN201811537730A CN109828905B CN 109828905 B CN109828905 B CN 109828905B CN 201811537730 A CN201811537730 A CN 201811537730A CN 109828905 B CN109828905 B CN 109828905B
Authority
CN
China
Prior art keywords
test
automatic
cases
test case
test cases
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.)
Active
Application number
CN201811537730.XA
Other languages
Chinese (zh)
Other versions
CN109828905A (en
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811537730.XA priority Critical patent/CN109828905B/en
Publication of CN109828905A publication Critical patent/CN109828905A/en
Application granted granted Critical
Publication of CN109828905B publication Critical patent/CN109828905B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides an automatic test method, which comprises the following steps: acquiring a test case set, wherein the test case set comprises a plurality of test cases for testing one item to be tested; classifying all test cases in the test case set according to test types, wherein the test types comprise automatic test and manual test; the test cases of the automatic test type are converted into corresponding automatic test scripts one by one, and the automatic test is completed by executing the test scripts; generating a manual test case list according to the test cases of the manual test type, and generating notification information to notify preset personnel to perform manual test on the test cases in the manual test case list; and generating a test report. The invention also provides an automatic testing device, a computer device and a computer readable storage medium. The invention can improve the test efficiency and ensure the test quality.

Description

Automatic test method, device, computer device and storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to an automated testing method and apparatus, an electronic device, and a computer readable storage medium.
Background
Regression testing is a very important and costly process in software testing, and in agile projects, multiple regression tests are typically required during a test cycle. And because of Application (APP) testing itself specificity, the test period is shorter (generally 5 days) but the regression test cases are generally more, and with the continuous perfection of APP functions, the full-function regression use cases are also continuously increasing, and the regression test has become one of the biggest pain points of testers in the test industry. If test time is saved by simplifying regression test cases, the test quality is difficult to guarantee, and serious problems may occur due to incomplete test caused by omission. Therefore, how to improve the test efficiency and the test quality is a problem to be solved.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an automated testing method and apparatus, an electronic device, and a computer-readable storage medium, which can improve testing efficiency and testing quality.
A first aspect of the present application provides an automated testing method applied to a computer device, the method comprising:
when an operation instruction for acquiring a test case set is received, acquiring the test case set, wherein the test case set comprises a plurality of test cases for testing one item to be tested;
Dividing all test cases in the test case set into automatic test cases and non-automatic test cases according to test types, and respectively storing the classified test cases according to the types;
the test cases classified into the automatic test case types are converted into corresponding automatic test scripts one by one, and the automatic test scripts are executed to complete automatic tests;
generating a non-automatic test case list from test cases classified as non-automatic test case types, and generating notification information to notify preset personnel to perform non-automatic test on the test cases in the non-automatic test case list; a kind of electronic device with high-pressure air-conditioning system
And reading the automatic test result and the non-automatic test result, and generating a test report.
Preferably, a preset class label is added to each test case, and the method for classifying all the test cases in the test case set into automatic test cases and non-automatic test cases according to test types includes: searching and identifying class labels in each test case, classifying the test cases with the same class labels into the same class, and then storing the test cases with the same class into the same test case list.
Preferably, the preset category label is a user-defined category label, and the method further includes: when an operation instruction of a newly added category label is received, the newly added category label of the user is obtained and stored; when an operation instruction for deleting the category label is received, deleting the category label; when an operation instruction for modifying the category label is received, the category label is modified and stored.
Preferably, the method for classifying all test cases in the test case set into automatic test cases and non-automatic test cases according to test types includes: creating a test case according to the operation instruction for creating the test case; receiving a storage instruction input by a user, and storing the created test cases in different storage positions according to the test types according to the storage position information in the storage instruction; and classifying the test cases according to the storage positions of the test cases.
Preferably, converting the test cases of the automation test type into corresponding automation test scripts piece by piece includes: defining a corresponding relation mapping table between operation command keywords and preset test script codes; reading operation command keywords in the test case, wherein the operation command keywords in the test case are named by keywords in the mapping table; searching a corresponding preset test script code in the mapping table according to the operation command keywords in the test case; forming an automatic test script code according to a preset test script code; and verifying the code integrity of the automatic test script to enable the code of the automatic test script to accord with the code of the automatic test tool code specification.
Preferably, the notification information is one or more of a short message, a mail, a message box and a pop-up page.
Preferably, the automated test method is automatically performed at a preset time by Jenkins continuous integration settings.
A second aspect of the present application provides an automated testing apparatus comprising:
the acquisition module is used for acquiring a test case set when receiving an operation instruction for acquiring the test case set, wherein the test case set comprises a plurality of test cases for testing one item to be tested;
the classification module is used for classifying all test cases in the test case set into automatic test cases and non-automatic test cases according to test types, and storing the classified test cases respectively according to the types;
the automatic test module is used for converting test cases classified into automatic test case types into corresponding automatic test scripts one by one, and executing the automatic test scripts to complete automatic tests;
the prompting module is used for generating a non-automatic test case list according to the test cases of the non-automatic test case type and generating notification information to inform preset personnel to perform non-automatic test on the test cases in the non-automatic test case list; a kind of electronic device with high-pressure air-conditioning system
And the test report generating module is used for reading the automatic test result and the non-automatic test result and generating a test report.
A third aspect of the application provides a computer apparatus comprising a processor for implementing an automated test method as described above when executing a computer program stored in a memory.
A fourth aspect of the application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements an automated test method as described above.
According to the application, a large number of test cases are classified according to the test types, the test scripts of the automatic test types are converted into the automatic test scripts to execute the automatic test, and the test cases needing the non-automatic test are generated into the non-automatic test case list to inform a user, so that the user can perform the non-automatic test on the test cases in the list according to the non-automatic test case list, the test efficiency can be effectively improved, and the test quality can be ensured.
Drawings
Fig. 1 is a schematic view of an application environment architecture of an automated testing method according to an embodiment of the present application.
Fig. 2 is a flowchart of an automated testing method according to a second embodiment of the present application.
Fig. 3 is a schematic structural diagram of an automated testing apparatus according to a third embodiment of the present application.
Fig. 4 is a schematic diagram of a computer device according to a fourth embodiment of the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will be more clearly understood, a more particular description of the application will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. It should be noted that, without conflict, the embodiments of the present application and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, and the described embodiments are merely some, rather than all, embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
Example 1
Referring to fig. 1, a schematic diagram of an application environment of an automated testing method according to an embodiment of the invention is shown.
The automated test method of the invention is applied in an environment comprising a computer device 1 and at least one terminal device 2, said computer device 1 and at least one terminal device 2 establishing a communication connection through a network. In this embodiment, the computer apparatus 1 may be a server or a personal computer, where the server may be a single server, a server cluster, or a cloud server.
The terminal device 2 is, but not limited to, an electronic apparatus such as a server, a smart phone, a tablet computer, a laptop computer, a desktop computer, or the like.
In one embodiment, the computer device 1 and the at least one terminal device 2 may establish a communication connection by wire (e.g., USB (Universal Serial Bus, universal serial bus) or wireless means, which may be any type of conventional wireless communication, such as radio, wireless fidelity (Wireless Fidelity, WIFI), cellular, satellite, broadcast, etc., wireless communication technologies may include, but are not limited to, global system for mobile communications (Global System for Mobile Communications, GSM), general packet radio service (General Packet Radio Service, GPRS), code Division multiple access (Code Division Multiple Access, CDMA), wideband code Division multiple access (W-CDMA), CDMA2000, IMT single carrier (IMT Single Carrier), enhanced data rate Evolution (Enhanced Data Rates for GSM Evolution, EDGE), long Term Evolution (Long Term Evolution, LTE), long Term Evolution-advanced (LTE), time Division Long Term Evolution (Time-Division, LTE), high performance radio local area network (High Performance Radio Local Area Network, hiperLAN), high performance radio wide area network (High Performance Radio Wide Area Network, hiperWAN), local multipoint distribution service (Local Multipoint Distribution Service, flash), bluetooth full-carrier (IMT Single Carrier), enhanced data rate (GSM access (Enhanced Data Rates for GSM Evolution, EDGE), long-Term Evolution (Long-Term Evolution, LTE), time Division multiple access (Time-Division, LTE), time Division multiple access (LTE), bluetooth (45, wideband access (bluetooth), full-access (full-frequency Division), wireless access (wideband), HC-SDMA), universal mobile telecommunications system (Universal Mobile Telecommunications System, UMTS), universal mobile telecommunications system Time division duplexing (UMTS Time-Division Duplexing, UMTS-TDD), evolved high speed packet access (Evolved High Speed Packet Access, HSPA+), time division synchronous code division multiple access (Time Division Synchronous Code Division Multiple Access, TD-SCDMA), evolved Data optimization (EV-DO), digital enhanced cordless telecommunications (Digital Enhanced Cordless Telecommunications, DECT), among others.
The computer device 1 to be automatically tested can be directly integrated with the automatic test function provided by the method of the invention or be provided with a client for realizing the method of the invention. For another example, the method provided by the invention can also be operated on a server and other devices in the form of a software development kit (Software Development Kit, SDK), and an interface for automatic test functions is provided in the form of the SDK, so that the computer device 1 or other devices can process abnormal application programs through the provided interface.
Example two
Fig. 2 is a flowchart of an automated testing method according to a second embodiment of the present invention. The order of the steps in the flow diagrams may be changed, and some steps may be omitted, according to different needs.
Step S1, when an operation instruction for acquiring a test case set is received, acquiring the test case set, wherein the test case set comprises a plurality of test cases for testing one item to be tested.
The test case set may be stored in a test case database, where the test case database may store a plurality of test case sets of items to be tested, where each test case set has unique identification information, for example, the identification information may be a name of the item to be tested corresponding to the test case set. In this embodiment, when an operation instruction for acquiring a test case set is received, identification information of the test case set in the operation instruction is acquired, and the test case set corresponding to the identification information is acquired from a test case library.
In this embodiment, the test cases in the test case set are all regression test cases for testing one item to be tested. For example, an Application (APP) test case may exceed 1000 test cases.
The test case is used for testing items to be tested in an Android (Android) environment, an IOS environment and a browser.
In this embodiment, the method is applied to a user terminal and/or a server. The user terminal can be electronic equipment such as a computer, a desktop computer, a notebook computer and the like. The server may be a single server or a group of servers.
Step S2, dividing all test cases in the test case set into automatic test cases and non-automatic test cases according to test types, and storing the classified test cases respectively according to the types.
Wherein, the automatic test may further comprise UI automatic test, interface automatic test, etc.
In a first embodiment, a preset class label is added to each test case, and the method for classifying all test cases in the test case set according to test types includes: classifying the test cases in the test case set according to the preset class labels in the test cases, namely classifying the test cases with the same preset class labels in the test cases into the same class.
The creating of each test case in the test case set comprises the following steps:
1) Creating a plurality of test cases for testing the items to be tested according to the test case creation instruction;
in one embodiment, the test cases are created by manual writing by a user.
In another embodiment, the method for creating the test case includes:
a. after receiving a test case generating instruction input by a user, calling a preset test case template;
for example, after entering the test case generation interface, the user clicks the test case adding button to generate a test case generating instruction, and the user can select a corresponding preset test case template according to needs, where the test case template can be set by the user in a self-defined manner according to needs.
b. And adding the test data input by the user into a preset test case template to generate a corresponding test case.
2) And adding a category label in each test case according to the label adding operation instruction, wherein the category label is used for identifying the category to which the test case belongs. For example, a category label 01 is added to a test case of an automation test, a list label 02 is added to a test case requiring a user to perform a non-automation test, a category label A is further added to a test case of a UI automation test in the test case of the automation test, a category label B is added to a test case of an interface automation test, that is, the category label of the test case of the UI automation test is 01-A, and the category label of the test case of the interface automation test is 01-B.
Accordingly, the specific method for classifying the test cases in the test case set according to the test types comprises the following steps:
1) Searching and identifying class labels in each test case, and classifying the test cases with the same class labels into the same class;
2) And storing the test cases of the same category into the same test case list.
For example, all test cases with category labels 01-A are stored in list one, all test cases with category labels 01-B are stored in list two, and all test cases with category labels 02 are stored in list three.
In an embodiment, the category label may be a user-defined category label. The method can further comprise the following steps:
when an operation instruction of a newly added category label is received, the newly added category label of the user is obtained and stored;
when an operation instruction for deleting the category label is received, deleting the category label;
when an operation instruction for modifying the category label is received, the category label is modified and stored.
In a second embodiment, the method for classifying all test cases in the test case set according to the test type includes:
Creating a test case according to the operation instruction for creating the test case;
receiving a storage instruction input by a user, and storing the created test cases in different storage positions according to the test types according to the storage position information in the storage instruction; a kind of electronic device with high-pressure air-conditioning system
And classifying the test cases according to the storage positions of the test cases.
For example, test cases that can be automatically tested are stored in an automatic test folder, test cases that need to be manually tested are stored in a manual test folder, further, in the automatic test folder, test cases for UI automation tests are stored in a UI automation test folder, and test cases for interface automation tests are stored in an interface automation test folder.
And step S3, converting the test cases of the automatic test case type into corresponding automatic test scripts one by one, and executing the automatic test scripts to complete automatic tests.
The step of converting test cases of an automatic test type into corresponding automatic test scripts one by one is as follows: and converting the test cases of the UI automation test type into UI automation test scripts, and converting the test cases of the interface automation test type into interface automation test scripts. For UI automation test, code script can be written through an automation test framework such as Appium, UIAutomator, bobotium, and of course, UI automation test can be realized through other UI automation test platforms which are self-developed by enterprises. For the automatic interface test, the automatic interface test can be realized through Jmeter, postman tools, and of course, the automatic interface test can also be realized through other automatic interface test platforms which are developed by enterprises. The foregoing is by way of example only and is not limiting.
Specifically, in one embodiment, a method for converting test cases into automated test scripts includes:
1) Defining a corresponding relation mapping table between operation command keywords and preset test script codes;
2) Reading operation command keywords in the test case, wherein the operation command keywords in the test case are named by keywords in the mapping table;
3) Searching a corresponding preset test script code in the mapping table according to the operation command keywords in the test case;
4) Forming an automatic test script code according to a preset test script code;
the specific format of the automated test script relies on automated test tools, such as: quicktest Professional (QTP) and IBM Rational Functional Tester (RFT), etc. The script in this embodiment defaults to generating java code for this automated test tool of RFT. Such as: operation- > login user a, script code is generated:
LoginForm login=new LoginForm(ProcessA);
login.LoginByUserName(UserA.getName);
where "login" is a key, and user a thereafter automatically replaces parameters ProcessA and UserA in the script code.
Such as: verification- > user A login successfully obtains data, and then script codes are generated:
Assert(UserA.Online&&UserA.Info)。
the user A can automatically replace a parameter UserA in the script code by taking the login success and the acquired data as keywords.
5) And verifying the code integrity of the automatic test script to enable the code of the automatic test script to accord with the code of the automatic test tool code specification.
And S4, generating a non-automatic test case list from the test cases classified as the non-automatic test case types, and generating notification information to notify preset personnel to perform non-automatic test on the test cases in the non-automatic test case list.
In an embodiment, the notification information may be a short message, a mail, a message box, a pop-up page, or the like, to notify a preset person.
The notification information may include storage location information of the non-automated test list. For example, the content of the notification information may be: the test cases in the following list need you to do non-automated test, please execute the test operation as soon as possible. The list storage locations are as follows: xxxx.
S5, reading an automatic test result and a non-automatic test result, and generating a test report.
In an embodiment, the test report may be displayed through a user interface, and may be exported by a file in a format of PDF, WORD, excel, text file, or the like.
In one embodiment, the test method may further include:
And sending the test report to a preset person in a preset mode.
The preset manner may be mail, short message, etc., the preset person may be a test manager, a tester, a developer, etc., and the contact manner of the preset person may be stored in the storage device in advance.
In one embodiment, the automated test method comprises: and automatically executing the automatic test method at a preset time through Jenkins continuous integration setting.
Jenkins is an open source software project, is a continuous integration tool based on Java development, is used for monitoring continuous repeated work, and aims to provide an open and easy-to-use software platform so that continuous integration of software is possible.
Example III
Referring to fig. 3, a block diagram of an automated test equipment according to a preferred embodiment of the present invention is shown.
In some embodiments, the automated test equipment 10 is run in a computer device. The automated test equipment 10 may comprise a plurality of functional modules consisting of program code segments. Program code for each program segment in the automated test equipment 10 may be stored in a memory of a computer device and executed by the at least one processor to implement automated test functions.
In this embodiment, the automated test equipment 10 may be divided into a plurality of functional modules according to the functions it performs. Referring to fig. 3, the functional module may include: an acquisition module 101, a classification module 102, an automated test module 103, a prompt module 104, and a test report generation module 105. The module referred to in the present invention refers to a series of computer program segments capable of being executed by at least one processor and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The obtaining module 101 is configured to obtain a test case set when receiving an operation instruction for obtaining the test case set, where the test case set includes a plurality of test cases for testing one item to be tested.
The test case set may be stored in a test case database, where the test case database may store a plurality of test case sets of items to be tested, where each test case set has unique identification information, for example, the identification information may be a name of the item to be tested corresponding to the test case set. In this embodiment, when an operation instruction for acquiring a test case set is received, identification information of the test case set in the operation instruction is acquired, and the test case set corresponding to the identification information is acquired from a test case library.
In this embodiment, the test cases in the test case set are all regression test cases for testing one item to be tested. For example, an Application (APP) test case may exceed 1000 test cases.
The test case is used for testing items to be tested in an Android (Android) environment, an IOS environment and a browser.
The classifying module 102 is configured to divide all test cases in the test case set into an automated test case and a non-automated test case according to the test types, and store the classified test cases according to the types.
Wherein, the automatic test may further comprise UI automatic test, interface automatic test, etc.
In the first embodiment, a preset class label is added to each test case, and the method for classifying, by the classification module 102, all the test cases in the test case set according to the test type includes: classifying the test cases in the test case set according to the preset class labels in the test cases.
The creating of each test case in the test case set comprises the following steps:
1) Creating a plurality of test cases for testing the items to be tested according to the test case creation instruction;
In one embodiment, the test cases are created by manual writing by a user.
In another embodiment, the method for creating the test case includes:
a. after receiving a test case generating instruction input by a user, calling a preset test case template;
for example, after entering the test case generation interface, the user clicks the test case adding button to generate a test case generating instruction, and the user can select a corresponding preset test case template according to needs, where the test case template can be set by the user in a self-defined manner according to needs.
b. And adding the test data input by the user into a preset test case template to generate a corresponding test case.
2) And adding a category label in each test case according to the label adding operation instruction, wherein the category label is used for identifying the category to which the test case belongs. For example, a category label 01 is added to a test case of an automation test, a list label 02 is added to a test case requiring manual testing by a user, further, a category label A is further added to a test case of a UI automation test in the test case of the automation test, a category label B is added to a test case of an interface automation test, namely, the category label of the test case of the UI automation test is 01-A, and the category label of the test case of the interface automation test is 01-B.
Accordingly, the specific method for classifying the test cases in the test case set by the classification module 102 according to the test types includes:
1) Searching and identifying class labels in each test case, and classifying the test cases with the same class labels into the same class;
2) And storing the test cases of the same category into the same test case list.
For example, all test cases with category labels 01-A are stored in list one, all test cases with category labels 01-B are stored in list two, and all test cases with category labels 02 are stored in list three.
In an embodiment, the category label may be a user-defined category label. The classification module 102 is further configured to perform the following operations:
when an operation instruction of a newly added category label is received, the newly added category label of the user is obtained and stored;
when an operation instruction for deleting the category label is received, deleting the category label;
when an operation instruction for modifying the category label is received, the category label is modified and stored.
In a second embodiment, the method for classifying, by the classification module 102, all test cases in the test case set according to the test type includes:
Creating a test case according to the operation instruction for creating the test case;
receiving a storage instruction input by a user, and storing the created test cases in different storage positions according to the test types according to the storage position information in the storage instruction; a kind of electronic device with high-pressure air-conditioning system
And classifying the test cases according to the storage positions of the test cases.
For example, test cases that can be automatically tested are stored in an automatic test folder, test cases that need to be manually tested are stored in a manual test folder, further, in the automatic test folder, test cases for UI automation tests are stored in a UI automation test folder, and test cases for interface automation tests are stored in an interface automation test folder.
The automatic test module 103 is configured to convert test cases of an automatic test type into corresponding automatic test scripts one by one, and execute the test scripts to complete automatic tests.
The step of converting test cases of an automatic test type into corresponding automatic test scripts one by one is as follows: and converting the test cases of the UI automation test type into UI automation test scripts, and converting the test cases of the interface automation test type into interface automation test scripts. For UI automation test, code script can be written through an automation test framework such as Appium, UIAutomator, bobotium, and of course, UI automation test can be realized through other UI automation test platforms which are self-developed by enterprises. For the automatic interface test, the automatic interface test can be realized through Jmeter, postman tools, and of course, the automatic interface test can also be realized through other automatic interface test platforms which are developed by enterprises. The foregoing is by way of example only and is not limiting.
Specifically, in one embodiment, the method for converting the test case into the automation test script by the automation test module 103 includes:
1) Defining a corresponding relation mapping table between operation command keywords and preset test script codes;
2) Reading operation command keywords in the test case, wherein the operation command keywords in the test case are named by keywords in the mapping table;
3) Searching a corresponding preset test script code in the mapping table according to the operation command keywords in the test case;
4) Forming an automatic test script code according to a preset test script code;
the specific format of the automated test script relies on automated test tools, such as: quicktest Professional (QTP) and IBM Rational Functional Tester (RFT), etc. The script in this embodiment defaults to generating java code for this automated test tool of RFT. Such as: operation- > login user a, script code is generated:
LoginForm login=new LoginForm(ProcessA);
login.LoginByUserName(UserA.getName);
where "login" is a key, and user a thereafter automatically replaces parameters ProcessA and UserA in the script code.
Such as: verification- > user A login successfully obtains data, and then script codes are generated:
Assert(UserA.Online&&UserA.Info)。
The user A can automatically replace a parameter UserA in the script code by taking the login success and the acquired data as keywords.
5) And verifying the code integrity of the automatic test script to enable the code of the automatic test script to accord with the code of the automatic test tool code specification.
The prompting module 104 is configured to generate a non-automation test case list from test cases classified as non-automation test case types, and generate notification information to notify a preset person to perform non-automation test on the test cases in the non-automation test case list.
In an embodiment, the notification information may be a short message, a mail, a message box, a pop-up page, or the like, to notify a preset person.
The notification information may include storage location information of the manual test list. For example, the content of the notification information may be: the test cases in the following list need you to do non-automated test, please execute the test operation as soon as possible. The list storage locations are as follows: xxxx.
The test report generating module 105 is configured to read the automated test result and the non-automated test result, and generate a test report.
In an embodiment, the test report may be displayed through a user interface, and may be exported by a file in a format of PDF, WORD, excel, text file, or the like.
In one embodiment, the test report generating module 105 is further configured to send the test report to a preset person in a preset manner.
The preset manner may be mail, short message, etc., the preset person may be a test manager, a tester, a developer, etc., and the contact manner of the preset person may be stored in the storage device in advance.
Example IV
FIG. 4 is a schematic diagram of a computer device according to a preferred embodiment of the invention.
The computer device 1 comprises a memory 20, a processor 30 and a computer program 40, such as an automated test program, stored in the memory 20 and executable on the processor 30. The steps of the above-described embodiment of the automated test method, such as steps S1-S5 shown in fig. 2, are performed by the processor 30 when executing the computer program 40. Alternatively, the processor 30, when executing the computer program 40, performs the functions of the modules/units of the automated test equipment embodiments described above, such as modules 101-105 in FIG. 3.
Illustratively, the computer program 40 may be partitioned into one or more modules/units that are stored in the memory 20 and executed by the processor 30 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used for describing the execution of the computer program 40 in the computer device 1. For example, the computer program 40 may be partitioned into the acquisition module 101, classification module 102, automated test module 103, prompt module 104, test report generation module 105 of FIG. 3. For specific functions of each module, see embodiment three.
The computer device 1 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. It will be appreciated by a person skilled in the art that the schematic diagram is only an example of the computer apparatus 1 and does not constitute a limitation of the computer apparatus 1, and may comprise more or less components than shown, or may combine certain components, or different components, e.g. the computer apparatus 1 may further comprise input and output devices, network access devices, buses, etc.
The processor 30 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor 30 may be any conventional processor or the like, the processor 30 being the control center of the computer device 1, the various interfaces and lines being used to connect the various parts of the overall computer device 1.
The memory 20 may be used to store the computer program 40 and/or modules/units, and the processor 30 may perform various functions of the computer device 1 by executing or executing the computer program and/or modules/units stored in the memory 20, and invoking data stored in the memory 20. The memory 20 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer apparatus 1 (such as audio data, phonebook, etc.), and the like. In addition, the memory 20 may include high-speed random access memory, and may also include nonvolatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid state storage device.
The modules/units integrated in the computer device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
In the several embodiments provided herein, it should be understood that the disclosed computer apparatus and method may be implemented in other ways. For example, the above-described embodiments of the computer apparatus are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be other manners of division when actually implemented.
In addition, each functional unit in the embodiments of the present invention may be integrated in the same processing unit, or each unit may exist alone physically, or two or more units may be integrated in the same unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. Multiple units or computer means recited in the computer means claim may also be implemented by means of software or hardware by means of the same unit or computer means. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. An automated testing method applied to a computer device, the method comprising:
when an operation instruction for acquiring a test case set is received, acquiring the test case set, wherein the test case set comprises a plurality of test cases for testing one item to be tested;
dividing all test cases in the test case set into automatic test cases and non-automatic test cases according to test types, and respectively storing the classified test cases according to the types, wherein the test cases comprise category labels which are used for identifying the categories to which the test cases belong;
converting test cases classified as automation test case types into corresponding automation test scripts one by one, including: defining a corresponding relation mapping table between operation command keywords and preset test script codes; reading operation command keywords in the test case, wherein the operation command keywords in the test case are named by keywords in the mapping table; searching a corresponding preset test script code in the mapping table according to the operation command keywords in the test case; forming an automatic test script code according to a preset test script code; verifying the code integrity of the automatic test script, enabling the code of the automatic test script to accord with the code of the automatic test tool code specification, and executing the automatic test script to complete the automatic test;
Generating a non-automatic test case list from test cases classified as non-automatic test case types, and generating notification information to inform preset personnel to perform non-automatic test on the test cases in the non-automatic test case list, wherein the notification information at least comprises storage position information of the non-automatic test case list; a kind of electronic device with high-pressure air-conditioning system
Reading an automatic test result and a non-automatic test result, and generating a test report;
the creating of each test case in the test case set includes: creating a plurality of test cases for testing the items to be tested according to the test case creation instruction; and adding a category label in each test case according to the label adding operation instruction.
2. The automated test method of claim 1, wherein the method for classifying all test cases in the test case set into automated test cases and non-automated test cases according to test types includes: searching and identifying class labels in each test case, classifying the test cases with the same class labels into the same class, and then storing the test cases with the same class into the same test case list.
3. The automated testing method of claim 2, wherein the preset category label is a user-defined category label, the method further comprising:
when an operation instruction of a newly added category label is received, the newly added category label of the user is obtained and stored;
when an operation instruction for deleting the category label is received, deleting the category label;
when an operation instruction for modifying the category label is received, the category label is modified and stored.
4. The automated test method of claim 1, wherein the method of classifying all test cases in the set of test cases into automated test cases and non-automated test cases by test type comprises:
creating a test case according to the operation instruction for creating the test case;
receiving a storage instruction input by a user, and storing the created test cases in different storage positions according to the test types according to the storage position information in the storage instruction; a kind of electronic device with high-pressure air-conditioning system
And classifying the test cases according to the storage positions of the test cases.
5. The automated testing method of claim 1, wherein the notification information is one or more of a short message, a mail, a message box, and a pop-up page.
6. The automated test method of claim 1, wherein the automated test method is automatically performed at a preset time by Jenkins continuous integration settings.
7. An automated test apparatus, the automated test apparatus comprising:
the acquisition module is used for acquiring a test case set when receiving an operation instruction for acquiring the test case set, wherein the test case set comprises a plurality of test cases for testing one item to be tested;
the classification module is used for classifying all test cases in the test case set into automatic test cases and non-automatic test cases according to test types, and storing the classified test cases respectively according to the types, wherein the test cases comprise category labels, and the category labels are used for identifying the categories to which the test cases belong;
the automatic test module is used for converting test cases classified into automatic test case types into corresponding automatic test scripts one by one, and comprises the following components: defining a corresponding relation mapping table between operation command keywords and preset test script codes; reading operation command keywords in the test case, wherein the operation command keywords in the test case are named by keywords in the mapping table; searching a corresponding preset test script code in the mapping table according to the operation command keywords in the test case; forming an automatic test script code according to a preset test script code; verifying the code integrity of the automatic test script, enabling the code of the automatic test script to accord with the code of the automatic test tool code specification, and executing the automatic test script to complete the automatic test;
The prompting module is used for generating a non-automatic test case list according to the test cases of the non-automatic test case type and generating notification information to inform preset personnel to perform non-automatic test on the test cases in the non-automatic test case list, wherein the notification information at least comprises storage position information of the non-automatic test case list; a kind of electronic device with high-pressure air-conditioning system
The test report generation module is used for reading the automatic test result and the non-automatic test result and generating a test report;
the creating of each test case in the test case set includes: creating a plurality of test cases for testing the items to be tested according to the test case creation instruction; and adding a category label in each test case according to the label adding operation instruction.
8. A computer apparatus, characterized in that: the computer device comprising a processor for implementing the automated test method according to any of claims 1-6 when executing a computer program stored in a memory.
9. A computer-readable storage medium having stored thereon a computer program, characterized by: the computer program, when executed by a processor, implements the automated test method according to any of claims 1-6.
CN201811537730.XA 2018-12-15 2018-12-15 Automatic test method, device, computer device and storage medium Active CN109828905B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811537730.XA CN109828905B (en) 2018-12-15 2018-12-15 Automatic test method, device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811537730.XA CN109828905B (en) 2018-12-15 2018-12-15 Automatic test method, device, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN109828905A CN109828905A (en) 2019-05-31
CN109828905B true CN109828905B (en) 2023-08-22

Family

ID=66858868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811537730.XA Active CN109828905B (en) 2018-12-15 2018-12-15 Automatic test method, device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN109828905B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111193699B (en) * 2019-08-23 2021-12-03 腾讯科技(深圳)有限公司 Method and device for detecting security vulnerability of ZigBee device
CN111078547A (en) * 2019-12-05 2020-04-28 紫光云(南京)数字技术有限公司 Automatic testing framework system for PYTHON general APP software
US11748239B1 (en) 2020-05-06 2023-09-05 Allstate Solutions Private Limited Data driven testing automation using machine learning
CN112100359A (en) * 2020-10-14 2020-12-18 北京嘀嘀无限科技发展有限公司 Test case searching method, device, equipment and storage medium
CN113434395B (en) * 2021-06-22 2024-04-30 中国平安人寿保险股份有限公司 Automatic generation method, device, equipment and medium for test cases
CN113360825A (en) * 2021-07-26 2021-09-07 深圳平安智汇企业信息管理有限公司 WebUI automatic test method and device, electronic equipment and storage medium
CN113918465A (en) * 2021-10-28 2022-01-11 浪潮(山东)计算机科技有限公司 Compatibility testing method and device, electronic equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622294A (en) * 2011-01-28 2012-08-01 国际商业机器公司 Method and method for generating test cases for different test types
CN104298595A (en) * 2014-09-29 2015-01-21 百视通网络电视技术发展有限责任公司 Automatic testing method and testing system
WO2015012814A1 (en) * 2013-07-23 2015-01-29 Landmark Graphics Corporation Automated generation of scripted and manual test cases
CN107861872A (en) * 2017-11-03 2018-03-30 郑州云海信息技术有限公司 A kind of generation method, device, equipment and the storage medium of automatized script template
CN107861876A (en) * 2017-11-16 2018-03-30 平安科技(深圳)有限公司 Method of testing, device, computer equipment and readable storage medium storing program for executing
CN108268377A (en) * 2018-01-23 2018-07-10 郑州云海信息技术有限公司 A kind of service test method of server, device and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180322035A1 (en) * 2017-05-04 2018-11-08 Hcl Technologies Limited Automation testing platform for facilitating automatic testing of an information technology (it) enabled application

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622294A (en) * 2011-01-28 2012-08-01 国际商业机器公司 Method and method for generating test cases for different test types
WO2015012814A1 (en) * 2013-07-23 2015-01-29 Landmark Graphics Corporation Automated generation of scripted and manual test cases
CN104298595A (en) * 2014-09-29 2015-01-21 百视通网络电视技术发展有限责任公司 Automatic testing method and testing system
CN107861872A (en) * 2017-11-03 2018-03-30 郑州云海信息技术有限公司 A kind of generation method, device, equipment and the storage medium of automatized script template
CN107861876A (en) * 2017-11-16 2018-03-30 平安科技(深圳)有限公司 Method of testing, device, computer equipment and readable storage medium storing program for executing
CN108268377A (en) * 2018-01-23 2018-07-10 郑州云海信息技术有限公司 A kind of service test method of server, device and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于STAF/STAX的消息中间件自动化测试系统的研究;陈征;《电子测量》(第15期);60-64 *

Also Published As

Publication number Publication date
CN109828905A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN109828905B (en) Automatic test method, device, computer device and storage medium
CN109828903B (en) Automatic testing method and device, computer device and storage medium
WO2020233034A1 (en) Page function testing method and related device
WO2019161619A1 (en) Automatic interface test method and apparatus, and device and computer-readable storage medium
CN111159049A (en) Automatic interface testing method and system
CN108304329B (en) Test case design method and device, terminal and readable storage medium
CN110188135B (en) File generation method and equipment
CN109766271B (en) Hybrid application automatic testing method and device, electronic equipment and storage medium
CN110990274B (en) Data processing method, device and system for generating test cases
CN109726388A (en) Pdf document analytic method, device, equipment and computer readable storage medium
CN107451112B (en) Form tool data checking method, device, terminal equipment and storage medium
CN110688145B (en) Android MVP code automatic generation method and device, medium and electronic equipment
CN107615270A (en) A kind of man-machine interaction method and its device
CN115794641A (en) Method, device and equipment for making number based on business process and storage medium
CN113741860A (en) Data processing method and device based on RPA robot
CN109783367B (en) Interface testing method, device, computer device and storage medium
CN103913672B (en) A kind of satellite low frequency interface automatization test system
CN109902027B (en) TPC-DS testing method and system convenient to implement
CN114328250A (en) Automatic self-checking method, medium and device for software system
CN112084111A (en) Data processing method, system and device
CN113448867B (en) Software pressure testing method and device
CN107885648B (en) Method and device for generating test report
KR102201845B1 (en) Automation unit test method of multi-task based software and system for the same
CN113535581A (en) Test script generation method, device, equipment and computer readable storage medium
CN111027196A (en) Simulation analysis task processing method and device for power equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant