CN110674030A - Application testing method and device, computer readable storage medium and electronic equipment - Google Patents

Application testing method and device, computer readable storage medium and electronic equipment Download PDF

Info

Publication number
CN110674030A
CN110674030A CN201910797451.5A CN201910797451A CN110674030A CN 110674030 A CN110674030 A CN 110674030A CN 201910797451 A CN201910797451 A CN 201910797451A CN 110674030 A CN110674030 A CN 110674030A
Authority
CN
China
Prior art keywords
application
tested
test
result
case data
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
CN201910797451.5A
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 Dike Technology Co Ltd
Original Assignee
Beijing Dike 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 Dike Technology Co Ltd filed Critical Beijing Dike Technology Co Ltd
Priority to CN201910797451.5A priority Critical patent/CN110674030A/en
Publication of CN110674030A publication Critical patent/CN110674030A/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
    • 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

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 embodiment of the disclosure discloses an application testing method and device, a computer readable storage medium and electronic equipment, wherein the method comprises the following steps: responding to the updated configuration information of the application to be tested, and acquiring test case data corresponding to the application to be tested; starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data; recording the operation result, and determining the test result of the application to be tested according to the operation result; the embodiment realizes automatic testing, improves the application testing efficiency, accelerates the updating speed of the application, and saves the cost of manpower and material resources.

Description

Application testing method and device, computer readable storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of application testing technologies, and in particular, to an application testing method and apparatus, a computer-readable storage medium, and an electronic device.
Background
Along with the rapid development of mobile internet, the use of Application (APP) becomes more frequent, also pays more attention to user experience, so need constantly change the APP product, change each time, all need carry out a large amount of test work, guarantee that each interface can quick accurate reaction. Therefore, a large number of testers are required to be invested in the application test process for testing, so that the test cost is high and the test efficiency is low.
Disclosure of Invention
The present disclosure is proposed to solve the above technical problems. The embodiment of the disclosure provides an application testing method and device, a computer readable storage medium and electronic equipment.
According to an aspect of an embodiment of the present disclosure, there is provided an application testing method including:
responding to the updated configuration information of the application to be tested, and acquiring test case data corresponding to the application to be tested;
starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data;
and recording the operation result, and determining the test result of the application to be tested according to the operation result.
Optionally, the test case data includes at least one operation name and at least one operation element; each operation name corresponds to at least one operation element;
the starting of the application to be tested and the simulation of at least one operation in the application to be tested based on the test case data comprise:
starting the application to be tested, and determining at least one operation name corresponding to the application to be tested;
determining at least one corresponding operation element from the test case data based on the at least one operation name;
and controlling the application to be tested to execute the operation corresponding to the at least one operation name based on the at least one operation element.
Optionally, the determining, from the test case data, the corresponding at least one operation element based on the at least one operation name includes:
searching and determining at least one element number from the test case data based on the at least one operation name; wherein each operation name corresponds to at least one element number;
searching and determining at least one operation element from the test case data based on the element number; wherein each of the operation elements corresponds to an element number.
Optionally, before the starting the application to be tested and simulating at least one operation in the application to be tested based on the test case data, the method further includes:
judging whether a port corresponding to the application to be tested is occupied by other applications;
responding to the port not occupied by other applications, and starting the application to be tested;
and in response to the port being occupied by other applications, closing the other applications occupying the port, and starting the application to be tested.
Optionally, the recording the result of the operation and determining the test result of the application to be tested according to the result of the operation includes:
recording all results corresponding to the at least one operation, and respectively matching each result in all the results with a preset result corresponding to the operation; each operation corresponds to a preset result;
responding to each result in all the results to be respectively matched with the corresponding preset result, and determining that the test is successful;
and determining that the test fails in response to at least one result in all the results not matching with the corresponding preset result.
Optionally, after the responding to the update of the configuration information of the application to be tested and acquiring the test case data corresponding to the application to be tested, the method further includes:
and storing the test case data into a storage space corresponding to the application to be tested in a database.
Optionally, after the result of the response to the operation is matched with the preset result and the test is determined to be successful, the method further includes:
adding one to the test success times, and judging whether the test success times are greater than or equal to the preset times;
responding to the test success times which are more than or equal to the preset times, and ending the test;
and responding to the test success times smaller than the preset times, carrying out next test on the application to be tested, and after the next test is successful, adding one to the test success times until the test success times are larger than or equal to the prediction times.
Optionally, the next testing of the application to be tested includes:
acquiring corresponding test case data from a storage space corresponding to the application to be tested in the database;
starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data;
and recording the operation result, and determining the test result of the application to be tested according to the operation result.
Optionally, after determining that the test fails this time in response to a result of the operation not matching the preset result, the method further includes:
and performing screenshot operation on the operation interface corresponding to the operation result to obtain a screenshot image.
According to another aspect of the embodiments of the present disclosure, there is provided an application testing apparatus including:
the data acquisition module is used for responding to the updated configuration information of the application to be tested and acquiring test case data corresponding to the application to be tested;
the operation simulation module is used for starting the application to be tested and simulating at least one operation in the application to be tested based on the test case data;
and the result determining module is used for recording the operation result and determining the test result of the application to be tested according to the operation result.
Optionally, the test case data includes at least one operation name and at least one operation element; each operation name corresponds to at least one operation element;
the operation simulation module comprises:
the name determining module is used for starting the application to be tested and determining at least one operation name corresponding to the application to be tested;
the element determining module is used for determining at least one corresponding operation element from the test case data based on the at least one operation name;
and the operation execution module is used for controlling the application to be tested to execute the operation corresponding to the at least one operation name based on the at least one operation element.
Optionally, the element determining module is specifically configured to search and determine at least one element number from the test case data based on the at least one operation name; wherein each operation name corresponds to at least one element number; searching and determining at least one operation element from the test case data based on the element number; wherein each of the operation elements corresponds to an element number.
Optionally, the apparatus further comprises:
the port cleaning module is used for judging whether the port corresponding to the application to be tested is occupied by other applications or not; responding to the port not occupied by other applications, and starting the application to be tested; and in response to the port being occupied by other applications, closing the other applications occupying the port, and starting the application to be tested.
Optionally, the result determining module is specifically configured to record all results corresponding to the at least one operation, and match each result of the all results with a preset result corresponding to the operation of the result; each operation corresponds to a preset result; responding to each result in all the results to be respectively matched with the corresponding preset result, and determining that the test is successful; and determining that the test fails in response to at least one result in all the results not matching with the corresponding preset result.
Optionally, the apparatus further comprises:
and the data storage module is used for storing the test case data into a storage space corresponding to the application to be tested in a database.
Optionally, the result determining module is further configured to add one to the number of successful tests after determining that the test is successful in response to the result of the operation matching the preset result, and determine whether the number of successful tests is greater than or equal to the preset number; responding to the test success times which are more than or equal to the preset times, and ending the test; and responding to the test success times smaller than the preset times, carrying out next test on the application to be tested, and after the next test is successful, adding one to the test success times until the test success times are larger than or equal to the prediction times.
Optionally, the result determining module is configured to obtain corresponding test case data from a storage space corresponding to the application to be tested in the database when the application to be tested is tested next time; starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data; and recording the operation result, and determining the test result of the application to be tested according to the operation result.
Optionally, the result determining module is further configured to perform screenshot operation on an operation interface corresponding to the operation result after determining that the test fails in response to that the operation result is not matched with the preset result, and obtain a screenshot image.
According to another aspect of the embodiments of the present disclosure, there is provided an application test system including: a plurality of application testing devices according to any of the above embodiments, each of the application testing devices testing an application to be tested.
According to a further aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the application testing method according to any of the embodiments.
According to still another aspect of the embodiments of the present disclosure, there is provided an electronic apparatus, including:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the application testing method according to any of the above embodiments.
Based on the application testing method and device, the computer-readable storage medium and the electronic device provided by the above embodiments of the present disclosure, in response to the update of configuration information of an application to be tested, test case data corresponding to the application to be tested is obtained; starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data; recording the operation result, and determining the test result of the application to be tested according to the operation result; the embodiment realizes automatic testing, improves the application testing efficiency, accelerates the updating speed of the application, and saves the cost of manpower and material resources.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a schematic flowchart of an application testing method according to an exemplary embodiment of the present disclosure.
Fig. 2 is a schematic flow chart of step 104 in the embodiment shown in fig. 1 of the present disclosure.
Fig. 3 is a schematic flowchart of an application testing method according to another exemplary embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating an application testing method according to still another exemplary embodiment of the present disclosure.
Fig. 5 is a schematic flowchart of an application testing method according to still another exemplary embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of an application testing apparatus according to an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure.
Detailed Description
Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of the embodiments of the present disclosure and not all embodiments of the present disclosure, with the understanding that the present disclosure is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing an associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Summary of the application
In the course of implementing the present disclosure, the inventor finds that the test of the prior art for application update is implemented manually, but the solution has at least the following problems: a large amount of manpower and material resources are consumed, the testing efficiency is low, and the updating efficiency of the application is influenced.
Exemplary method
Fig. 1 is a schematic flowchart of an application testing method according to an exemplary embodiment of the present disclosure. The embodiment can be applied to an electronic device, as shown in fig. 1, and includes the following steps:
and 102, responding to the updated configuration information of the application to be tested, and acquiring test case data corresponding to the application to be tested.
Optionally, when the configuration information of the application to be tested is updated, which indicates that the application to be tested is updated, at this time, the application needs to be tested, and usually, when the application is updated, a developer may provide a corresponding test case.
And 104, starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data.
Optionally, the testing of the application is usually implemented by simulating application execution, and the embodiment implements the testing of the application to be tested by starting the application to be tested and simulating at least one operation of the application to be tested.
And 106, recording the operation result, and determining the test result of the application to be tested according to the operation result.
After at least one operation is performed on the application, at least one corresponding operation result may be obtained, and the test result of the current test may be determined according to the operation results, where optionally, the test result may include: if the test is successful or fails, for example, if one of the operation results is wrong, the test failure can be determined; or only one operation is realized in each test, the success of the operation is determined to be the success of the test, and the failure of the operation is determined to be the failure of the test.
In the application testing method provided by the embodiment of the present disclosure, in response to the update configuration information of the application to be tested, test case data corresponding to the application to be tested is obtained; starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data; recording the operation result, and determining the test result of the application to be tested according to the operation result; the embodiment realizes automatic testing, improves the application testing efficiency, accelerates the updating speed of the application, and saves the cost of manpower and material resources.
As shown in fig. 2, based on the embodiment shown in fig. 1, step 104 may include the following steps:
step 1041, starting the application to be tested, and determining at least one operation name corresponding to the application to be tested.
The test case data comprises at least one operation name and at least one operation element; wherein each operation name corresponds to at least one operation element.
Optionally, the test case data may be data information stored in a form of a table, each operation name in the table corresponds to at least one operation element, and in this embodiment, the operation name corresponding to at least one operation that the application to be tested needs to test may be obtained in the test case data corresponding to the application to be tested.
And 1042, determining at least one corresponding operation element from the test case data based on the at least one operation name.
Optionally, based on the corresponding relationship between the operation name and the operation element in the test case data, the corresponding operation element is searched for by the operation name.
And 1043, controlling the application to be tested to execute an operation corresponding to the at least one operation name based on the at least one operation element.
Optionally, the operation element may be information such as a position coordinate of a corresponding operation, and operations such as clicking, sliding, inputting, multi-point touch may be realized through simulation of at least one operation element, so as to realize simulation of the application to be tested, and a test of at least one operation in the application to be tested is realized through judgment of an operation result in a simulation process, for example, each operation in the application to be tested is simulated and executed, so as to realize a test of all operations of the application to be tested.
Optionally, step 1042 includes:
searching and determining at least one element number from the test case data based on at least one operation name; wherein each operation name corresponds to at least one element number;
searching and determining at least one operation element from the test case data based on the element number; wherein each operation element corresponds to an element number.
In this embodiment, the test case data includes an element number (e.g., an element ID) in addition to the operation name and the operation element, a corresponding relationship is established between the operation name and the operation element through the element number, when the operation element needs to be searched, the corresponding at least one element number can be directly determined through the operation name, a storage space is saved in the form of the number, the search efficiency is improved, and the corresponding operation element is obtained through the corresponding relationship between the element number and the operation element, so that the utilization rate of the operation element can be improved, for example, operation a corresponds to operation elements a, B, and c, and operation B corresponds to operation elements a, c, and e, at this time, if the corresponding relationship between the operation name and the operation element is directly stored, a large amount of repeated data occupies more storage space, and when the element number is used for correspondence, the operation element does not need to be stored in a table corresponding to the operation name, the element numbers are used for corresponding, and then the operation elements corresponding to the element numbers are searched from the stored operation elements, so that the searching efficiency is improved.
Fig. 3 is a schematic flowchart of an application testing method according to another exemplary embodiment of the present disclosure. As shown in fig. 3, the method comprises the following steps:
and 102, responding to the updated configuration information of the application to be tested, and acquiring test case data corresponding to the application to be tested.
Step 303, judging whether a port corresponding to the application to be tested is occupied by other applications; if yes, after closing other applications occupying the port, executing step 104; otherwise, step 104 is performed.
And 104, starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data.
And 106, recording the operation result, and determining the test result of the application to be tested according to the operation result.
In this embodiment, different applications may correspond to the same port, and before the application is started, it is necessary to determine whether the port corresponding to the application is occupied, and if the port is occupied, it is necessary to release the port (close other applications occupying the port), so before the application to be tested is started, it is determined whether the port corresponding to the application to be tested is occupied by other applications, and if the port is occupied, the application to be tested is started after other applications occupying the port are closed; if the test application is not occupied, the test application can be directly started; through the judgment process, the starting success rate of the application to be tested is improved, and the repeated starting of the application is avoided.
For example, an application to be tested is tested by an automatic test tool (appium, which may be in a virtual machine or a client), and metstat-aon | findstr is executed by os.pop to check whether a port corresponding to the application to be tested is occupied; then closing the pid process of the occupied port through taskill-f-pid; then starting the appium through 'start/b appium-session-override-a' + host + '-p' + port + '-bp' + str (port + 1); and detecting whether the appium is started or not through netstat.
Fig. 4 is a flowchart illustrating an application testing method according to still another exemplary embodiment of the present disclosure. As shown in fig. 4, the method comprises the following steps:
and 102, responding to the updated configuration information of the application to be tested, and acquiring test case data corresponding to the application to be tested.
And 104, starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data.
Step 406, recording all results corresponding to at least one operation, and matching each result in all the results with a preset result corresponding to the operation; when each result in all the results is matched with the corresponding preset result, executing step 408; otherwise, step 410 is performed.
Each operation corresponds to a preset result (for example, an operation interface or result data).
And step 408, determining that the test is successful.
Step 410, determining that the test fails.
Optionally, each operation corresponds to one result and one preset result, this embodiment is implemented by matching the result corresponding to each operation with the preset result, and when the results of all the operations are matched with the preset results corresponding to the operations, it is indicated that each simulation operation is correctly executed, at this time, it is determined that the test of the application to be tested is successful, and when any one or more operation results in the multiple operations cannot be matched with the preset results, it is indicated that the operation has a problem, that is, the test fails.
Fig. 5 is a schematic flowchart of an application testing method according to still another exemplary embodiment of the present disclosure. As shown in fig. 5, the method comprises the following steps:
and 102, responding to the updated configuration information of the application to be tested, and acquiring test case data corresponding to the application to be tested.
Step 503, storing the test case data into a storage space corresponding to the application to be tested in the database.
In the embodiment, the test case data is stored in the database to obtain the persistent storage test case, so that when the application to be tested needs to be tested for multiple times, the test case data does not need to be read repeatedly, the two hands of a tester are liberated, and the tester only needs to formulate the test case to carry out automatic testing.
And 104, starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data.
Step 406, recording all results corresponding to at least one operation, and matching each result in all the results with a preset result corresponding to the operation; when each result in all the results is matched with the corresponding preset result, executing step 408; otherwise, step 410 is performed.
Each operation corresponds to a preset result (for example, an operation interface or result data).
And step 408, determining that the test is successful, and adding one to the test success times.
509, judging whether the test success times are greater than or equal to preset times; if yes, ending the test; otherwise, acquiring corresponding test case data from a storage space corresponding to the application to be tested in the database; step 104 is performed.
And step 410, determining that the test fails, and ending the test.
In this embodiment, the test on the application generally needs to be repeated for multiple times to ensure the accuracy, for example, the preset number is set to 20 times, and the test is ended when the test success number reaches 20 times, and the test is ended when any test failure occurs before the test success number does not reach the preset number, so that it is meaningless to continue the test as long as one test failure occurs, which indicates that the application has a problem.
Optionally, after the test is finished, a test report may also be generated and saved.
Optionally, after determining that the test fails, the method may further include:
and performing screenshot operation on an operation interface corresponding to the operation result to obtain a screenshot image.
In order to quickly find out the tested abnormal problem so as to adjust the application to be tested subsequently, the embodiment supports screenshot on the abnormal problem interface, and stores the screenshot, and may also send the stored screenshot to a set mail address (e.g., a mailbox of a developer).
In some optional embodiments, before obtaining test case data corresponding to an application to be tested, environment construction and setting of a test client (for example, a mobile phone) may also be performed: for example, the program needs to build the following environment:
·Node.js==6.11.3
·Appium==1.7.2
·Appium-desktop
·Appium-doctor
·Appium-Python-Client
·Python3
·JDK==1.8.0_05
·Andriod SDK
for another example, when the client is a mobile phone, the mobile phone is configured to be in a developer mode, and the USB debugging is started; downloading an automatic testing tool and installing the automatic testing tool on an android virtual machine; and adding APP information, mobile phone information and appium information in the program configuration file.
Any of the application testing methods provided by the embodiments of the present disclosure may be performed by any suitable device having data processing capabilities, including but not limited to: terminal equipment, a server and the like. Alternatively, any of the application test methods provided by the embodiments of the present disclosure may be executed by a processor, for example, the processor may execute any of the application test methods mentioned by the embodiments of the present disclosure by calling a corresponding instruction stored in a memory. And will not be described in detail below.
Exemplary devices
Fig. 6 is a schematic structural diagram of an application testing apparatus according to an exemplary embodiment of the present disclosure. As shown in fig. 6, the present embodiment includes:
and the data acquisition module 61 is configured to respond to the update configuration information of the application to be tested, and acquire test case data corresponding to the application to be tested.
And the operation simulation module 62 is configured to start the application to be tested, and simulate at least one operation in the application to be tested based on the test case data.
And the result determining module 63 is used for recording the result of the operation and determining the test result of the application to be tested according to the result of the operation.
The application testing device provided by the embodiment of the present disclosure responds to the update configuration information of the application to be tested, and obtains the test case data corresponding to the application to be tested; starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data; recording the operation result, and determining the test result of the application to be tested according to the operation result; the embodiment realizes automatic testing, improves the application testing efficiency, accelerates the updating speed of the application, and saves the cost of manpower and material resources.
Optionally, the operation simulation module 62 comprises:
the name determining module is used for starting the application to be tested and determining at least one operation name corresponding to the application to be tested;
the element determining module is used for determining at least one corresponding operation element from the test case data based on at least one operation name;
and the operation execution module is used for controlling the application to be tested to execute the operation corresponding to the at least one operation name based on the at least one operation element.
The test case data comprises at least one operation name and at least one operation element; wherein each operation name corresponds to at least one operation element.
Optionally, the element determining module is specifically configured to search and determine at least one element number from the test case data based on the at least one operation name; wherein each operation name corresponds to at least one element number; searching and determining at least one operation element from the test case data based on the element number; wherein each operation element corresponds to an element number.
In some optional embodiments, the apparatus provided in this embodiment further includes:
the port cleaning module is used for judging whether a port corresponding to the application to be tested is occupied by other applications or not; responding to the fact that the port is not occupied by other applications, and starting the application to be tested; and in response to the port being occupied by other applications, closing the other applications occupying the port and starting the application to be tested.
In this embodiment, different applications may correspond to the same port, and before the application is started, it is necessary to determine whether the port corresponding to the application is occupied, and if the port is occupied, it is necessary to release the port (close other applications occupying the port), so before the application to be tested is started, it is determined whether the port corresponding to the application to be tested is occupied by other applications, and if the port is occupied, the application to be tested is started after other applications occupying the port are closed; if the test application is not occupied, the test application can be directly started; through the judgment process, the starting success rate of the application to be tested is improved, and the repeated starting of the application is avoided.
In some optional embodiments, the result determining module 63 is specifically configured to record all results corresponding to at least one operation, and match each result of all the results with a preset result corresponding to the operation of the result; each operation corresponds to a preset result; responding to each result in all the results to be respectively matched with the corresponding preset result, and determining that the test is successful; and determining that the test fails in response to at least one result in all the results not matching with the corresponding preset result.
Optionally, the apparatus provided in this embodiment further includes:
and the data storage module is used for storing the test case data into a storage space corresponding to the application to be tested in the database.
Optionally, the result determining module 63 is further configured to add one to the number of successful tests after determining that the test is successful in response to the matching of the result of the operation and the preset result, and determine whether the number of successful tests is greater than or equal to the preset number; responding to the test success times which are more than or equal to the preset times, and ending the test; and responding to the test success times smaller than the preset times, carrying out next test on the application to be tested, and after the next test is successful, adding one to the test success times until the test success times are larger than or equal to the prediction times.
Optionally, the result determining module 63 is configured to, when performing the next test on the application to be tested, obtain corresponding test case data from a storage space corresponding to the application to be tested in the database; starting an application to be tested, and simulating at least one operation in the application to be tested based on test case data; and recording the operation result, and determining the test result of the application to be tested according to the operation result.
Optionally, the result determining module is further configured to perform screenshot operation on the operation interface corresponding to the operation result after determining that the test fails in response to a result of the operation not matching the preset result, and obtain a screenshot image.
According to another aspect of the embodiments of the present disclosure, there is provided an application testing system including: in a plurality of application testing devices provided in any of the above embodiments, each application testing device tests an application to be tested.
The system provided by the embodiment can simultaneously test a plurality of applications through a plurality of application testing devices, realizes multi-process testing and improves the testing efficiency of the applications.
Exemplary electronic device
Next, an electronic apparatus according to an embodiment of the present disclosure is described with reference to fig. 7. The electronic device may be either or both of the first device 100 and the second device 200, or a stand-alone device separate from them that may communicate with the first device and the second device to receive the collected input signals therefrom.
FIG. 7 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure.
As shown in fig. 7, the electronic device 70 includes one or more processors 71 and a memory 72.
The processor 71 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 70 to perform desired functions.
Memory 72 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 71 to implement the application testing methods of the various embodiments of the present disclosure described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 70 may further include: an input device 73 and an output device 74, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
For example, when the electronic device is the first device 100 or the second device 200, the input device 73 may be a microphone or a microphone array as described above for capturing an input signal of a sound source. When the electronic device is a stand-alone device, the input means 73 may be a communication network connector for receiving the acquired input signals from the first device 100 and the second device 200.
The input device 73 may also include, for example, a keyboard, a mouse, and the like.
The output device 74 may output various information including the determined distance information, direction information, and the like to the outside. The output devices 74 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device 70 relevant to the present disclosure are shown in fig. 7, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device 70 may include any other suitable components, depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the application testing method according to various embodiments of the present disclosure described in the "exemplary methods" section above of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the application testing method according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (13)

1. An application testing method, comprising:
responding to the updated configuration information of the application to be tested, and acquiring test case data corresponding to the application to be tested;
starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data;
and recording the operation result, and determining the test result of the application to be tested according to the operation result.
2. The method of claim 1, wherein the test case data comprises at least one operation name and at least one operation element; each operation name corresponds to at least one operation element;
the starting of the application to be tested and the simulation of at least one operation in the application to be tested based on the test case data comprise:
starting the application to be tested, and determining at least one operation name corresponding to the application to be tested;
determining at least one corresponding operation element from the test case data based on the at least one operation name;
and controlling the application to be tested to execute the operation corresponding to the at least one operation name based on the at least one operation element.
3. The method of claim 2, wherein the determining the corresponding at least one operation element from the test case data based on the at least one operation name comprises:
searching and determining at least one element number from the test case data based on the at least one operation name; wherein each operation name corresponds to at least one element number;
searching and determining at least one operation element from the test case data based on the element number; wherein each of the operation elements corresponds to an element number.
4. The method according to any one of claims 1-3, wherein before the launching the application under test and simulating at least one operation in the application under test based on the test case data, further comprising:
judging whether a port corresponding to the application to be tested is occupied by other applications;
responding to the port not occupied by other applications, and starting the application to be tested;
and in response to the port being occupied by other applications, closing the other applications occupying the port, and starting the application to be tested.
5. The method of any of claims 1-4, wherein said recording the result of said operation and determining the test result of said application to be tested based on the result of said operation comprises:
recording all results corresponding to the at least one operation, and respectively matching each result in all the results with a preset result corresponding to the operation; each operation corresponds to a preset result;
responding to each result in all the results to be respectively matched with the corresponding preset result, and determining that the test is successful;
and determining that the test fails in response to at least one result in all the results not matching with the corresponding preset result.
6. The method of claim 5, wherein after the step of responding to the updated configuration information of the application to be tested and obtaining the test case data corresponding to the application to be tested, the method further comprises:
and storing the test case data into a storage space corresponding to the application to be tested in a database.
7. The method of claim 6, wherein after determining that the test is successful in response to the result of the operation matching the preset result, the method further comprises:
adding one to the test success times, and judging whether the test success times are greater than or equal to the preset times;
responding to the test success times which are more than or equal to the preset times, and ending the test;
and responding to the test success times smaller than the preset times, carrying out next test on the application to be tested, and after the next test is successful, adding one to the test success times until the test success times are larger than or equal to the prediction times.
8. The method of claim 7, wherein said testing the application under test for the next time comprises:
acquiring corresponding test case data from a storage space corresponding to the application to be tested in the database;
starting the application to be tested, and simulating at least one operation in the application to be tested based on the test case data;
and recording the operation result, and determining the test result of the application to be tested according to the operation result.
9. The method according to claims 5-8, wherein after determining that the test fails in response to a mismatch between the result of the operation and the preset result, the method further comprises:
and performing screenshot operation on the operation interface corresponding to the operation result to obtain a screenshot image.
10. An application testing apparatus, comprising:
the data acquisition module is used for responding to the updated configuration information of the application to be tested and acquiring test case data corresponding to the application to be tested;
the operation simulation module is used for starting the application to be tested and simulating at least one operation in the application to be tested based on the test case data;
and the result determining module is used for recording the operation result and determining the test result of the application to be tested according to the operation result.
11. An application testing system, comprising: a plurality of application testing devices according to claim 10, each of said application testing devices testing a respective application to be tested.
12. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the application testing method of any of the preceding claims 1-9.
13. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the application testing method of any one of claims 1 to 9.
CN201910797451.5A 2019-08-27 2019-08-27 Application testing method and device, computer readable storage medium and electronic equipment Pending CN110674030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910797451.5A CN110674030A (en) 2019-08-27 2019-08-27 Application testing method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910797451.5A CN110674030A (en) 2019-08-27 2019-08-27 Application testing method and device, computer readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110674030A true CN110674030A (en) 2020-01-10

Family

ID=69076383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910797451.5A Pending CN110674030A (en) 2019-08-27 2019-08-27 Application testing method and device, computer readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110674030A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744056A (en) * 2004-09-04 2006-03-08 华为技术有限公司 Automatic test method of application
CN107015906A (en) * 2016-06-23 2017-08-04 阿里巴巴集团控股有限公司 Method of testing and device, port generation method and port maker and test system
CN108959068A (en) * 2018-06-04 2018-12-07 广州视源电子科技股份有限公司 Software interface test method, equipment and storage medium
US10303590B2 (en) * 2013-03-15 2019-05-28 International Business Machines Corporation Testing functional correctness and idempotence of software automation scripts
CN109933520A (en) * 2019-01-22 2019-06-25 平安科技(深圳)有限公司 Software development test method, device, computer installation and storage medium
CN110032597A (en) * 2018-11-30 2019-07-19 阿里巴巴集团控股有限公司 The visible processing method and device of application program operation behavior

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744056A (en) * 2004-09-04 2006-03-08 华为技术有限公司 Automatic test method of application
US10303590B2 (en) * 2013-03-15 2019-05-28 International Business Machines Corporation Testing functional correctness and idempotence of software automation scripts
CN107015906A (en) * 2016-06-23 2017-08-04 阿里巴巴集团控股有限公司 Method of testing and device, port generation method and port maker and test system
CN108959068A (en) * 2018-06-04 2018-12-07 广州视源电子科技股份有限公司 Software interface test method, equipment and storage medium
CN110032597A (en) * 2018-11-30 2019-07-19 阿里巴巴集团控股有限公司 The visible processing method and device of application program operation behavior
CN109933520A (en) * 2019-01-22 2019-06-25 平安科技(深圳)有限公司 Software development test method, device, computer installation and storage medium

Similar Documents

Publication Publication Date Title
US10534701B1 (en) API driven continuous testing systems for testing disparate software
US20140331209A1 (en) Program Testing Service
KR20210040884A (en) Edge computing test methods, devices, electronic devices and computer-readable media
CN110764945A (en) Crash log processing method, device, equipment and storage medium
US8291388B2 (en) System, method and program for executing a debugger
WO2018108041A1 (en) Remote debugging method and device, and computer storage medium
CN110955409B (en) Method and device for creating resources on cloud platform
CN110532185B (en) Test method, test device, electronic equipment and computer readable storage medium
CN108920359B (en) Application program testing method and device, storage medium and electronic device
CN109815119B (en) APP link channel testing method and device
CN111654495B (en) Method, apparatus, device and storage medium for determining traffic generation source
CN111666217A (en) Method and apparatus for testing code
CA2811617C (en) Commit sensitive tests
EP2992419A1 (en) Program testing service
US20140331205A1 (en) Program Testing Service
CN111190791A (en) Application exception reporting method and device and electronic equipment
CN114579452A (en) Interface influence detection method and related equipment
CN110704025A (en) Method and device for generating coding specification tool, storage medium and electronic equipment
CN110750446A (en) System testing method and related device
CN112395182A (en) Automatic testing method, device, equipment and computer readable storage medium
CN103176903B (en) The test method and equipment of MapReduce distributed system program
CN112988578A (en) Automatic testing method and device
CN110609786A (en) Software testing method and device, computer equipment and storage medium
CN110674030A (en) Application testing method and device, computer readable storage medium and electronic equipment
CN112395194B (en) Method and device for accessing test platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200110

RJ01 Rejection of invention patent application after publication