Application test method, device, terminal and storage medium

By operating the terminal application's control library until a new page is triggered to load or the end condition is reached, the problem of insufficient testing efficiency of Monkey tool is solved, and more efficient application testing is achieved.

CN113485943BActive Publication Date: 2025-03-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110932589.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-13
Publication Date
2025-03-21
Estimated Expiration
2041-08-13

AI Technical Summary

Technical Problem

In the prior art, when testing the terminal application through Monkey tool, the testing efficiency is not high, and invalid operations and abnormal events are easily generated.

Method used

By calling the component, determine the control library corresponding to the current page of the test application, and perform operations on the controls in the control library until the new page is loaded or the set end test conditions are met.

Benefits of technology

It effectively avoids invalid operations and abnormal events during application testing, and improves the efficiency of application testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113485943B_ABST
    Figure CN113485943B_ABST
Patent Text Reader

Abstract

The present application discloses an application testing method, device, terminal and storage medium, wherein the application testing method comprises: when a page is loaded by an application under test, determining a first control library corresponding to the current page of the application under test by calling a first component; the first control library contains at least one first control in the corresponding page; performing a first operation on any first control in the first control library at least once, until the executed first operation triggers the application under test to load a new page, or until a set test end condition is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an application testing method, device, terminal and storage medium. Background Art

[0002] In order to provide users with a high-quality terminal usage environment, developers need to perform stability tests on terminal applications to learn about inevitable or occasional crash problems in the applications, and then repair the applications based on the results of the stability tests.

[0003] In the related art, the Monkey tool is used to randomly select coordinates for the terminal application and execute corresponding event operations, which generates a large number of invalid event operations and may even cause abnormal event operations such as network disconnection and shutdown, resulting in low application testing efficiency. Summary of the invention

[0004] In view of this, embodiments of the present application provide an application testing method, device, terminal and storage medium to at least solve the problem of low testing efficiency of related technology application programs.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application provides an application testing method, the method comprising:

[0007] In the case where the application under test loads a page, determining a first control library corresponding to the current page of the application under test by calling a first component; the first control library contains at least one first control in the corresponding page;

[0008] A first operation is performed on any first control in the first control library at least once, until the performed first operation triggers the application under test to load a new page, or until a set test end condition is met.

[0009] Wherein, in the above scheme, the method further comprises:

[0010] The first protocol is obtained from the setting file corresponding to the application under test by calling the second component, and the corresponding setting page is loaded in the application under test based on the obtained first protocol.

[0011] In the above scheme, the method further comprises:

[0012] When the first operation executed is used to trigger the application under test to load a new page, and the corresponding new page belongs to a first test module, the application under test is triggered to load the corresponding new page; the first test module represents the current test module of the application under test.

[0013] In the above scheme, the method further comprises:

[0014] When the first attribute value of the corresponding new page belongs to a set attribute value set, it is determined that the corresponding new page belongs to a first test module; the set attribute value set includes the first attribute value of each page in at least one page corresponding to the first test module.

[0015] In the above solution, the first attribute value includes an Activity attribute value.

[0016] In the above solution, the set end test condition includes:

[0017] The cumulative time of testing the application under test reaches a first set threshold,

[0018] and / or,

[0019] The cumulative number of first operations on the tested application reaches a second set threshold.

[0020] The present application also provides an application testing device, including:

[0021] A first processing unit is used to determine, when the application under test loads a page, a first control library corresponding to the current page of the application under test by calling a first component; the first control library contains at least one first control in the corresponding page;

[0022] An operating unit is used to perform a first operation on any first control in the first control library at least once, until the executed first operation triggers the application under test to load a new page, or until a set test end condition is met.

[0023] In the above scheme, the device also includes:

[0024] The first loading unit is used to obtain the first protocol from the setting file corresponding to the application under test by calling the second component, and load the corresponding setting page in the application under test based on the obtained first protocol.

[0025] In the above scheme, the device also includes:

[0026] The second loading unit is used to trigger the application under test to load a corresponding new page when the first operation executed is used to trigger the application under test to load a new page and the corresponding new page belongs to a first test module; the first test module represents the current test module of the application under test.

[0027] In the above scheme, the device also includes:

[0028] The second processing unit is used to determine that the corresponding new page belongs to the first test module when the first attribute value of the corresponding new page belongs to a set attribute value set; the set attribute value set includes the first attribute value of each page in at least one page corresponding to the first test module.

[0029] In the above solution, the first attribute value includes an Activity attribute value.

[0030] In the above solution, the set end test condition includes:

[0031] The cumulative time of testing the application under test reaches a first set threshold,

[0032] and / or,

[0033] The cumulative number of first operations on the tested application reaches a second set threshold.

[0034] The embodiment of the present application further provides a terminal, comprising: a processor and a memory for storing a computer program that can be run on the processor,

[0035] Wherein, the processor is used to execute the steps of the above-mentioned application testing method when running the computer program.

[0036] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned application testing method are implemented.

[0037] In an embodiment of the present application, when the application under test loads a page, the first control library corresponding to the current page is determined by calling the first component, and the first control library contains at least one first control in the corresponding page; the first operation is performed on any first control in the first control library at least once, until the executed first operation triggers the application under test to load a new page, or until the set end test condition is met. By performing operations on the controls of the current page, invalid operations and abnormal events can be avoided during the application test process, thereby improving the efficiency of the application test. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of an application testing method provided in an embodiment of the present application;

[0039] Figure 2 A flowchart of an application testing method provided for an application embodiment of the present application;

[0040] Figure 3 A flowchart of another application testing method provided for an application embodiment of the present application;

[0041] Figure 4 A schematic diagram of the structure of an application testing device provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to provide users with a high-quality terminal usage environment, developers need to perform stability tests on terminal applications to learn about inevitable or occasional crash problems in the applications, and then repair the applications based on the results of the stability tests.

[0044] In the related art, the Monkey tool is used to randomly select coordinates for the terminal application and execute corresponding event operations, which generates a large number of invalid event operations and may even cause abnormal event operations such as network disconnection and shutdown, resulting in low application testing efficiency.

[0045] Based on this, in various embodiments of the present application, when the application under test loads a page, the first control library corresponding to the current page is determined by calling the first component, and the first control library contains at least one first control in the corresponding page; the first operation is performed on any first control in the first control library at least once, until the executed first operation triggers the application under test to load a new page, or until the set end test condition is met. By performing operations on the controls of the current page, invalid operations and abnormal events during application testing can be avoided, thereby improving the efficiency of application testing.

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] Figure 1 The following is a schematic diagram of the implementation process of the application testing method provided in the embodiment of the present application. The execution subject may be a terminal, wherein the terminal includes but is not limited to electronic devices such as mobile phones and tablets. Figure 1 As shown, the application test methods include:

[0048] Step 101: when a page of the application under test is loaded, a first control library corresponding to the current page of the application under test is determined by calling a first component.

[0049] Wherein, the first control library contains at least one first control in the corresponding page;

[0050] In this embodiment, whenever the application under test loads a page, the control information corresponding to the current page is obtained by calling the first component, and the obtained control information is determined as the first control library corresponding to the current page. Here, the first control library is a collection of controls corresponding to the current page, including at least one first control in the corresponding page.

[0051] Step 102: Execute a first operation on any first control in the first control library at least once, until the executed first operation triggers the application under test to load a new page, or until a set test end condition is met.

[0052] Perform a first operation on any first control in the first control library, and determine whether the executed first operation triggers the application under test to load a new page or the current test state has met the set end test condition. If the judgment result indicates that it will not trigger the application under test to load a new page and the current test state has not met the set end test condition, perform the first operation on any first control in the first control library again, and repeat the above steps until the judgment result indicates that it triggers the application under test to load a new page. Then load the new page, obtain the control information corresponding to the new page by calling the first component, and perform the first operation on any control of the new page again; or until the current test state meets the set end test condition, stop the application test.

[0053] Here, the first operation performed on the first control can represent an event operation, including but not limited to click, long press, double click, slide, drag or input, etc. The loaded new page refers to another page different from the current page. The new page here can be a page that has been loaded during this application test. For example, click the control corresponding to a certain label in page 1, and the application under test is loaded from page 1 to page 2. Then click the control corresponding to the "return" label in page 2, and the application under test is loaded from page 2 to page 1. When the page is loaded for the second time, page 1 is the new page. In addition, when performing the first operation on any first control in the first control library, the method of selecting any first control can be random. By randomly selecting any first control on the current page to perform the first operation, the application is tested as comprehensively as possible during the test process.

[0054] In an embodiment of the present application, when the application under test loads a page, the first control library corresponding to the current page is determined by calling the first component, and the first control library contains at least one first control in the corresponding page; the first operation is performed on any first control in the first control library at least once, until the executed first operation triggers the application under test to load a new page, or until the set end test condition is met. By performing operations on the controls of the current page, invalid operations and abnormal events can be avoided during the application test process, thereby improving the efficiency of the application test.

[0055] In order to perform stability testing on the settings page of the application under test, it is necessary to jump to the settings page to start the test. The scheme protocol is a page jump protocol. By defining the scheme protocol, you can jump to the corresponding settings page in the application. In the related art, the scheme protocol is started by the adb shell am start command to load the corresponding page in the application under test. However, since there are usually special characters in the scheme protocol, the adb shell command is truncated and the settings page cannot be loaded normally. In one embodiment, the method also includes:

[0056] The first protocol is obtained from the setting file corresponding to the application under test by calling the second component, and the corresponding setting page is loaded in the application under test based on the obtained first protocol.

[0057] By calling the second component, the first protocol stored in the setting file is obtained from the setting file corresponding to the application under test, an Intent component is generated based on the obtained first protocol, and the setting page corresponding to the first protocol is loaded in the application under test through the Intent component. Here, the setting file can be a file associated with the application under test, which is used to store the first protocol. The first protocol can be a scheme protocol, and the setting page is the page corresponding to the scheme protocol. In the application, each scheme protocol can open a setting page. The Intent component can describe the action, data involved in the action, and additional data of an operation in the application. Android can find the corresponding component according to the description of the Intent component, pass the information of the Intent component to the corresponding component, and implement the call of the corresponding component.

[0058] The first protocol is saved in a setting file, and the Intent component is generated by reading the first protocol from the setting file, and the setting page corresponding to the first protocol is loaded in the application under test through the Intent component. In this way, when loading the setting page for stability testing, it is not necessary to start the first protocol through the command line, which can avoid the phenomenon that the command is truncated and the setting page cannot be loaded due to special characters in the scheme protocol, thereby ensuring the loading of the setting page.

[0059] In one embodiment, the method further comprises:

[0060] When the first operation executed is used to trigger the application under test to load a new page, and the corresponding new page belongs to a first test module, the application under test is triggered to load the corresponding new page; the first test module represents the current test module of the application under test.

[0061] In the case where the first operation performed can be used to trigger the application under test to load a new page, it is determined whether the new page to be loaded belongs to the first test module. If the corresponding new page belongs to the first test module, the application under test is triggered to load the corresponding new page. Here, the first test module represents the current test module of the application under test, which can be set before the application test, and the setting page of the first test module is loaded. The first test module can be a relatively independent program unit in the application, and each program unit completes and implements a relatively independent software function.

[0062] By judging whether the new page to be loaded belongs to the current test module, it is determined whether to load the new page and implement the test of the set test module. In this way, through refined module testing, the set test module, such as the test module with modified code, can be tested, thereby improving the test efficiency of the application test.

[0063] In one embodiment, the method further comprises:

[0064] When the first attribute value of the corresponding new page belongs to a set attribute value set, it is determined that the corresponding new page belongs to a first test module; the set attribute value set includes the first attribute value of each page in at least one page corresponding to the first test module.

[0065] When judging whether the corresponding new page belongs to the first test module, the first attribute value of the new page belongs to the set attribute value set. If the judgment result indicates that the first attribute value of the new page belongs to the set attribute value set, it is determined that the corresponding new page belongs to the first test module. Here, the first test module corresponds to at least one page, and the set attribute value set includes the first attribute value of each page corresponding to the first test module. The determination of the set attribute value set can be obtained by reading from the file of the application to be tested before the test of the application to be tested begins.

[0066] The attribute value information set of the page corresponding to the first test module is used as the judgment condition to determine whether the new page belongs to the first test module. Only when the conditions are met can the loading of the corresponding new page be triggered. In this way, it can be determined whether the new page to be loaded belongs to the current test module, thereby performing a refined module test on the current test module.

[0067] In one embodiment, the first attribute value includes an Activity attribute value.

[0068] Here, Activity is a component in the page, which is used to realize screen interaction.

[0069] In actual applications, when performing stability testing on the application under test, the user can input the first test module information. For example, the first test module contains page A, page B, and page C. The module information provided by the user is as follows: the class name of the Activity component of page A is ActivityNameA, the class name of the Activity component of page B is ActivityNameB, and the class name of the Activity component of page C is ActivityNameC. The set of set attribute values ​​corresponding to the first test module includes ActivityNameA, ActivityNameB, and ActivityNameC. The component name ComponentName information of the new page is obtained through ActivityManager. The class name of the Activity component of the new page can be obtained based on ComponentName.getClassName. If the class name of the Activity component of the new page belongs to the set of set attribute values, it is determined that the new page belongs to the first test module; otherwise, it is determined that the new page does not belong to the first test module.

[0070] In one embodiment, the set end test condition includes:

[0071] The cumulative time of testing the application under test reaches a first set threshold,

[0072] and / or,

[0073] The cumulative number of first operations on the tested application reaches a second set threshold.

[0074] Here, the set end test condition may be a test time condition, a test number condition, or a combination of the test time condition and the test number condition, or may be combined with other end test conditions such as a set proportion of first controls on a set proportion of pages of the application having executed the first operation, etc. When the test of the application under test meets the set end test condition, the application under test ends the test and may output the corresponding test result.

[0075] In actual applications, any of the following can be used: the cumulative testing time for the application under test reaches 1 hour; the cumulative number of first operations on the application under test reaches 30,000 times; the cumulative testing time for the application under test reaches 1 hour and the cumulative number of first operations on the application under test reaches 50,000 times.

[0076] By setting the end test condition, the first operation will no longer be executed after the set end test condition is met, thereby achieving the end of the application test process.

[0077] In the related art, in order to operate the controls of an application, the first control of the current page is usually obtained with the help of a framework. For example, you can use the Appium framework by installing the Appium environment to obtain all the controls of the current page; you can use the Robotium framework to write UI automation scripts. Robotium is an Android automation testing framework that provides APIs for simulating various gesture operations (clicks, long presses, slides, etc.), search and assertion mechanisms, and can operate various controls. However, since it is necessary to install the environment, write test scripts, and re-sign the application under test, it also requires high programming skills from users, and there is a problem of low application testing efficiency.

[0078] In one embodiment, the method is implemented based on AccessibilityService.

[0079] Obtain all control information of the current page through AccessibilityService, perform the first operation on any first control at least once, and determine whether the first operation triggers a new page. If it triggers, load the new page, or determine whether the new page belongs to the test module, and repeat the above steps until the set end test condition is met. In this way, by directly executing the corresponding jar file on the terminal, there is no need to re-sign the application under test, root the terminal, or write scripts, which reduces the requirements for user programming skills and improves application testing efficiency.

[0080] The present application is further described in detail below in conjunction with application examples.

[0081] With the development of mobile computing technology and the continuous improvement of hardware technology, more and more users use mobile terminals to complete various tasks. In order to meet the personalized needs of different users, mobile terminal systems have become more diversified. Under the same system, there are also various software for users to choose from. In order to provide users with a better terminal experience, higher stability and robustness requirements are put forward for the applications loaded in mobile terminals. Therefore, developers need to perform stability tests on terminal applications to find out the inevitable or occasional crash problems in the applications, so as to repair and improve the applications according to the results of the stability tests.

[0082] In the related art, the Android system can call the Monkey tool of the Android system through the Android Debug Bridge (ADB), a command line tool that can be used to operate terminal devices such as mobile devices or simulators, and perform stability tests on terminal applications by randomly selecting coordinates and executing event operations such as clicks and drags. Monkey is a command line tool that comes with the Android system and can run in a simulator or a terminal device. Monkey sends a pseudo-random user event stream to the system to implement stress testing on the application being developed. Since the operation of Monkey is very random and uncontrollable, it is easy to click outside the application page during the test, but click on the desktop or other non-valid areas of the mobile terminal, resulting in a large number of invalid clicks; it may even cause abnormal operations such as disconnection from the network and shutdown, which affects the normal progress of the stability test and the test efficiency of the application is not high.

[0083] In addition, in order to meet the personalized needs of users, the application corresponds to a large number of pages and supports many functions. Therefore, an application will be divided into many relatively independent modules. Modules refer to some relatively independent program units in the entire application, and each program unit completes and implements a relatively independent software function. In this way, when only some modules in the application program are modified, the stability test of the module can be carried out in a targeted manner, thereby improving the test efficiency within a limited test time. In the related art, it is impossible to accurately load the page of the module with the modified code, and therefore it is impossible to perform a refined stability test on the module.

[0084] Combination Figure 2 , the test method for global application testing of the application includes:

[0085] Open the default page of the application, obtain the information of all controls on the current page, randomly select any control from it, perform click, drag and other operations, and repeat the operation on any control on the current page until the operation on the control triggers the loading of a new page, load the new page, and then obtain all control information on the new page, and randomly select any control to operate. Repeat the above steps until the set end test conditions are met.

[0086] The related technology uses a method of randomly selecting coordinates for operation. When randomly selecting coordinates, there will be areas where the selected coordinates are not clickable or cannot be operated, such as the desktop of a mobile terminal. When the selected coordinates are areas used to indicate closing the network or shutting down the computer, abnormal operations such as disconnection and shutdown will occur, affecting the normal progress of the stability test, and the test efficiency of the application is not high. In this application embodiment, by randomly selecting controls on the page for operation, invalid operations and abnormal events can be reduced, thereby improving the efficiency of the stability test.

[0087] In order to perform stability testing on the settings page of the application under test, you need to jump to the settings page to start the test. The scheme protocol is an in-page jump protocol. By defining the scheme protocol, you can jump to the corresponding settings page in the application. In the related art, the scheme protocol needs to be executed in a command processor, such as Bash. Bash is a command processor that usually runs in a text window and executes commands entered by the user. The Bash processor performs special processing on some characters (such as commas, double quotes, etc.). If the original scheme protocol contains characters such as commas and double quotes, and the Bash processor is used to start the command line, the scheme protocol will be truncated or invalid.

[0088] Combination Figure 3 , the application testing method for the application module test includes:

[0089] The Scheme protocol of the module and the Activity information of at least one page included in the module are read from the setting file, and the setting page is loaded according to the read Scheme protocol.

[0090] According to the scheme protocol, the page can be accurately loaded for testing, avoiding the operation of irrelevant pages during testing and improving the test efficiency; the scheme protocol is stored in the setting file, and when the stability test is turned on, the scheme protocol is read from the setting file to start the page. The problem of truncation and failure when starting the page through the command line when there are special characters is solved.

[0091] Here, the scheme protocol can be stored in a setting file, and then the setting file can be loaded into the mobile terminal device through the adb push command. In this way, during the stability test, the scheme protocol of the mobile terminal is directly read, avoiding the truncation and failure problems of reading the scheme protocol through processors such as Bash.

[0092] Get all the control information of the current page through the AccessibilityService service, randomly select any control, click, drag and other operations, and determine whether the control operation will cause the application under test to load a new page. When the control operation causes the application under test to load a new page, determine whether the Activity of the new page belongs to the test module page. If it belongs to the test module page, load the new page and obtain the control information of the new page; if it does not belong to the test module page, stay on the current page and continue testing. Repeat the above steps until the set end test conditions are met.

[0093] During the stability test, the page is opened based on whether it belongs to the test module. In this way, the accuracy test based on the test module can be implemented, and the pages corresponding to the test module can be tested, which reduces the operation of other invalid pages and greatly improves the efficiency. Therefore, the test module can be tested more fully in a shorter time.

[0094] In actual applications, taking the display of a shopping process as an example, clicking on the icon of a certain product on the shopping cart page triggers the loading of the product details page. Since the shopping cart page belongs to the shopping cart module and the product details page belongs to the business details module, and since the new page (product details page) does not belong to the test module (shopping cart module), it will stay on the shopping cart page to continue testing.

[0095] In the application embodiment of the present application, the control information of the current page is obtained through the AccessibilityService service, and any control is randomly selected for event operation, providing a simple and efficient mobile terminal application stability test method, which does not require re-signing the tested application, rooting the terminal, and writing scripts, reducing the requirements for user programming skills and improving application testing efficiency. By obtaining page controls, clicking, dragging, and other operations are performed on page controls, which is controllable, greatly reduces invalid clicks, and improves test efficiency. In addition, by saving the scheme protocol in the setting file, reading the scheme protocol from the setting file, and generating the Intent component, the stability test of the specified page can be performed, solving the problem of page startup being truncated due to the presence of special characters when starting the page through the command line.

[0096] To implement the method of the embodiment of the present application, the embodiment of the present application also provides an application testing device, such as Figure 4 As shown, the device comprises:

[0097] The first processing unit 401 is used to determine the first control library corresponding to the current page of the application under test by calling the first component when the application under test loads a page; the first control library contains at least one first control in the corresponding page;

[0098] The operating unit 402 is used to perform a first operation on any first control in the first control library at least once, until the executed first operation triggers the application under test to load a new page, or until a set test end condition is met.

[0099] In one embodiment, the device further comprises:

[0100] The first loading unit is used to obtain the first protocol from the setting file corresponding to the application under test by calling the second component, and load the corresponding setting page in the application under test based on the obtained first protocol.

[0101] In one embodiment, the apparatus further comprises:

[0102] The second loading unit is used to trigger the application under test to load a corresponding new page when the first operation executed is used to trigger the application under test to load a new page and the corresponding new page belongs to a first test module; the first test module represents the current test module of the application under test.

[0103] In one embodiment, the apparatus further comprises:

[0104] The second processing unit is used to determine that the corresponding new page belongs to the first test module when the first attribute value of the corresponding new page belongs to a set attribute value set; the set attribute value set includes the first attribute value of each page in at least one page corresponding to the first test module.

[0105] In one embodiment, the first attribute value includes an Activity attribute value.

[0106] In one embodiment, the set end test condition includes:

[0107] The cumulative time of testing the application under test reaches a first set threshold,

[0108] and / or,

[0109] The cumulative number of first operations on the tested application reaches a second set threshold.

[0110] In actual application, the first processing unit 401, the operation unit 402, the first loading unit, the second loading unit, and the second processing unit can be implemented by a processor in an application test device, such as a central processing unit (CPU), a digital signal processor (DSP), a microcontroller unit (MCU) or a programmable gate array (FPGA).

[0111] It should be noted that: the application testing device provided in the above embodiment only uses the division of the above program modules as an example when performing application testing. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the application testing device provided in the above embodiment and the application testing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0112] Based on the hardware implementation of the above program modules, and in order to implement the application test method of the embodiment of the present application, the embodiment of the present application also provides a terminal, such as Figure 5 As shown, the terminal 500 includes:

[0113] Communication interface 510, capable of exchanging information with other devices such as network devices;

[0114] The processor 520 is connected to the communication interface 510 to implement information exchange with other devices and is used to execute the method provided by one or more technical solutions when running a computer program. The computer program is stored in the memory 530.

[0115] Specifically, the processor 520 is configured to:

[0116] In the case where the application under test loads a page, determining a first control library corresponding to the current page of the application under test by calling a first component; the first control library contains at least one first control in the corresponding page;

[0117] A first operation is performed on any first control in the first control library at least once, until the performed first operation triggers the application under test to load a new page, or until a set test end condition is met.

[0118] In one embodiment, the processor 520 is configured to:

[0119] The first protocol is obtained from the setting file corresponding to the application under test by calling the second component, and the corresponding setting page is loaded in the application under test based on the obtained first protocol.

[0120] In one embodiment, the processor 520 is configured to:

[0121] When the first operation executed is used to trigger the application under test to load a new page, and the corresponding new page belongs to a first test module, the application under test is triggered to load the corresponding new page; the first test module represents the current test module of the application under test.

[0122] In one embodiment, the processor 520 is configured to:

[0123] When the first attribute value of the corresponding new page belongs to a set attribute value set, it is determined that the corresponding new page belongs to a first test module; the set attribute value set includes the first attribute value of each page in at least one page corresponding to the first test module.

[0124] In one embodiment, the first attribute value includes an Activity attribute value.

[0125] In one embodiment, the set end test condition includes:

[0126] The cumulative time of testing the application under test reaches a first set threshold,

[0127] and / or,

[0128] The cumulative number of first operations on the tested application reaches a second set threshold.

[0129] Of course, in actual application, the various components in the terminal 500 are coupled together through the bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 5 Various buses are labeled as bus system 540 .

[0130] The memory 530 in the embodiment of the present application is used to store various types of data to support the operation of the terminal 500. Examples of such data include: any computer program used to operate on the terminal 500.

[0131] It can be understood that the memory 530 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 530 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.

[0132] The method disclosed in the above embodiment of the present application can be applied to the processor 520, or implemented by the processor 520. The processor 520 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 520 or the instruction in the form of software. The above processor 520 can be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 520 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 530, and the processor 520 reads the program in the memory 530 and completes the steps of the above method in combination with its hardware.

[0133] Optionally, when the processor 520 executes the program, it implements the corresponding processes implemented by the terminal in each method of the embodiments of the present application, which will not be described here for the sake of brevity.

[0134] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, a memory 530 storing a computer program, and the computer program can be executed by a processor 520 of a terminal to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0135] In the several embodiments provided in the present application, it should be understood that the disclosed devices, electronic devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0136] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0137] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0138] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.

[0139] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0140] It should be noted that the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict. Unless otherwise specified and limited, the term "connection" should be understood in a broad sense, for example, it can be an electrical connection, or it can be the internal connection of two components, it can be a direct connection, or it can be an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0141] In addition, in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the objects distinguished by "first\second\third" can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0142] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0143] The various specific technical features in the various embodiments described in the specific implementation methods can be combined in various ways without contradiction. For example, different implementation methods can be formed by combining different specific technical features. In order to avoid unnecessary repetition, the various possible combinations of the specific technical features in this application will not be described separately.

Claims

1. An application testing method, characterized in that: The method comprises: In the case where the application under test loads a page, determining a first control library corresponding to the current page of the application under test by calling a first component; the first control library contains at least one first control in the corresponding page; Performing a first operation on any first control in the first control library at least once until the executed first operation triggers the application under test to load a new page, and performing the first operation on any control on the new page until a set test end condition is met, and stopping the test on the application under test; Wherein, the method further comprises: The first protocol is obtained from the setting file corresponding to the tested application by calling the second component, and an Intent component is generated based on the obtained first protocol. The setting page corresponding to the first protocol is loaded into the tested application through the Intent component.

2. The method according to claim 1, characterized in that The method further comprises: When the first operation executed is used to trigger the application under test to load a new page, and the corresponding new page belongs to a first test module, the application under test is triggered to load the corresponding new page; the first test module represents the current test module of the application under test.

3. The method according to claim 2, characterized in that The method further comprises: When the first property value of the corresponding new page belongs to a set property value set, it is determined that the corresponding new page belongs to a first test module; the set property value set includes the first property value of each page in at least one page corresponding to the first test module.

4. The method according to claim 3, characterized in that The first attribute value includes an Activity attribute value.

5. The method according to any one of claims 1 to 4, characterized in that: The set end test conditions include: The cumulative time of testing the application under test reaches a first set threshold, and / or, The cumulative number of first operations on the tested application reaches a second set threshold.

6. An application testing device, characterized in that: include: A first processing unit is used to determine a first control library corresponding to a current page of the application under test by calling a first component when the application under test loads a page; The first control library includes at least one first control in the corresponding page; an operation unit, configured to perform a first operation on any first control in the first control library at least once, until the performed first operation triggers the application under test to load a new page, and perform the first operation on any control of the new page until a set test end condition is met; The device also includes: The first loading unit is used to obtain the first protocol from the setting file corresponding to the application under test by calling the second component, generate an Intent component based on the obtained first protocol, and load the setting page corresponding to the first protocol in the application under test through the Intent component.

7. The device according to claim 6, characterized in that The device also includes: The second loading unit is used to trigger the application under test to load a corresponding new page when the first operation executed is used to trigger the application under test to load a new page, and the corresponding new page belongs to a first test module; the first test module represents the current test module of the application under test.

8. The device according to claim 7, characterized in that The device also includes: The second processing unit is used to determine that the corresponding new page belongs to the first test module when the first attribute value of the corresponding new page belongs to a set attribute value set; the set attribute value set includes the first attribute value of each page in at least one page corresponding to the first test module.

9. The device according to claim 8, characterized in that The first attribute value includes an Activity attribute value.

10. The device according to any one of claims 6 to 9, characterized in that The set end test conditions include: The cumulative time of testing the application under test reaches a first set threshold, and / or, The cumulative number of first operations on the tested application reaches a second set threshold.

11. A terminal, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the application testing method described in any one of claims 1 to 5.

12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the application testing method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Monkey test simulation method, apparatus and system

    CN107193733A

  • Software testing method and device

    CN110888799A