Method and device for testing application program

By transforming the Appium tool, the differences between the test objects and the most recent execution objects are compared in real time, and the update of the test queue is determined based on the differences, which solves the problem that the Appium tool cannot detect test cases and data changes in real time and does not support breakpoint execution. Improves testing efficiency.

CN112988553BActive Publication Date: 2025-02-18MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911273011.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-12
Publication Date
2025-02-18
Estimated Expiration
2039-12-12

AI Technical Summary

Technical Problem

Customized Appium tools cannot automatically detect test cases and data changes in real time, and do not support breakpoint execution, resulting in inefficiency.

Method used

By comparing the object to be tested with the most recent execution object during the test, determine whether it is included in the test queue and perform tests from the preset position if necessary or skip specific operations. At the same time, data changes in the configuration file are monitored in real time and the test queue is updated as data changes.

Benefits of technology

It realizes that the test client is not required to close the test client when the test case or data changes, and can continue testing from the location where the abnormal stops, saving testing time and improving work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988553B_ABST
    Figure CN112988553B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for testing an application program, the method comprising: during the test process, comparing the object to be tested with the object executed the most recently; determining whether to include the object to be tested in the test queue according to the comparison result; if the object to be tested is included in the test queue, executing the test from a preset position; if the object to be tested is not included in the test queue, skipping the object to be tested and executing a predefined operation. In this way, when the data in the configuration file is changed, it is not necessary to close the test client and re-test; it is also possible that when the test client stops abnormally, the test client can continue to execute the test from the execution position where the abnormal stop occurred when it is restarted, without having to restart the test, thus saving test time and improving the work efficiency of the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of application testing, and in particular to a method and device for testing an application. Background Art

[0002] With the rapid development of the Internet, the software industry has also boarded the high-speed train, and the mobile Internet has spawned a large number of mobile applications. The massive number of mobile applications has promoted the widespread application of traditional architecture Web applications and microservice architecture, and their business has become more and more complex. Complex business logic has put forward higher requirements for the availability of applications. How to ensure the stable and efficient operation of applications, application testing is particularly important. More and more people are switching from the company's IT department and non-IT department to do testing, which shows that testing has become a very popular career development direction, but it also brings new problems. The level of testers is uneven, the level of test management does not match the level of company business growth, and a large number of testers still use traditional testing methods. There is a lot of repetitive work, the test quality cannot be guaranteed, the test time cannot be guaranteed, the test efficiency is extremely low, and the test quality is difficult to guarantee, which leads to extremely unstable applications and causes great losses to the company. Appium, a customized automated testing framework for such situations, can solve the above problems.

[0003] Customized automated testing framework Appium is an open source test automation framework that can be used for native, hybrid and mobile web application testing. It uses the WebDriver protocol to drive iOS, Android and Windows applications. However, the customized Appium tool cannot automatically detect whether the test cases and data have changed in real time, and does not support breakpoint execution, which is not conducive to improving work efficiency. Summary of the invention

[0004] An object of an embodiment of the present invention is to provide a method and apparatus for testing an application program, so as to solve the problem that a customized testing tool cannot automatically detect in real time whether a test case and data have been changed and does not support breakpoint execution.

[0005] In a first aspect, an embodiment of the present invention provides a method for testing an application program, comprising:

[0006] During the test, the object to be tested is compared with the object that was most recently executed;

[0007] Determine whether to include the subject to be tested into a test queue according to the comparison result;

[0008] If the object to be tested is included in the test queue, the test is performed from a preset position;

[0009] If the object to be tested is not included in the test queue, the object to be tested is skipped to perform a predefined operation.

[0010] Optionally, comparing the object to be tested with the most recently executed object includes:

[0011] During the test, the object to be tested executed at the current time is compared with the object executed at the first time, the first time being the time before the current time;

[0012] The step of determining whether to include the subject to be tested into a test queue according to the comparison result includes:

[0013] If the object to be tested at the current time and the object to be executed at the first time have the same data, and the time difference between the current time and the first time is less than a preset value, the object to be tested is not included in the test queue;

[0014] If the same data exists in the object to be tested at the current time and the object executed at the first time, and the time difference between the current time and the first time is greater than a preset value, or if the same data does not exist in the object to be tested at the current time and the object executed at the first time, the object to be tested is included in the test queue.

[0015] Optionally, the method further comprises:

[0016] During the test process, check whether the receiving address of the test report has been modified;

[0017] If the receiving address of the test report is modified, updating the sending address list of the test report;

[0018] If the receiving address of the test report is not modified, the sending address list of the test report is not updated.

[0019] Optionally, during the test process, detecting whether a receiving address of the test report is modified includes:

[0020] Before sending the test report email, start the file detection function;

[0021] The most recent mail sending record is obtained through the file detection function, and the receiving address of the test report is compared with the most recent mail sending record.

[0022] According to the second aspect, an embodiment of the present invention further provides a device for testing an application program, comprising:

[0023] The comparison module is used to compare the object to be tested with the object last executed during the test process;

[0024] The determination module is used to determine whether to include the object to be tested into the test queue according to the comparison result; if the object to be tested is included in the test queue, the test is performed from a preset position; if the object to be tested is not included in the test queue, the object to be tested is skipped to perform a predefined operation.

[0025] Optionally, the comparison module is further used to: during the test process, compare the object to be tested executed at the current time with the object executed at a first time, where the first time is a time before the current time;

[0026] The determination module is further configured to: if the object to be tested at the current time and the object to be executed at the first time have the same data, and the time difference between the current time and the first time is less than a preset value, then not include the object to be tested in the test queue;

[0027] If the same data exists in the object to be tested at the current time and the object executed at the first time, and the time difference between the current time and the first time is greater than a preset value, or if the same data does not exist in the object to be tested at the current time and the object executed at the first time, the object to be tested is included in the test queue.

[0028] Optionally, the device also includes: a detection module, used to detect whether the receiving address of the test report is modified during the test process; if the receiving address of the test report is modified, updating the sending address list of the test report; if the receiving address of the test report is not modified, not updating the sending address list of the test report.

[0029] Optionally, the detection module is further used to: start a file detection function before sending an email of a test report; obtain the most recent email sending record through the file detection function, and compare the receiving address of the test report with the most recent email sending record.

[0030] According to the third aspect, an embodiment of the present invention also provides a device for testing an application, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method for testing an application as described in the first aspect.

[0031] According to a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for testing an application as described in the first aspect are implemented.

[0032] In the embodiment of the present invention, the data in the configuration file of the application is monitored in real time to determine whether the data has been changed, thereby determining whether the data is included in the test queue. This allows the test client to be closed and retested when the data in the configuration file is changed; it also allows the test program to continue to execute the test from the execution position where the test program stopped abnormally when it is restarted, without having to restart the test, thus saving test time and improving test work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0034] Figure 1 A flowchart of a method for testing an application program in an embodiment of the present invention;

[0035] Figure 2 This is one of the schematic diagrams of testing an Android application in an embodiment of the present invention;

[0036] Figure 3 This is a second schematic diagram of testing an Android application in an embodiment of the present invention;

[0037] Figure 4 This is one of the schematic diagrams of testing an iOS application in an embodiment of the present invention;

[0038] Figure 5 This is a second schematic diagram of testing an iOS application program in an embodiment of the present invention;

[0039] Figure 6 This is one of the schematic diagrams of testing a Web application in an embodiment of the present invention;

[0040] Figure 7 This is a second schematic diagram of testing a Web application in an embodiment of the present invention;

[0041] Figure 8 One of the structural block diagrams of the device for testing an application program in an embodiment of the present invention;

[0042] Fig. 9 This is the second structural block diagram of the device for testing an application program in an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to facilitate understanding of the embodiments of the present invention, the following technical terms are first introduced.

[0044] (1) Appium: An open-source automated testing framework that can perform automated testing in native applications, hybrid applications, and mobile web applications.

[0045] (2) Android: It is a free and open source operating system based on Linux developed by Google.

[0046] (3)iOS: is a mobile operating system developed by Apple.

[0047] (4) Web (World Wide Web): The World Wide Web, also known as the World Wide Web, is a global, dynamically interactive, cross-platform distributed graphic information system based on hypertext and HyperText Transfer Protocol (HTTP).

[0048] (5) JDK: It is a software development kit for the Java language, mainly used for Java applications on mobile devices and embedded devices. JDK is the core of the entire Java development, which includes the JAVA operating environment (JVM + Java system class library) and JAVA tools.

[0049] (6) Postman: an open source interface debugging tool.

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] The term "comprise" and any variation thereof in the specification and claims of the present application are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. In addition, the use of "and / or" in the specification and claims to indicate at least one of the connected objects, such as A and / or B, means that A alone, B alone, and A and B exist in three cases.

[0052] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0053] See also Figure 1 , an embodiment of the present invention provides a method for testing an application, the method comprising: steps 101 to 104.

[0054] Step 101: During the test process, the object to be tested is compared with the object executed last time;

[0055] In the embodiment of the present invention, the application program may be tested through Appium, and of course may also be tested through other automated testing frameworks.

[0056] In an embodiment of the present invention, the object to be tested may include test cases and / or data, and the test cases and / or data are stored in a file (excel, txt), and the tester can directly modify the file to adjust the test cases and / or data. Similar test cases and / or data can also be stored in a relational database (such as mysql, etc.), or in a non-relational database (such as redis). Exemplarily, the object to be tested can be configuration data in a configuration file of an application. Among them, the application can be an Android application, an iOS application, a Web application, and of course it is not limited to this.

[0057] In an embodiment of the present invention, the object to be tested may include: modified test cases and / or data, or test cases and / or data of the execution point where an abnormal stop occurs. The most recently executed object refers to the most recent test record of the application program, and the test record may include: the test cases and / or data of the application program, and the email sending record may include: a list of email sending addresses; wherein the most recent test may be the last test of the relevant object to be tested in this test. By comparing the object to be tested with the most recently executed object, it is possible to detect in real time whether the data has been modified.

[0058] For example, based on the test time, determine which test is the most recent test of the current test. For example, the current test time is 12:00, and the tester tested the application at 9:00 and 11:00 respectively. Then the application test performed at 11:00 can be regarded as the most recent test, and the test record of the application at 11:00 can be regarded as the most recent execution object.

[0059] Exemplarily, during the test process, the test cases and / or data in the configuration file of the application are monitored in real time to check whether the modified test cases and data are consistent with the test cases and / or data executed the last time. For example, check whether the receiving address of the modified test report is consistent with the most recent email sending record.

[0060] In the embodiment of the present invention, the next to the last completed test record is the most recent one. If there is no next to the last completed test record, this is the most recent one.

[0061] Exemplarily, during the test process, whether an abnormal stop occurs is monitored in real time. If an abnormal stop is detected, it is checked whether the test case and / or data at the execution point where the abnormal stop occurs is consistent with the most recently executed test case and / or data.

[0062] Step 102: Determine whether to include the subject to be tested into a test queue according to the comparison result;

[0063] In an embodiment of the present invention, the test queue includes test cases and / or data that need to be tested. If the test case and / or data is included in the test queue, it means that the test case and / or data needs to be tested. If the test case and / or data is not included in the test queue, the test case and / or data may not be tested and subsequent tests can be continued.

[0064] Step 103: If the object to be tested is included in the test queue, the test is executed from a preset position;

[0065] In the embodiment of the present invention, the preset position may be the starting position of the configuration file of the application program, or may be the inspection position where the object to be tested is located.

[0066] Step 104: If the object to be tested is not included in the test queue, skip the object to be tested and perform a predefined operation.

[0067] In this embodiment, skipping the predefined operation in the predefined operation performed by the object to be tested may refer to executing the test from the next test object of the object to be tested, or stopping the test, or jumping to other test objects for testing, or executing the test according to other predefined operation strategies, etc., which is not limited here.

[0068] In the embodiment of the present invention, the test cases and / or data in the configuration file of the application are monitored in real time to determine whether the test cases and / or data are changed, thereby determining whether the test cases and / or data are included in the test queue. In this way, when the test cases and / or data in the configuration file are changed, there is no need to close the test client and re-test; when the test program stops abnormally, the test program can continue to execute the test from the execution position where the abnormal stop occurs when it is restarted, without having to restart the test execution, thereby saving test time and improving test work efficiency.

[0069] In some implementations, in step 101, during the test process, the object to be tested executed at the current time is compared with the object executed at the first time, where the first time is the time before the current time.

[0070] The first time may be the time when the test record was completed most recently.

[0071] For example, based on the test time, determine which test is the first test. For example, the current test time is 12:00, and the tester previously tested the application at 9:00 and 11:00, then the application test performed at 11:00 can be regarded as the first test.

[0072] In some implementations, in step 102, if the object to be tested at the current time and the object executed at the first time have the same data, and the time difference between the current time and the first time is less than a preset value, the object to be tested is not included in the test queue;

[0073] If the same data exists in the object to be tested at the current time and the object executed at the first time, and the time difference between the current time and the first time is greater than a preset value, or if the same data does not exist in the object to be tested at the current time and the object executed at the first time, the object to be tested is included in the test queue.

[0074] In some implementations, in step 101, during the test process, the state bit of the configured state management is used to determine whether the object to be tested has been modified compared to the object last executed. For example, the state bit of the state management is used to identify whether the test case and / or data has been modified, for example, the state bit of the state management is 1 bit, and the state bit of the state management is "1" indicating that it has been modified, and the state bit of the state management is "0" indicating that it has not been modified.

[0075] In some embodiments, Figure 1The method shown may also include: during the test process, detecting whether the receiving address of the test report is modified; if the receiving address of the test report is modified, updating the sending address list of the test report; if the receiving address of the test report is not modified, not updating the sending address list of the test report. The mail sending (mailSend) module sends mails in sequence, thereby completing the entire process and improving work efficiency.

[0076] For example, before sending an email, the mailSend module starts the file check (checkFile) function. The checkFile function obtains the most recent email sending record and compares the current email sending record with the most recent email sending record. If there is a change, the email sending record is updated. The update completion is notified to the mailSend module, and the mailSend module starts sending a test report.

[0077] For example, based on the test time, determine which email sending record is the most recent email sending record. For example, if the current test time is 12:00, and test reports were previously sent by email at 9:00 and 11:00, then the email sending record at 11:00 can be used as the most recent email sending record.

[0078] In the embodiment of the present invention, by comparing the configured email with the most recently executed object, it is checked whether the email recipient has been modified during the test process. If modified, the sending address list is updated. If not, the sending address list does not need to be updated. The email sending module sends emails in sequence, thereby completing the entire process and improving work efficiency.

[0079] Existing customized Appium tools cannot automatically detect test cases and / or data status in real time, do not support breakpoint execution, and do not support configurable test reports, which is not conducive to improving work efficiency. However, the embodiments of the present invention can realize real-time automatic detection of test cases and / or data status and respond accordingly to the status by modifying the configuration file, adding status information, adding real-time monitoring components, adding email configuration and sending components based on customized Appium; further, record breakpoint positions and automatically execute breakpoints; further, configurable email sending components, which greatly improves work efficiency and saves time costs.

[0080] The following describes an embodiment of the present invention in combination with scenario 1, scenario 2, and scenario 3.

[0081] Scenario 1: Testing an Android application using Appium.

[0082] After filling in the configuration file, start the Appium Python Client and start the test. During the test, it is found that some test cases and data (equivalent to the objects to be tested) need to be adjusted. For example, modify the main configuration file, specify the corresponding data, and modify the email configuration file, specify the corresponding recipient (including the address for receiving the test report).

[0083] See also Figure 2 , start Appium Client Python to load the configuration file, initialize data, verify data integrity, load the most recently executed object for comparison. If the same data exists and the time difference is not large, there is no need to include the test case and data in the test queue, and execution will start from the next data. If the same data exists and the time difference is large or the same data does not exist, the test case and data will be included in the test queue and executed from the starting position in sequence; at the same time, the timing program starts to start, and receives real-time changes in the configuration data, and compares the corresponding data with the most recent data to see if there is any change; the monitoring program starts to monitor the entire process for abnormalities.

[0084] Start Appium Client Python and initiate a request to Appium Server through port 4723. After receiving the request, Appium Server parses the corresponding data and calls the Android driver through the corresponding port according to the request parameters, and generates a corresponding session for the client.

[0085] The Android driver responds to the Appium Server call and sends a request to the Android phone or simulator according to the call parameters. The Android phone or simulator receives the request, executes the request command according to the request parameters, and sends an execution command to the app. After receiving the command, the app starts to execute the corresponding interface, and after receiving the interface return value, it feeds back to the upper level layer by layer. Finally, the script displays the result and starts to execute the next command. Repeat the above steps until a test report is generated.

[0086] Furthermore, during the test process, the email configuration file data can be compared with the most recent data in real time. If there is a change, the test report sending address list is updated, and emails are sent according to the updated test report sending address list. If there is no change, the test report sending address list is not updated.

[0087] See also Figure 3, modify the main.properties file, put the test cases and data in the / data directory, modify the mail.properties file, and execute the Android AppCase client. Android AppCase starts to load the relevant configuration files, and completes the startup through data loading, data initialization, and data verification; at the same time, it starts configuration management, email management, status management, and timing management. The entire monitoring process also starts.

[0088] After Appium Client Python is started, it starts loading the most recently executed object and comparing it with the initialized data. If the same data exists and the time difference is not large, there is no need to include the test case and data in the test queue, and execution starts from the next data. This ensures that when the data is changed, there is no need to close the test client and retest. If the same data exists and the time difference is large or the same data does not exist, the test case and data are included in the test queue and executed in sequence from the starting position.

[0089] Appium Client Python makes requests to Appium Server through the corresponding port.

[0090] After receiving the request, Appium Server parses the corresponding data and calls the Android driver through the corresponding port according to the request parameters. The Android driver responds to the Appium Server call and initiates a request to the Android phone or simulator according to the call parameters. The Android phone or simulator receives the request, executes the request command according to the request parameters, and initiates an execution command to the app. After receiving the command, the app starts to execute the corresponding interface, and after receiving the return value of the interface, it feeds back to the upper level layer by layer. Finally, the script displays the result and starts to execute the next command. Before executing the next instruction, it is necessary to check whether there is new or changed data sent. If so, the data is included in the execution queue. Repeat the above steps until the test report is generated.

[0091] Furthermore, the email configuration file data can be compared with the most recent data in real time. If there is a change, the test report sending address list is updated, and emails are sent according to the updated test report sending address list. If there is no change, the test report sending address list is not updated.

[0092] Scenario 2: Testing an iOS application via Appium.

[0093] After filling in the configuration file, start the Appium Python Client and start the test. During the test, it is found that some test cases and data (equivalent to the objects to be tested) need to be adjusted. For example, modify the main configuration file, specify the corresponding data, and modify the email configuration file, specify the corresponding recipient (including the address for receiving the test report).

[0094] See also Figure 4 , start Appium Client Python to load the configuration file, initialize data, verify data integrity, load the most recently executed object for comparison. If the same data exists and the time difference is not large, there is no need to include the test case and data in the test queue, and start execution from the next data. If the same data exists and the time difference is large or the same data does not exist, the test case and data will be included in the test queue and executed from the start position in sequence; at the same time, the timing program starts to start, and receives in real time whether the configuration data has changed, and whether the corresponding data has changed compared with the most recent data; the monitoring program starts to monitor the entire process for abnormalities. Start Appium Client Python and initiate a request to Appium Server through port 4723. After receiving the request, Appium Server parses the corresponding data and calls the iOS driver through the corresponding port according to the request parameters, and generates the corresponding session for the client.

[0095] The iOS driver responds to the Appium Server call and initiates a request to the iOS phone or simulator based on the call parameters. The iOS phone or simulator receives the request, executes the request command based on the request parameters, and initiates an execution command to the app. After receiving the command, the app starts to execute the corresponding interface, and after receiving the interface return value, it feeds back to the upper level layer by layer. Finally, the script displays the result and starts to execute the next command. Repeat the above steps until a test report is generated.

[0096] Furthermore, the email configuration file data can be compared with the most recent data in real time. If there is a change, the test report sending address list is updated, and emails are sent according to the updated test report sending address list. If there is no change, the test report sending address list is not updated.

[0097] See also Figure 5, modify the main.properties file, put the test cases and data in the / data directory, modify the mail.properties file, and execute the iOSAppCase client. iOSAppCase starts to load the relevant configuration files, and completes the startup through data loading, data initialization, and data verification; at the same time, configuration management, email management, status management, and timing management are started; the entire monitoring process also starts. After Appium ClientPython is started, it loads the most recently executed object and compares it with it. If the same data exists and the time difference is not large, there is no need to include the test cases and data in the test queue, and execution starts from the next data. If the same data exists and the time difference is large or the same data does not exist, the test cases and data are included in the test queue and executed in sequence from the starting position; at the same time, the timing program starts to start, and receives in real time whether the configuration data has changed, and whether the corresponding data has changed compared with the most recent data. Appium ClientPython sends a request to the Appium Server through the corresponding port.

[0098] After receiving the request, Appium Server parses the corresponding data and calls the iOS driver through the corresponding port according to the request parameters. The iOS driver responds to the Appium Server call and initiates a request to the iOS phone or simulation according to the call parameters. The iOS phone or simulation receives the request, executes the request command according to the request parameters, and initiates an execution command to the app. After receiving the command, the app starts to execute the corresponding interface, and after receiving the return value of the interface, it feeds back to the upper level layer by layer. Finally, the script displays the result and starts to execute the next command. Before executing the next instruction, it is necessary to check whether the status and configuration information have changed. If changed, the changed data will be included in the execution queue. Repeat the above steps until the test report is generated.

[0099] Furthermore, the email configuration file data can be compared with the most recent data in real time. If there is a change, the test report sending address list is updated, and emails are sent according to the updated test report sending address list. If there is no change, the test report sending address list is not updated.

[0100] Scenario 3: Testing a web application through Appium.

[0101] After filling in the configuration file, start the Appium Python Client and start the test. During the test, it is found that some test cases and data (equivalent to the objects to be tested) need to be adjusted. For example, modify the main configuration file, specify the corresponding data, and modify the email configuration file, specify the corresponding recipient (including the address for receiving the test report).

[0102] See also Figure 6 , start Appium Client Python to load the configuration file, initialize data, verify data integrity, and check the execution point. If it is the default value, there is no need to include the test case and data in the test queue and execute in sequence; if it is not the default value, the test case and data will be included in the test queue and executed from the specified position; at the same time, the timing program starts to check in real time whether the configuration data has changed and whether the corresponding status has changed; the monitoring program starts to monitor the entire process for abnormalities. Start Appium Client Python and initiate a request to AppiumServer through port 4723. After receiving the request, Appium Server parses the corresponding data and calls the Web driver through the corresponding port according to the request parameters, and generates the corresponding session for the client.

[0103] The Web driver responds to the Appium Server call and initiates a request to the Web phone or simulation according to the call parameters. The Web phone or simulation receives the request, executes the request command according to the request parameters, and initiates the execution command to the app. After receiving the command, the app starts to execute the corresponding interface, and after receiving the interface return value, it feeds back to the upper level layer by layer. Finally, the script displays the result and starts to execute the next command. Repeat the above steps until the test report is generated.

[0104] Furthermore, the email configuration file data can be compared with the most recent data in real time. If there is a change, the test report sending address list is updated, and emails are sent according to the updated test report sending address list. If there is no change, the test report sending address list is not updated.

[0105] See also Figure 7 , modify the main.properties file, put the test cases and data in the / data directory, modify the mail.properties file, and execute the Web AppCase client. Web AppCase starts to load the relevant configuration files, and completes the startup through data loading, data initialization, and data verification; at the same time, configuration management, email management, status management, and timing management are started; the entire monitoring process also starts. After Appium Client Python is started, it starts to check the execution point. If it is the default value, there is no need to include the test cases and data in the test queue and execute them in sequence; if it is not the default value, the test cases and data are included in the test queue and executed in sequence from the starting position. Appium Client Python sends a request to Appium Server through the corresponding port.

[0106] After receiving the request, Appium Server parses the corresponding data and calls the web driver through the corresponding port according to the request parameters. The web driver responds to the Appium Server call and initiates a request to the web phone or simulation according to the call parameters. The web phone or simulation receives the request, executes the request command according to the request parameters, and initiates an execution command to the app. After receiving the command, the app starts to execute the corresponding interface, and after receiving the return value of the interface, it feeds back to the upper level layer by layer. Finally, the script displays the result and starts to execute the next command. Before executing the next instruction, it is necessary to check whether the status and configuration information have changed. If changed, the changed data will be included in the execution queue. Repeat the above steps until the test report is generated.

[0107] Furthermore, the email configuration file data can be compared with the most recent data in real time. If there is a change, the test report sending address list is updated, and emails are sent according to the updated test report sending address list. If there is no change, the test report sending address list is not updated.

[0108] In the above scenarios 1, 2, and 3, the configuration data of the configuration file is monitored in real time through configuration management, and the latest data of the status management is compared with the current data to determine whether the data has changed, thereby determining whether the test is included in the test queue. This ensures that when the data is changed, there is no need to close the test client and re-test, which effectively saves a lot of time for testers and improves work efficiency.

[0109] In the above scenarios 1, 2 and 3, by configuring the client to compare with the most recently executed object, it is decided whether the control test cases and data should be included in the test queue. This effectively solves the problem that when the program stops abnormally, the program can continue to execute from the stopped position when it is restarted, without having to start from scratch. The emergence of this function saves a lot of time for testers and improves work efficiency.

[0110] In the above scenarios 1, 2 and 3, by configuring the email to compare with the most recently executed object, check whether the email recipient has been modified during the test. If modified, update the sending address list. If not, there is no need to update the sending address list. The email management module sends emails in sequence based on the obtained occurrence list, thereby completing the entire process and improving work efficiency.

[0111] See also Figure 8 The embodiment of the present invention further provides a device for testing an application program, the device 800 comprising:

[0112] The comparison module 801 is used to compare the object to be tested with the most recently executed object during the test process;

[0113] The determination module 802 is used to determine whether to include the object to be tested into the test queue according to the comparison result; if the object to be tested is included in the test queue, the test is performed from a preset position; if the object to be tested is not included in the test queue, the object to be tested is skipped to perform a predefined operation.

[0114] In some implementations, the comparison module 801 is further used to: during the test process, compare the object to be tested executed at the current time with the object executed at the first time, where the first time is the time before the current time;

[0115] The determination module 802 is further configured to: if the object to be tested at the current time and the object to be executed at the first time have the same data, and the time difference between the current time and the first time is less than a preset value, then not include the object to be tested in the test queue;

[0116] If the same data exists in the object to be tested at the current time and the object executed at the first time, and the time difference between the current time and the first time is greater than a preset value, or if the same data does not exist in the object to be tested at the current time and the object executed at the first time, the object to be tested is included in the test queue.

[0117] In some implementations, the comparison module 801 is further used to: during the test process, determine whether the object to be tested is modified compared with the last executed object by using the status bit of the configured status management.

[0118] In some embodiments, see Figure 8 , the device 800 further includes:

[0119] The detection module 803 is used to detect whether the receiving address of the test report is modified during the test process; if the receiving address of the test report is modified, the sending address list of the test report is updated; if the receiving address of the test report is not modified, the sending address list of the test report is not updated.

[0120] In some embodiments, the detection module 803 is further used to: start a file detection function before sending a test report email; obtain the most recent email sending record through the file detection function, and compare the receiving address of the test report with the most recent email sending record.

[0121] The device for testing an application provided in an embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effects are similar, so this embodiment will not be repeated here.

[0122] See also Fig. 9 , Fig. 9 is a structural diagram of a device for testing an application program used in an embodiment of the present invention, such as Fig. 9 As shown, the device 900 for testing an application program includes: a processor 901, a transceiver 902, a memory 903 and a bus interface, wherein:

[0123] In one embodiment of the present invention, the apparatus 900 for testing an application program further includes: a program stored in the memory 903 and executable on the processor 901, the program being executed by the processor 901 to implement the following Figure 1 Steps shown.

[0124] exist Fig. 9 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 901 and memory represented by memory 903. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 902 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices over a transmission medium.

[0125] The processor 901 is responsible for managing the bus architecture and general processing, and the memory 903 can store data used by the processor 901 when performing operations.

[0126] The communication device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0127] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the method embodiment for supporting time-sensitive communication service quality is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0128] The steps of the method or algorithm described in conjunction with the contents disclosed in the present invention can be implemented in hardware or by executing software instructions in a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disks, mobile hard disks, read-only optical disks, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be carried in an ASIC. In addition, the ASIC can be carried in a core network interface device. Of course, the processor and the storage medium can also exist in the core network interface device as discrete components.

[0129] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented using software, the functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium may be any available medium that a general or special-purpose computer can access.

[0130] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

[0131] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present invention may take the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0132] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0135] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for testing an application, characterized in that: include: During the test, the object to be tested is compared with the object executed the most recently, the object to be tested including: test cases and / or data in the configuration file of the application; Determine whether to include the subject to be tested into a test queue according to the comparison result; If the object to be tested is included in the test queue, determining to test the object to be tested, and executing the test from a preset position in the test queue; If the object to be tested is not included in the test queue, it is determined not to test the object to be tested, and the predefined operation is skipped to execute on the object to be tested.

2. The method according to claim 1, characterized in that The comparing the object to be tested with the most recently executed object includes: During the test, the object to be tested executed at the current time is compared with the object executed at the first time, the first time being the time before the current time; The step of determining whether to include the subject to be tested into a test queue according to the comparison result includes: If the object to be tested at the current time and the object to be executed at the first time have the same data, and the time difference between the current time and the first time is less than a preset value, the object to be tested is not included in the test queue; If the same data exists in the object to be tested at the current time and the object executed at the first time, and the time difference between the current time and the first time is greater than a preset value, or if the same data does not exist in the object to be tested at the current time and the object executed at the first time, the object to be tested is included in the test queue.

3. The method according to claim 1, characterized in that The method further comprises: During the test process, check whether the receiving address of the test report has been modified; If the receiving address of the test report is modified, updating the sending address list of the test report; If the receiving address of the test report is not modified, the sending address list of the test report is not updated.

4. The method according to claim 3, characterized in that During the test process, detecting whether the receiving address of the test report is modified includes: Before sending the test report email, start the file detection function; The most recent mail sending record is obtained through the file detection function, and the receiving address of the test report is compared with the most recent mail sending record.

5. A device for testing an application, characterized in that: include: A comparison module is used to compare the object to be tested with the object executed last time during the test process, wherein the object to be tested includes: test cases and / or data in the configuration file of the application program; A determination module is used to determine whether to include the object to be tested into a test queue based on the comparison result; if the object to be tested is included in the test queue, it is determined that the object to be tested is tested, and the test is performed from a preset position in the test queue; if the object to be tested is not included in the test queue, it is determined that the object to be tested is not tested, and the object to be tested is skipped to perform a predefined operation.

6. The device according to claim 5, characterized in that The comparison module is further used to: during the test process, compare the object to be tested executed at the current time with the object executed at the first time, where the first time is the time before the current time; The determination module is further configured to: if the object to be tested at the current time and the object to be executed at the first time have the same data, and the time difference between the current time and the first time is less than a preset value, then not include the object to be tested in the test queue; If the same data exists in the object to be tested at the current time and the object executed at the first time, and the time difference between the current time and the first time is greater than a preset value, or if the same data does not exist in the object to be tested at the current time and the object executed at the first time, the object to be tested is included in the test queue.

7. The device according to claim 5, characterized in that The device also includes: The detection module is used to detect whether the receiving address of the test report is modified during the test process; if the receiving address of the test report is modified, the sending address list of the test report is updated; if the receiving address of the test report is not modified, the sending address list of the test report is not updated.

8. The device according to claim 7, characterized in that The detection module is further used to: start a file detection function before sending the test report email; obtain the most recent email sending record through the file detection function, and compare the receiving address of the test report with the most recent email sending record.

9. A device for testing an application, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the method for testing an application program according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for testing an application program according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Automatic test method for micro-service, server, and computer-readable storage medium

    CN109189672A

  • Method and device for executing test case

    CN110334011A