CN113485943A - Application testing method, device, terminal and storage medium - Google Patents

Application testing method, device, terminal and storage medium Download PDF

Info

Publication number
CN113485943A
CN113485943A CN202110932589.9A CN202110932589A CN113485943A CN 113485943 A CN113485943 A CN 113485943A CN 202110932589 A CN202110932589 A CN 202110932589A CN 113485943 A CN113485943 A CN 113485943A
Authority
CN
China
Prior art keywords
application
page
tested
test
condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110932589.9A
Other languages
Chinese (zh)
Inventor
刘宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110932589.9A priority Critical patent/CN113485943A/en
Publication of CN113485943A publication Critical patent/CN113485943A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses an application test method, an application test device, a terminal and a storage medium, wherein the application test method comprises the following steps: under the condition that a page is loaded by an application to be tested, determining a first control library corresponding to the current page of the application to be tested by calling a first component; the first control library comprises at least one first control in a corresponding page; and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the application to be tested to load a new page, or until a set test ending condition is met.

Description

Application testing method, device, terminal and storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to an application testing method and apparatus, a terminal, and a storage medium.
Background
In order to provide a high-quality terminal use environment for a user, developers need to perform stability testing on an application program of a terminal to know the problem of necessary or occasional crash existing in the application program, so that the application program is repaired according to a stability testing result.
In the related technology, coordinates are randomly selected for an application program of a terminal through a Monkey tool, corresponding event operation is executed, a large number of invalid event operations are generated, even abnormal event operations such as network disconnection and shutdown can be caused, and the testing efficiency of the application program is not high.
Disclosure of Invention
In view of this, embodiments of the present application provide an application testing method, an application testing apparatus, a terminal, and a storage medium, so as to at least solve the problem of low testing efficiency of related art application programs.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides an application testing method, which comprises the following steps:
under the condition that a page is loaded by an application to be tested, determining a first control library corresponding to the current page of the application to be tested by calling a first component; the first control library comprises at least one first control in a corresponding page;
and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the application to be tested to load a new page, or until a set test ending condition is met.
In the above scheme, the method further includes:
and acquiring a first protocol from a setting file corresponding to the application to be tested by calling a second component, and loading a corresponding setting page in the application to be tested based on the acquired first protocol.
In the above scheme, the method further comprises:
under the condition that the executed first operation is used for triggering the tested application to load a new page and the corresponding new page belongs to the first test module, triggering the tested application to load the corresponding new page; the first test module characterizes a current test module of the application under test.
In the above scheme, the method further comprises:
determining that the corresponding new page belongs to the first test module under the condition that the first attribute value of the corresponding new page belongs to the set attribute value set; the set attribute value set comprises a first attribute value of each page in at least one page corresponding to the first test module.
In the above solution, the first property value includes an Activity property value.
In the foregoing solution, the set test termination condition includes:
the time accumulated for testing the application under test reaches a first set threshold,
and/or the presence of a gas in the gas,
and accumulating the times of the first operation of the application to be tested to reach a second set threshold value.
An embodiment of the present application further provides an application testing apparatus, including:
the first processing unit is used for determining a first control library corresponding to the current page of the application to be tested by calling a first component under the condition that the page is loaded by the application to be tested; the first control library comprises at least one first control in a corresponding page;
and the operation unit is used for executing a first operation on any first control in the first control library at least once until the executed first operation triggers the application to be tested to load a new page, or until a set test ending condition is met.
In the above scheme, the apparatus further comprises:
and the first loading unit is used for acquiring a first protocol from the setting file corresponding to the application to be tested by calling the second component, and loading a corresponding setting page in the application to be tested based on the acquired first protocol.
In the above scheme, the apparatus further comprises:
the second loading unit is used for triggering the application to be tested to load a corresponding new page under the condition that the executed first operation is used for triggering the application to be tested to load the new page and the corresponding new page belongs to the first testing module; the first test module characterizes a current test module of the application under test.
In the above scheme, the apparatus further comprises:
the second processing unit is used for determining that the corresponding new page belongs to the first test module under the condition that the first attribute value of the corresponding new page belongs to the set attribute value set; the set attribute value set comprises a first attribute value of each page in at least one page corresponding to the first test module.
In the above solution, the first property value includes an Activity property value.
In the foregoing solution, the set test termination condition includes:
the time accumulated for testing the application under test reaches a first set threshold,
and/or the presence of a gas in the gas,
and accumulating the times of the first operation of the application to be tested to reach a second set threshold value.
An embodiment of the present application further provides a terminal, including: a processor and a memory for storing a computer program capable of running on the processor,
wherein, the processor is used for executing the steps of the application test method when the computer program is run.
The embodiment of the application also provides a storage medium, on which a computer program is stored, and the computer program realizes the steps of the application testing method when being executed by a processor.
In the embodiment of the application, under the condition that the application to be tested loads a page, a first control library corresponding to the current page is determined by calling a first component, wherein the first control library comprises at least one first control in the corresponding page; and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the tested application to load a new page, or until a set test ending condition is met. By executing the operation on the control of the current page, the invalid operation and the abnormal event in the application test process can be avoided, and the application test efficiency is improved.
Drawings
Fig. 1 is a schematic flowchart of an application testing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of an application testing method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of another application testing method provided in the application embodiment of the present application;
FIG. 4 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to provide a high-quality terminal use environment for a user, developers need to perform stability testing on an application program of a terminal to know the problem of necessary or occasional crash existing in the application program, so that the application program is repaired according to a stability testing result.
In the related technology, coordinates are randomly selected for an application program of a terminal through a Monkey tool, corresponding event operation is executed, a large number of invalid event operations are generated, even abnormal event operations such as network disconnection and shutdown can be caused, and the testing efficiency of the application program is not high.
Based on this, in various embodiments of the present application, in a case that a page is loaded by a tested application, a first control library corresponding to a current page is determined by calling a first component, where the first control library includes at least one first control in the corresponding page; and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the tested application to load a new page, or until a set test ending condition is met. By executing the operation on the control of the current page, the invalid operation and the abnormal event in the application test process can be avoided, and the application test efficiency is improved.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 1 is a schematic view of an implementation flow of an application testing method provided in an embodiment of the present application, where an execution subject may be a terminal, where the terminal includes but is not limited to an electronic device such as a mobile phone and a tablet. As shown in fig. 1, the application test method includes:
step 101: and under the condition that the page is loaded by the application to be tested, determining a first control library corresponding to the current page of the application to be tested by calling a first component.
The first control library comprises at least one first control in a corresponding page;
in this embodiment, when the application to be tested 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 set of controls corresponding to the current page, including at least one first control in the corresponding page.
Step 102: and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the application to be tested to load a new page, or until a set test ending condition is met.
Executing a first operation on any first control in a first control library, judging whether the executed first operation triggers the tested application to load a new page or whether the current test state meets the set end test condition, if the judgment result represents that the tested application cannot be triggered to load the new page and the current test state does not meet the set end test condition, executing the first operation on any first control in the first control library again, repeating the steps until the judgment result represents that the tested application triggers the tested application to load the new page, loading the new page, acquiring control information corresponding to the new page by calling the first component, and executing the first operation on any control of the new page again; or stopping the application test until the current test state meets the set test ending condition.
Here, the first operation performed on the first control may characterize an event operation, including but not limited to clicking, long-pressing, double-clicking, sliding, dragging, or inputting, etc. The loaded new page is another page different from the current page, where the new page may be a page already loaded in the application test process, for example, a control corresponding to a certain label is clicked in the page 1, the application to be tested is loaded from the page 1 to the page 2, then a control corresponding to the "return" label is clicked in the page 2, the application to be tested is loaded from the page 2 to the page 1, and when the page is loaded for the second time, the page 1 is the new page. And when the first operation is executed on any first control in the first control library, the mode of selecting any first control can be random, and the application is tested as comprehensively as possible in the test process by randomly selecting any first control of the current page to execute the first operation.
In the embodiment of the application, under the condition that the application to be tested loads a page, a first control library corresponding to the current page is determined by calling a first component, wherein the first control library comprises at least one first control in the corresponding page; and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the tested application to load a new page, or until a set test ending condition is met. By executing the operation on the control of the current page, the invalid operation and the abnormal event in the application test process can be avoided, and the application test efficiency is improved.
In order to perform the stability test on the setting page of the application to be tested, the user needs to jump to the setting page to start the test. The scheme protocol is an intra-page jump protocol, and a corresponding set page in a jump application can be realized by defining the scheme protocol. In the related technology, the scheme protocol is started through the adb shell am start command, so that the corresponding page is loaded in the application to be tested, but the adb shell command is truncated due to the fact that special characters usually exist in the scheme protocol, and the set page cannot be loaded normally. In an embodiment, the method further comprises:
and acquiring a first protocol from a setting file corresponding to the application to be tested by calling a second component, and loading a corresponding setting page in the application to be tested based on the acquired first protocol.
And acquiring the first protocol stored in the setting file from the setting file corresponding to the application to be tested by calling the second component, generating an Intent component based on the acquired first protocol, and loading a setting page corresponding to the first protocol in the application to be tested through the Intent component. Here, the setting file may be a file associated with the application under test for storing the first protocol. The first protocol may be a scheme protocol, where the set page is a page corresponding to the scheme protocol, and in the application, each scheme protocol can open a set page correspondingly. The Intent component can describe actions, action related data and additional data of one operation in the application, the Android can find the corresponding component according to the description of the Intent component, and the information of the Intent component is transmitted to the corresponding component, so that calling of the corresponding component is realized.
The first protocol is stored in a setting file, an Intent component is generated by reading the first protocol from the setting file, and a setting page corresponding to the first protocol is loaded in the application to be tested through the Intent component. Therefore, when the set page is loaded for stability test, the first protocol does not need to be started through the command line, the phenomena that the command is intercepted and the set page cannot be loaded due to special characters in the scheme protocol can be avoided, and the loading of the set page is ensured.
In an embodiment, the method further comprises:
under the condition that the executed first operation is used for triggering the tested application to load a new page and the corresponding new page belongs to the first test module, triggering the tested application to load the corresponding new page; the first test module characterizes a current test module of the application under test.
And under the condition that the executed first operation can be used for triggering the tested application to load a new page, judging whether the new page to be loaded belongs to the first test module, and under the condition that the corresponding new page belongs to the first test module, triggering the tested application to load the corresponding new page. Here, the first test module represents the current test module of the application under test, and may be set before the application test is performed, and the setting page of the first test module is loaded. The first test module may be a relatively independent program unit in the application program, each program unit performing and implementing a relatively independent software function.
The new page to be loaded is determined to be loaded by judging whether the new page belongs to the current test module or not, and the test of the set test module is realized.
In an embodiment, the method further comprises:
determining that the corresponding new page belongs to the first test module under the condition that the first attribute value of the corresponding new page belongs to the set attribute value set; the set attribute value set comprises a first attribute value of each page in at least one page corresponding to the first test module.
And when judging whether the corresponding new page belongs to the first test module, determining that the corresponding new page belongs to the first test module by judging whether the first attribute value of the new page belongs to the set attribute value set or not and under the condition that the judgment result represents that the first attribute value of the new page belongs to the set attribute value set. Here, the first testing module corresponds to at least one page, and the set of attribute values includes a first attribute value of each page corresponding to the first testing module. The determination of the set of attribute values may be obtained by reading from a file of the application to be tested before the test of the application to be tested is started.
And judging whether the new page belongs to the first test module or not by taking the attribute value information set of the page corresponding to the first test module as a judgment condition, and triggering and loading the corresponding new page only when the condition is met, so that whether the new page to be loaded belongs to the current test module or not can be judged, and a refined module of the current test module is tested.
In one embodiment, the first property value comprises an Activity property value.
Here, Activity is a component in a page that implements the interaction of a screen.
In practical application, when a user performs a stability test on an application under test, the user may input first test module information. For example, the first test module includes page a, page B, and page C, and the module information provided by the user is as follows: the name of the class of the Activity component of the page A is ActivinyNameA, the name of the class of the Activity component of the page B is ActivinyNameB, the name of the class of the Activity component of the page C is ActivinyNameC, and the set attribute value set corresponding to the first testing module comprises the ActivinyNameA, the ActivinyNameB and the ActivinyNameC. Acquiring component name ComponentName information of the new page through an Activities manager, obtaining the name of the class of the Activity component of the new page based on ComponentName.getClassName, and if the name of the class of the Activity component of the new page belongs to the set attribute value set, judging that the new page belongs to the first test module; otherwise, the new page is judged not to belong to the first test module.
In one embodiment, the set end test condition includes:
the time accumulated for testing the application under test reaches a first set threshold,
and/or the presence of a gas in the gas,
and accumulating the times of the first operation of the application to be tested to reach a second set threshold value.
Here, the set test termination condition may be a test time condition, a test frequency condition, a combination of the test time condition and the test frequency condition, or a combination of other test termination conditions, such as that the first operation has been executed by the first control of the set ratio of the page of the set ratio of the application program. When the test for the application to be tested meets the set test ending condition, the application to be tested ends the test and can output a corresponding test result.
In practice, any of the following may be used: the time for testing the application to be tested is accumulated to 1 hour; accumulating the times of the first operation of the application to be tested to 30000 times; the time for testing the application under test amounts to 1 hour and the number of first operations for the application under test amounts to 50000 times.
By setting the test termination condition, the first operation is not executed after the test termination condition is met, and the termination of the application test process is realized.
In the related art, in order to operate a control of an application program, a first control of a current page is generally acquired by a frame. For example, all controls of the current page can be acquired by installing an Appium environment and using an Appium frame; the UI automation script can be compiled by using a Robotium framework, which is an Android automation testing framework and provides an API for simulating various gesture operations (clicking, long pressing, sliding and the like), searching and asserting mechanisms, and various controls can be operated. However, the problems of low application testing efficiency exist because the environment needs to be installed, the test script needs to be written, the tested application needs to be re-signed, and the requirement on the programming skill of the user is high.
In an embodiment, the method is implemented based on the accessitivyservice.
Acquiring all control information of a current page through the AccessibilityService, executing a first operation on any first control at least once, judging whether the first operation triggers a new page, if so, loading the new page, or judging whether the new page belongs to a test module, and repeating the steps until a set test finishing condition is met. Therefore, by directly executing the corresponding jar file on the terminal, the operations of re-signing the application to be tested, Root and the like on the terminal are not needed, scripts are not needed, the requirement on the programming skill of the user is reduced, and the application testing efficiency is improved.
The present application will be described in further detail with reference to the following application examples.
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 demands of different users, mobile terminal systems are becoming more diversified. Under the same system, various kinds of software are provided for the user to select. In order to improve the terminal use experience of users, requirements for higher stability and robustness are provided for application programs loaded in the mobile terminal. Therefore, developers need to perform stability testing on the application program of the terminal to know the crash problem of the application program which is necessary or rare, so that the application program is repaired and improved according to the result of the stability testing.
In the related art, the Android system may be used to operate a command line tool of a terminal device, such as a mobile phone device or a simulator, through an Android Debug Bridge (ADB, Android Debug Bridge), call a Monkey tool of the Android system, and perform event operations such as clicking and dragging by randomly selecting coordinates to perform stability testing on an application program of the terminal. The Monkey is a command line tool carried by the Android system, and can run in a simulator or a terminal device. And the Monkey sends a pseudo-random user event stream to the system to realize the pressure test of the application program under development. Because the Monkey operation is very random and uncontrollable, the Monkey operation can be easily clicked to the outside of the page of the application program during the test period and can be clicked to the desktop or other invalid areas of the mobile terminal, and a large amount of invalid clicks are generated; even abnormal operations such as network disconnection, shutdown and the like may be caused, which affects the normal operation of the stability test, and the test efficiency of the application program is not high.
In addition, in order to meet the personalized requirements of users, the application program corresponds to a large number of pages and supports a large number of functions. Thus, an application may be divided into a number of relatively independent modules. A module refers to a number of relatively independent program units in an overall application, each of which performs and implements a relatively independent software function. Therefore, when only partial modules in the application program are changed in codes, the stability of the modules can be tested in a targeted mode, and the testing efficiency is improved within limited testing time. In the related art, the page of the module of the modified code cannot be accurately loaded, so that the module cannot be subjected to a refined stability test.
With reference to fig. 2, a method for testing global application testing of an application includes:
opening an application default page, acquiring information of all controls of the current page, randomly selecting any control from the information, executing operations such as clicking and dragging, repeatedly executing the operations on any control of the current page until the operations on the controls trigger loading of a new page, loading the new page, then acquiring information of all controls of the new page, and randomly selecting any control for operation. And repeating the steps until the set test finishing condition is met.
In the related art, a mode of randomly selecting coordinates for operation is adopted, and when the coordinates are randomly selected, areas where the selected coordinates are not clickable or operable exist, such as the areas of a desktop of a mobile terminal; when the selected coordinates are used for indicating the area for closing the network or shutting down the network, abnormal operations such as network disconnection and shutdown can be caused, the normal operation of the stability test is affected, and the test efficiency of the application program is not high. In the embodiment of the application, the controls on the page are randomly selected for operation, so that invalid operations and abnormal events can be reduced, and the stability testing efficiency is improved.
In order to perform the stability test on the setting page of the application to be tested, the user needs to jump to the setting page to start the test. The scheme protocol is an intra-page jump protocol, and a corresponding set page in a jump application can be realized by defining the scheme protocol. In the related art, the scheme protocol needs to be executed in a command processor, such as Bash. Bash is a command processor, usually running in a text window, that executes commands entered by the user. The Bash processor may perform special processing on some characters (e.g., commas, double quotation marks, etc.). If the original scheme protocol contains comma, double quotation marks and other characters, the command line is started by a Bash processor, and the scheme protocol is cut off or failed.
With reference to fig. 3, an application testing method for testing an application module includes:
and reading the Scheme protocol of the module and the Activity information of at least one page included in the module from the setting file, and loading the setting page according to the read Scheme protocol.
The page can be accurately loaded for testing according to the scheme protocol, so that the operation of irrelevant pages during testing is avoided, and the testing efficiency is improved; and storing the scheme protocol into a setting file, reading the scheme protocol from the setting file when the stability test is started, and starting a page. The problem that when special characters exist, the page is started through the command line and is cut off and invalid is solved.
Here, the scheme protocol may be stored in the setting file, and then the setting file may be loaded into the mobile terminal device through an adb push command. Therefore, during stability test, the scheme protocol of the mobile terminal is directly read, and the problems of truncation and invalidation in reading the scheme protocol in processors such as Bash and the like are solved.
And acquiring all control information of the current page through the accessitiveservice service, randomly selecting any control, clicking, dragging and the like, and judging whether the control operation can cause the tested application to be loaded into a new page. When the control operation can cause the tested application to load a new page, judging whether the Activity of the new page belongs to the test module page, if so, loading the new page, and acquiring the control information of the new page; if the test module does not belong to the test module page, staying at the current page to continue the test. And repeating the steps until the set test finishing condition is met.
And during the stability test, judging whether the page is opened or not according to whether the page belongs to the test module or not. Therefore, the precision test with the test module as the dimensionality can be realized, the page corresponding to the test module is tested, the operation of other invalid pages is reduced, and the efficiency is greatly improved. Therefore, the test module can be tested more fully in a shorter time.
In practical application, for example, a shopping process is displayed once, an icon of a certain commodity is clicked in a shopping cart page, a commodity detail page is triggered to be loaded, the shopping cart page belongs to a shopping cart module, the commodity detail page belongs to a merchant detail module, and a new page (the commodity detail page) does not belong to a test module (the shopping cart module), so that the new page stays on the shopping cart page to continue testing.
In the application embodiment of the application, the control information of the current page is obtained through the accessitivyservice service, and any one of the controls is randomly selected to perform the event operation, so that the simple and efficient mobile terminal application stability testing method is provided, the operations of re-signing the application to be tested, Root and the like on the terminal are not needed, the script writing is also not needed, the requirement on the user programming technology is reduced, and the application testing efficiency is improved. By acquiring the page control, clicking, dragging and other operations are performed on the page control, controllability is achieved, invalid clicks are greatly reduced, and testing efficiency is improved. Moreover, the project protocol is stored in the setting file, the project protocol is read from the setting file, the Intent component is generated, the stability test can be carried out on the appointed page, and the problem that the page starting is cut off due to the existence of special characters when the page is started through a command line is solved.
In order to implement the method according to the embodiment of the present application, an application testing apparatus is further provided in the embodiment of the present application, and as shown in fig. 4, the apparatus includes:
the first processing unit 401 is configured to determine, by calling a first component, a first control library corresponding to a current page of a tested application when the tested application loads the page; the first control library comprises at least one first control in a corresponding page;
an operation unit 402, configured to 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 termination condition is met.
Wherein, in one embodiment, the apparatus further comprises:
and the first loading unit is used for acquiring a first protocol from the setting file corresponding to the application to be tested by calling the second component, and loading a corresponding setting page in the application to be tested based on the acquired first protocol.
In one embodiment, the apparatus further comprises:
the second loading unit is used for triggering the application to be tested to load a corresponding new page under the condition that the executed first operation is used for triggering the application to be tested to load the new page and the corresponding new page belongs to the first testing module; the first test module characterizes a current test module of the application under test.
In one embodiment, the apparatus further comprises:
the second processing unit is used for determining that the corresponding new page belongs to the first test module under the condition that the first attribute value of the corresponding new page belongs to the set attribute value set; the set attribute value set comprises a first attribute value of each page in at least one page corresponding to the first test module.
In one embodiment, the first property value comprises an Activity property value.
In one embodiment, the set end test condition includes:
the time accumulated for testing the application under test reaches a first set threshold,
and/or the presence of a gas in the gas,
and accumulating the times of the first operation of the application to be tested to reach a second set threshold value.
In practical applications, the first Processing Unit 401, the operating Unit 402, the first loading Unit, the second loading Unit, and the second Processing Unit may be implemented by a Processor in an application test device, such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Micro Control Unit (MCU), or a Programmable Gate Array (FPGA).
It should be noted that: in the application test device provided in the above embodiment, only the division of the program modules is exemplified when performing the application test, and in practical applications, the processing distribution may be completed by different program modules according to needs, that is, the internal structure of the device may be divided into different program modules to complete all or part of the processing described above. In addition, the application testing apparatus and the application testing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
Based on the hardware implementation of the program module, and in order to implement the application testing method in the embodiment of the present application, an embodiment of the present application further provides a terminal, as shown in fig. 5, where the terminal 500 includes:
a communication interface 510 capable of information interaction with other devices such as network devices and the like;
and the processor 520 is connected with the communication interface 510 to realize information interaction with other devices, and is used for executing the method provided by one or more technical solutions when running a computer program. And the computer program is stored on the memory 530.
Specifically, the processor 520 is configured to:
under the condition that a page is loaded by an application to be tested, determining a first control library corresponding to the current page of the application to be tested by calling a first component; the first control library comprises at least one first control in a corresponding page;
and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the application to be tested to load a new page, or until a set test ending condition is met.
Wherein, in one embodiment, the processor 520 is configured to:
and acquiring a first protocol from a setting file corresponding to the application to be tested by calling a second component, and loading a corresponding setting page in the application to be tested based on the acquired first protocol.
In one embodiment, the processor 520 is configured to:
under the condition that the executed first operation is used for triggering the tested application to load a new page and the corresponding new page belongs to the first test module, triggering the tested application to load the corresponding new page; the first test module characterizes a current test module of the application under test.
In one embodiment, the processor 520 is configured to:
determining that the corresponding new page belongs to the first test module under the condition that the first attribute value of the corresponding new page belongs to the set attribute value set; the set attribute value set comprises a first attribute value of each page in at least one page corresponding to the first test module.
In one embodiment, the first property value comprises an Activity property value.
In one embodiment, the set end test condition includes:
the time accumulated for testing the application under test reaches a first set threshold,
and/or the presence of a gas in the gas,
and accumulating the times of the first operation of the application to be tested to reach a second set threshold value.
Of course, in practice, the various components in terminal 500 are coupled together by bus system 540. It is understood that the bus system 540 is used to enable communications among the components. The bus system 540 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 540 in fig. 5.
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 for operating on terminal 500.
It will be appreciated that the memory 530 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may 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 (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration 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), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 530 described in embodiments herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the embodiments of the present application may be applied to the processor 520, or implemented by the processor 520. Processor 520 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 520. The processor 520 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 520 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 530, and the processor 520 reads the program in the memory 530 and performs the steps of the aforementioned methods in conjunction with its hardware.
Optionally, when the processor 520 executes the program, the corresponding process implemented by the terminal in each method of the embodiment of the present application is implemented, and for brevity, no further description is given here.
In an exemplary embodiment, the present application further provides a storage medium, specifically a computer-readable storage medium, for example, a memory 530 storing a computer program, which can be executed by the processor 520 of the terminal to perform the steps of the foregoing method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The technical means described in the embodiments of the present application may be arbitrarily combined without conflict. Unless otherwise specified and limited, the term "coupled" is to be construed broadly, e.g., as meaning electrical connections, or as meaning communications between two elements, either directly or indirectly through intervening media, as well as the specific meanings of such terms as understood by those skilled in the art.
In addition, in the examples of the present application, "first", "second", and the like are used for distinguishing similar objects, and are not necessarily used for describing a specific order or a sequential order. It should be understood that "first \ second \ third" distinct objects may be interchanged under appropriate circumstances such that the embodiments of the application described herein may be implemented in an order other than those illustrated or described herein.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Various combinations of the specific features in the embodiments described in the detailed description may be made without contradiction, for example, different embodiments may be formed by different combinations of the specific features, and in order to avoid unnecessary repetition, various possible combinations of the specific features in the present application will not be described separately.

Claims (14)

1. An application testing method, the method comprising:
under the condition that a page is loaded by an application to be tested, determining a first control library corresponding to the current page of the application to be tested by calling a first component; the first control library comprises at least one first control in a corresponding page;
and executing a first operation on any first control in the first control library at least once until the executed first operation triggers the application to be tested to load a new page, or until a set test ending condition is met.
2. The method of claim 1, further comprising:
and acquiring a first protocol from a setting file corresponding to the application to be tested by calling a second component, and loading a corresponding setting page in the application to be tested based on the acquired first protocol.
3. The method of claim 1, further comprising:
under the condition that the executed first operation is used for triggering the tested application to load a new page and the corresponding new page belongs to the first test module, triggering the tested application to load the corresponding new page; the first test module characterizes a current test module of the application under test.
4. The method of claim 3, further comprising:
determining that the corresponding new page belongs to the first test module under the condition that the first attribute value of the corresponding new page belongs to the set attribute value set; the set attribute value set comprises a first attribute value of each page in at least one page corresponding to the first test module.
5. The method of claim 4, wherein the first property value comprises an Activity property value.
6. The method according to any one of claims 1 to 5, wherein the set end test condition comprises:
the time accumulated for testing the application under test reaches a first set threshold,
and/or the presence of a gas in the gas,
and accumulating the times of the first operation of the application to be tested to reach a second set threshold value.
7. An application testing apparatus, comprising:
the first processing unit is used for determining a first control library corresponding to the current page of the application to be tested by calling a first component under the condition that the page is loaded by the application to be tested; the first control library comprises at least one first control in a corresponding page;
and the operation unit is used for executing a first operation on any first control in the first control library at least once until the executed first operation triggers the application to be tested to load a new page, or until a set test ending condition is met.
8. The apparatus of claim 7, further comprising:
and the first loading unit is used for acquiring a first protocol from the setting file corresponding to the application to be tested by calling the second component, and loading a corresponding setting page in the application to be tested based on the acquired first protocol.
9. The apparatus of claim 7, further comprising:
the second loading unit is used for triggering the application to be tested to load a corresponding new page under the condition that the executed first operation is used for triggering the application to be tested to load the new page and the corresponding new page belongs to the first testing module; the first test module characterizes a current test module of the application under test.
10. The apparatus of claim 9, further comprising:
the second processing unit is used for determining that the corresponding new page belongs to the first test module under the condition that the first attribute value of the corresponding new page belongs to the set attribute value set; the set attribute value set comprises a first attribute value of each page in at least one page corresponding to the first test module.
11. The apparatus of claim 10, wherein the first property value comprises an Activity property value.
12. The apparatus according to any one of claims 7 to 11, wherein the set end test condition comprises:
the time accumulated for testing the application under test reaches a first set threshold,
and/or the presence of a gas in the gas,
and accumulating the times of the first operation of the application to be tested to reach a second set threshold value.
13. A terminal, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the application testing method of any one of claims 1 to 6 when running the computer program.
14. A storage medium on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the application testing method according to any one of claims 1 to 6.
CN202110932589.9A 2021-08-13 2021-08-13 Application testing method, device, terminal and storage medium Pending CN113485943A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110932589.9A CN113485943A (en) 2021-08-13 2021-08-13 Application testing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110932589.9A CN113485943A (en) 2021-08-13 2021-08-13 Application testing method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN113485943A true CN113485943A (en) 2021-10-08

Family

ID=77946597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110932589.9A Pending CN113485943A (en) 2021-08-13 2021-08-13 Application testing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN113485943A (en)

Similar Documents

Publication Publication Date Title
CN109284269B (en) Abnormal log analysis method and device, storage medium and server
KR101790190B1 (en) Application scenario identification method, power consumption management method, apparatus, and terminal device
US20130117855A1 (en) Apparatus for automatically inspecting security of applications and method thereof
CN103377120A (en) Test method and device for application programs
CN110162730B (en) Information processing method, information processing device, computer equipment and storage medium
CN112465466A (en) Flow task execution method and device, computer equipment and storage medium
CN107797922B (en) Application page testing method, electronic device and electronic equipment
CN112506854A (en) Method, device, equipment and medium for storing page template file and generating page
CN113127050A (en) Application resource packaging process monitoring method, device, equipment and medium
CN112817831A (en) Application performance monitoring method, device, computer system and readable storage medium
CN103049374A (en) Automatic testing method and device
CN114328250A (en) Automatic self-checking method, medium and device for software system
CN107436839B (en) Process load acquisition method, electronic terminal and computer readable storage medium
CN104133763A (en) Program debugging system and program debugging method
CN110045952B (en) Code calling method and device
US20230101154A1 (en) Resumable instruction generation
CN113485943A (en) Application testing method, device, terminal and storage medium
CN110677643A (en) Touch screen television, touch screen television testing method, device and medium
CN112650959A (en) Page loading duration statistical method, device, equipment and storage medium
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN108563578A (en) SDK compatibility detection method, device, equipment and readable storage medium storing program for executing
CN115904928A (en) Pile inserting method, device, equipment and storage medium for slow function monitoring
CN113765731A (en) Information processing method, device and computer readable storage medium
CN111221723A (en) Test record generation method and device, storage medium and electronic equipment
CN113779117A (en) Data monitoring method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination