CN114860569A - Application program automation test method, device, storage medium and program product - Google Patents

Application program automation test method, device, storage medium and program product Download PDF

Info

Publication number
CN114860569A
CN114860569A CN202210302698.7A CN202210302698A CN114860569A CN 114860569 A CN114860569 A CN 114860569A CN 202210302698 A CN202210302698 A CN 202210302698A CN 114860569 A CN114860569 A CN 114860569A
Authority
CN
China
Prior art keywords
page
application program
test
acquiring
testing
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
CN202210302698.7A
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.)
Shell Housing Network Beijing Information Technology Co Ltd
Original Assignee
Shell Housing Network Beijing 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 Shell Housing Network Beijing Information Technology Co Ltd filed Critical Shell Housing Network Beijing Information Technology Co Ltd
Priority to CN202210302698.7A priority Critical patent/CN114860569A/en
Publication of CN114860569A publication Critical patent/CN114860569A/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

Landscapes

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

Abstract

The embodiment of the invention provides an automatic test method, equipment, a storage medium and a program product of an application program, wherein the method comprises the following steps: acquiring a page routing address set of an application program of a current version to be tested; acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from a page routing address set; and opening the pages based on the preset number of page routing addresses to perform the current automatic test. According to the method, the device, the storage medium and the program product for automatically testing the application program, the page routing address set of the application program of the current version to be tested is obtained, the page routing addresses with the preset number and the minimum accumulated reading times in the previous test are obtained from the page routing address set, the page is opened based on the page routing addresses with the preset number for carrying out the current automatic test, the page coverage rate of the test can be effectively improved, the page traversal uniformity is enhanced, and the quality of the application program before version sending is ensured.

Description

Application program automation test method, device, storage medium and program product
Technical Field
The embodiment of the invention relates to the technical field of automatic testing, in particular to an automatic testing method, automatic testing equipment, an automatic testing storage medium and an automatic testing program product for an application program.
Background
Before release, an application program (APP) needs to be tested, and the APP can be released for use after the test is passed.
In the existing application program testing process, one mode is to test each page in a page jump mode. For example, jumping from one page to another by clicking a jump button. The test mode is easy to miss pages with deep levels, so that the coverage rate of the tested pages is low, and the quality of application programs before edition sending cannot be ensured.
Disclosure of Invention
In order to overcome the defects in the prior art, embodiments of the present invention provide an application program automation test method, device, storage medium, and program product.
The embodiment of the invention provides an automatic testing method of an application program, which comprises the following steps: acquiring a page routing address set of an application program of a current version to be tested; acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from the page routing address set; and opening pages based on the preset number of page routing addresses to perform the current automatic test.
According to the method for automatically testing the application program, which is provided by the embodiment of the invention, the opening of the page based on the preset number of page routing addresses for performing the current automatic test comprises the following steps: and reading the page routing addresses according to the sequence of the accumulated reading times from small to large, and acquiring and opening the corresponding page according to the page routing addresses to perform current automatic test.
According to the automatic testing method for the application program, provided by the embodiment of the invention, the preset number is less than or equal to the rated page amount of a single automatic test.
According to the automatic testing method for the application program provided by the embodiment of the invention, the method further comprises the following steps: and after reading the page routing address, adding 1 to the accumulated reading times of the page routing address.
According to the automatic testing method for the application program provided by the embodiment of the invention, the method further comprises the following steps: recording the page information of the opened page to a page database; the page database records the page information of a page opened by the application program of the current version since the initial test, wherein the page information comprises a page name, application program information and version information.
According to the automatic testing method for the application program provided by the embodiment of the invention, the method further comprises the following steps: acquiring the number of first pages of different pages opened by the application program of the current version since the initial test according to the page information; acquiring the total second page number of the application program of the current version; acquiring a first page coverage rate according to the ratio of the first page quantity to the second page quantity; wherein the first page coverage rate is used for describing the page coverage condition of the application program of the current version since the first test.
According to the automatic testing method for the application program provided by the embodiment of the invention, the method further comprises the following steps: recording the number of third pages of different pages opened by the current test task; acquiring a second page coverage rate according to the ratio of the third page quantity to the second page quantity; and the second page coverage rate is used for describing the page coverage condition of the current version of the application program tested at the time.
According to the method for automatically testing the application program, which is provided by the embodiment of the invention, the opening of the page based on the preset number of page routing addresses for performing the current automatic test comprises the following steps: based on the priority attribute of the page routing address, acquiring the page routing address meeting the priority attribute from the preset number of page routing addresses, and acquiring and opening the page according to the page routing address meeting the priority attribute for performing the current automatic test.
According to the automatic testing method for the application program provided by the embodiment of the invention, the priority attribute comprises weighted priority, the weighted priority is a weighted result of a preset priority factor, and the preset priority factor comprises at least one of equipment priority, service priority and importance priority.
The embodiment of the present invention further provides an automatic testing apparatus for an application program, including: a first obtaining module to: acquiring a page routing address set of an application program of a current version to be tested; a second obtaining module to: acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from the page routing address set; a test module to: and opening pages based on the preset number of page routing addresses to perform the current automatic test.
The embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the program, the steps of any one of the above-mentioned application program automated testing methods are implemented.
Embodiments of the present invention further provide a non-transitory computer readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned methods for automated testing of an application program.
The embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the above methods for automatically testing an application program are implemented.
According to the method, the device, the storage medium and the program product for automatically testing the application program, the page routing address set of the application program of the current version to be tested is obtained, the page routing addresses of the preset number with the minimum cumulative reading times in the previous test are obtained from the page routing address set, the page is opened based on the page routing addresses of the preset number for carrying out the current automatic test, the page coverage rate of the test can be effectively improved, the page traversal uniformity is enhanced, and the quality of the application program before version sending is ensured.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 is a flowchart illustrating an application automation test method according to an embodiment of the present invention;
FIG. 2 is a second flowchart illustrating an automated application testing method according to an embodiment of the present invention;
FIG. 3 is a third schematic flowchart of an automated testing method for an application according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for automated testing of application programs according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart of an application automation test method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
and step S1, acquiring a page routing address set of the application program of the current version to be tested.
And after the test task starts, acquiring package information, such as package names, versions and the like, of the application programs to be tested. And acquiring a page routing address set of the application program of the current version to be tested according to the package information of the application program to be tested. The page routing address may be represented by a schema, and the set of page routing addresses of the current version of the application to be tested may be obtained by reading a local schema document of the device running the main test program.
And step S2, obtaining the preset number of page routing addresses with the minimum cumulative reading times in all tests from the page routing address set.
And opening the corresponding page for testing according to the page routing address. Compared with the mode of jumping pages, the method can improve the page coverage rate by opening the corresponding page according to the page routing address for testing. In particular implementations, however, the inventors have discovered that if each automated test is performed by traversing the schema document, then the first few page routing addresses of the schema document are traversed each time, and coverage is not removed.
Therefore, attributes such as attributes including version, APP, cumulative number of reads, and the like are set for the page routing address. The cumulative number of reads for the past tests of the page routing address may reflect the number of tests for the corresponding page. For example, if the cumulative number of reads of a certain page routing address from previous tests is 0, it indicates that the page corresponding to the page routing address has not been tested yet. Wherein, the past test refers to the automatic test of the application program of the current version before the current test.
In order to improve the page coverage rate, preset page routing addresses with the minimum number of the past test accumulated reading times are obtained from the page routing address set, and testing is carried out according to the preset page routing addresses with the minimum number of the past test accumulated reading times. For example, the preset number may be set to 200. The page reason addresses with the same reading times are counted.
And step S3, opening the page based on the preset number of page routing addresses to perform the current automatic test.
The automatic testing can be performed on the current time by opening pages (Activity) according to the preset number of page routing addresses in sequence according to the set sequence. When testing, a third-party testing tool (such as a monkey testing tool) can be used for testing. The monkey test is a purposeless random press test, and the monkey test can find a lot of good bugs at the early stage of the product cycle, so that a user can save a lot of time.
The test main program can be run on the device provided with the application program to be tested, and the test main program directly controls to open the page of the local application program for testing. The test main program can also run on other equipment, and the equipment provided with the application program to be tested is controlled by the instruction to open the page of the application program for testing. The test can be performed by means of a test tool, such as a monkey test tool. If the monkey test tool is used for testing, the device provided with the application program to be tested needs to log in the monkey test tool during testing.
According to the automatic testing method for the application program, the page routing address set of the application program of the current version to be tested is obtained, the page routing addresses with the preset number and the minimum accumulated reading times in the previous testing are obtained from the page routing address set, the page is opened based on the page routing addresses with the preset number for the current automatic testing, the page coverage rate of the testing can be effectively improved, the page traversal uniformity is enhanced, and the quality of the application program before version sending is improved.
According to the method for automatically testing the application program, which is provided by the embodiment of the invention, the opening of the page based on the preset number of page routing addresses for performing the current automatic test comprises the following steps: and reading the page routing addresses according to the sequence of the accumulated reading times from small to large, and acquiring and opening the corresponding page according to the page routing addresses to perform current automatic test.
The time of single automatic test is limited, for example, each automatic task is about 45-60 minutes, in order to ensure that a page corresponding to a page routing address with a small reading frequency can be tested, when a page is opened based on a preset number of page routing addresses to perform current automatic test, the page routing addresses are read according to the sequence of the accumulated reading frequency from small to large, and the corresponding page is obtained and opened according to the page routing address to perform current automatic test.
Therefore, if the preset number is larger than the rated page amount of single automatic test, the page with less test times can be guaranteed to be tested preferentially. The rated page amount refers to the maximum page amount which can be tested by a single automatic test, and the rated page amount is related to the processing capacity of the automatic test device and the time length of the single test.
According to the automatic testing method for the application program, the page routing addresses are read in the order of the accumulated reading times from small to large, the corresponding pages are obtained and opened according to the page routing addresses for the current automatic testing, and the page coverage rate is favorably further improved.
According to the automatic testing method for the application program, provided by the embodiment of the invention, the preset number is less than or equal to the rated page amount of a single automatic test.
The nominal page amount may be determined empirically or by calculation after a single test duration is determined. In order to ensure that all the tests on the pages corresponding to the preset number of page routing addresses can be completed during the secondary test, the preset number of pages can be set to be less than or equal to the rated page quantity of the single automatic test.
When the preset number is less than or equal to the rated page quantity of the single automatic test, the pages corresponding to the preset number of page routing addresses can be tested completely, so that strict regulation on the test sequence is not required. For example, a preset number of page routing addresses may be stored in one list, and only the page routing addresses in the list need to be read in sequence, and the page routing addresses do not need to be read after being sorted according to the reading times.
According to the automatic testing method for the application program, provided by the embodiment of the invention, the preset number is less than or equal to the rated page quantity of the single automatic test, so that the complete test of the pages corresponding to the preset number of page routing addresses in the current test can be ensured, the reading sequence of the page routing addresses does not need to be specified, and the processing time is favorably saved.
According to the automatic testing method for the application program provided by the embodiment of the invention, the method further comprises the following steps: and after reading the page routing address, adding 1 to the accumulated reading times of the page routing address.
Reading the page routing address can open the corresponding page for testing. And after the page routing address is read, adding 1 to the accumulated reading times of the page routing address. The cumulative number of reads of the page routing address may be stored locally on the device running the test main program or in a database on the server. If the accumulated reading times are stored in the database on the server, the page routing address set needs to be sent to the server for storage, and the accumulated reading times can be recorded corresponding to the page routing address.
According to the automatic testing method for the application program, provided by the embodiment of the invention, after the page routing address is read, the accumulated reading times of the page routing address is added by 1, so that the real-time updating of the accumulated reading times is realized, and the correct judgment on the reading times in the subsequent testing is ensured.
According to the automatic testing method for the application program provided by the embodiment of the invention, the method further comprises the following steps: recording the page information of the opened page to a page database; the page database records the page information of a page opened by the application program of the current version since the initial test, wherein the page information comprises a page name, application program information and version information.
The page routing addresses do not necessarily have a one-to-one correspondence with pages, and multiple page routing addresses may be for the same page. Therefore, the page coverage rate needs to be calculated according to the tested page.
And opening the pages based on the preset number of page routing addresses for the current automatic test, and recording the page information of the opened pages to a page database. The page database records page information of the page opened by the application program of the current version since the initial test, wherein the page information includes the initial test to the current time since the initial test. The page information includes a page name, application information, and version information. The application information may be, for example, a package name of the application. The page information may uniquely identify a certain page of a certain version of the application.
The page information of the opened page can be recorded to the page database by starting the heartbeat thread. If the page is found to be recorded according to the page information, the recording can not be repeated.
According to the automatic testing method for the application program, provided by the embodiment of the invention, the page information of the opened page is recorded to the page database, so that a premise is provided for calculating the page coverage rate.
According to the automatic testing method for the application program provided by the embodiment of the invention, the method further comprises the following steps: acquiring the number of first pages of different pages opened by the application program of the current version since the initial test according to the page information; acquiring the total second page number of the application program of the current version; acquiring a first page coverage rate according to the ratio of the first page quantity to the second page quantity; wherein the first page coverage rate is used for describing the page coverage condition of the current version of the application program since the initial test.
The first page coverage rate is used for describing the page coverage condition of the application program of the current version since the initial test, and can be calculated in real time or after the current test is finished.
The page information includes a page name, version information, and application information. The pages may be distinguished according to the page information. If deduplication has been performed during page information storage, that is, repeated pages are not recorded, a first number of pages of the application program of the current version may be obtained by reading page information of the corresponding version and the corresponding application program, where the first number of pages represents the number of pages that the application program of the current version has been opened since the initial test, that is, the number of pages that have been tested. Currently, if the page information in the page database is repeated, the duplicate removal processing needs to be performed first.
And acquiring the total second page number of the application program of the current version. The total second page count for the current version of the application is known, such as by being obtained from a third party device via an interface.
The first page coverage may be a ratio of the first page number and the second page number, and represents a page coverage of the current version of the application since the initial test.
According to the automatic testing method for the application program, the number of the first pages of different pages opened by the application program of the current version since the initial test is obtained according to the page information, the total number of the second pages of the application program of the current version is obtained, and the first page coverage rate is obtained according to the ratio of the number of the first pages to the number of the second pages, so that the page coverage rate of the application program of the current version in the total testing process is evaluated.
According to the automatic testing method of the application program provided by the embodiment of the invention, the method further comprises the following steps: recording the number of third pages of different pages opened by the current test task; acquiring a second page coverage rate according to the ratio of the third page quantity to the second page quantity; and the second page coverage rate is used for describing the page coverage condition of the current version of the application program tested at the time.
And recording the third page number of the page opened by the secondary test task, wherein the page when the third page number is calculated should be non-repeated. The current test task can be identified by time information or a sequence number, and the judgment of the page opened by the current test task is realized.
The second coverage rate may be a ratio of the third page number to the second page number, and is used to describe a page coverage condition of the current version of the application program in the current test.
According to the automatic testing method for the application program, provided by the embodiment of the invention, the page coverage rate of the current version of the application program in the current testing process is evaluated by recording the third page number of different pages opened by the current testing task and acquiring the second page coverage rate according to the ratio of the third page number to the second page number.
According to the method for automatically testing the application program, which is provided by the embodiment of the invention, the opening of the page based on the preset number of page routing addresses for performing the current automatic test comprises the following steps: and acquiring and opening pages from the pages corresponding to the preset number of page routing addresses based on the priority attributes of the page routing addresses for performing the current automatic test.
According to the purpose of testing, the range of the tested page can be further reduced on the basis of the page corresponding to the preset number of page routing addresses. For example, the new house detail page modification task can only select the page routing address corresponding to the new house service page for reading, and the regression test can select all the strategies with high service priority, so as to ensure that the main scene reaches the release standard.
Therefore, the priority attribute of the page routing address can be set, and different priority attributes can be set according to different test requirements. During testing, based on the priority attribute of the page routing address, the page routing address meeting the priority attribute is obtained from the preset number of page routing addresses, and the page is obtained and opened for current automatic testing according to the page routing address meeting the priority attribute.
Of course, if the premise of improving the page coverage is not considered, the page can be acquired and opened for the current automated test according to the priority attribute of the page routing address on the basis of the page routing address set.
According to the automatic testing method for the application program, provided by the embodiment of the invention, the page routing addresses meeting the priority attribute are obtained from the preset number of page routing addresses based on the priority attribute of the page routing addresses, and the pages are obtained and opened for the current automatic testing according to the page routing addresses meeting the priority attribute, so that the optimal page traversal strategy can be adopted in different stages in a customized manner, different testing requirements are further met, and the testing flexibility is improved.
According to the automatic testing method for the application program provided by the embodiment of the invention, the priority attribute comprises weighted priority, the weighted priority is a weighted result of a preset priority factor, and the preset priority factor comprises at least one of equipment priority, service priority and importance priority.
If the page to be tested needs to be determined by considering various factors during testing, the priority attribute can be set as a weighted priority, and the weighted priority is a weighted result of the preset priority factor. The number of the preset priority factors can be multiple, each priority factor obtains a weighted priority through weighted summation, and the weight of each priority factor can be set according to requirements. For example, the pre-set priority factor may include at least one of a device priority, a traffic priority, and an importance priority.
Taking the test of the application program of the mobile terminal as an example, the application program can be tested on different mobile terminal devices, such as mobile terminal devices of different brands and models. The method can be used for testing only a page which is not tested by certain mobile terminal equipment in a certain test, and can set the priority of the equipment, wherein if the page corresponding to the page routing address is tested on the current equipment, the priority of the equipment can be set to 0, otherwise, the priority of the equipment is set to 1.
The service priority is used for identifying the service related to the page corresponding to the page routing address, and can be used for screening the page routing address when testing according to the service line.
The importance priority is used for identifying the importance degree of the page corresponding to the page routing address, and can be used for screening the page routing address when testing according to the importance degree of the page.
If multiple factors need to be considered, such as the above three factors, the weight can be set for each preset priority factor, the weighted priority is obtained through weighted summation, the page routing address to be read is obtained according to the weighted priority, and the corresponding page is tested.
According to the automatic testing method for the application program, provided by the embodiment of the invention, the screening of the page routing address during testing based on various factors is realized by setting the priority attribute of the page routing address to comprise the weighted priority.
Fig. 2 is a second schematic flowchart of an automated testing method for an application according to an embodiment of the present invention. As shown in fig. 2, taking a test on a mobile end device (device) as an example, a main program runs on an automatic test apparatus running an automatic test program, and the mobile end device is connected to the automatic test apparatus. The triggering mode of the automated test may include a timing triggering mode (e.g., triggering according to a certain time interval), a stuck point triggering mode (e.g., triggering at each integral point), a manual triggering mode, and the like. And the main process running in the automatic testing device reads the configuration and carries out a corresponding testing process. After the automated testing process is started, the UI thread of the mobile terminal device performs UI operations such as login monkey and opening an application (u 2). Automated testing is performed by multithreading. And the monkey testing tool running on the mobile terminal device tests the opened page. The schema thread running on the automatic testing device is used for calculating and storing the accumulated reading times, and the heartbeat thread running on the automatic testing device is used for recording the page. After the test is finished, the test log can be analyzed, and a test report is generated and distributed. The test log may include the number of crashes (crashes), etc., and duplicate information may be removed.
Fig. 3 is a third schematic flowchart of an automated testing method for an application according to an embodiment of the present invention. As shown in fig. 3, taking an example of an application test on a mobile device (device) and storing related data in a server as an example, the method includes:
(1) acquiring package information of the current APP after the automatic test task starts: package name, version, etc.
(2) Reading all schemas (page routing addresses) of the current APP by a main process (main), sending the schema association version and APP information post-post to an API (application programming interface) of the server, and storing the schemas in a schema Table database of the server.
(3) And entering an automatic testing process, and starting the application program to be tested and the testing tool monkey by the mobile terminal equipment. And the thread for reading the schema list of the main program obtains the page routing address with the preset number and the minimum accumulated reading times in the past test by reading the schema list.
(4) After the monkey process is started and a schema is opened every time, a record schema thread of the main program sends the schema to the server through the API, and the server adds 1 to the read _ time (accumulated reading times) attribute of the schema; and recording the page by recording the page thread (heartbeat thread), sending the page information to the server by the API, judging whether the page is repeated or not by the server according to the page information, and recording the non-repeated page into a page information database (Activity Table).
(5) After the task is finished, the page coverage calculation thread reads the number of the pages of the current APP version as the numerator of the version coverage (first page coverage) through the page information database, reads the total number of the pages of the current APP from other devices as the denominator of the version coverage, and calculates the version coverage as the number of the pages traversed by the current version/the total number of the pages of the current APP.
It will be appreciated that the record of the cumulative number of readings and page information need not be stored by the server, but may be implemented locally on the device running the test main program.
The automatic testing method of the application program provided by the embodiment of the invention is suitable for improving the version coverage rate of the automatic related test of the APP with more pages so as to ensure the quality before version release.
It should be noted that, on the premise that logics or structures of a plurality of preferred embodiments provided in this embodiment do not conflict with each other, the preferred embodiments may be freely combined, and the present invention is not limited to this.
The following describes the automatic testing apparatus for an application according to an embodiment of the present invention, and the automatic testing apparatus for an application described below and the automatic testing method for an application described above may be referred to correspondingly.
Fig. 4 is a schematic structural diagram of an application automation test apparatus according to an embodiment of the present invention. As shown in fig. 4, the apparatus includes a first acquisition module 10, a second acquisition module 20, and a test module 30, wherein: the first obtaining module 10 is configured to: acquiring a page routing address set of an application program of a current version to be tested; the second obtaining module 20 is configured to: acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from the page routing address set; the test module 30 is used for: and opening pages based on the preset number of page routing addresses to perform the current automatic test.
According to the automatic testing device for the application program, provided by the embodiment of the invention, the page routing address set of the application program of the current version to be tested is obtained, the page routing addresses with the preset number and the minimum accumulated reading times in the previous test are obtained from the page routing address set, and the page is opened based on the page routing addresses with the preset number for carrying out the current automatic test, so that the page coverage rate of the test can be effectively improved, the page traversal uniformity is enhanced, and the quality of the application program before version sending is improved.
According to the automatic testing device for the application program provided by the embodiment of the present invention, when the testing module 30 is used for opening pages based on the preset number of page routing addresses to perform the current automatic testing, the testing module is specifically configured to: and reading the page routing addresses according to the sequence of the accumulated reading times from small to large, and acquiring and opening the corresponding page according to the page routing addresses to perform current automatic test.
The automatic testing device for the application program reads the page routing addresses according to the accumulated reading times in the order from less to more, acquires and opens the corresponding page according to the page routing addresses for the current automatic testing, and is favorable for further improving the page coverage rate.
According to the automatic testing device for the application program, provided by the embodiment of the invention, the preset number is less than or equal to the rated page amount of a single automatic test.
According to the automatic testing device for the application program, provided by the embodiment of the invention, the preset number is less than or equal to the rated page quantity of the single automatic test, so that the complete test of the pages corresponding to the preset number of page routing addresses in the current test can be ensured, the reading sequence of the page routing addresses does not need to be specified, and the processing time is favorably saved.
According to an embodiment of the present invention, the test module 30 is further configured to: and after reading the page routing address, adding 1 to the accumulated reading times of the page routing address.
According to the automatic testing device for the application program, provided by the embodiment of the invention, after the page routing address is read, the accumulated reading times of the page routing address is added by 1, so that the real-time updating of the accumulated reading times is realized, and the correct judgment of the reading times in the subsequent testing is ensured.
According to an embodiment of the present invention, the test module 30 is further configured to: recording the page information of the opened page to a page database; the page database records the page information of a page opened by the application program of the current version since the initial test, wherein the page information comprises a page name, application program information and version information.
The automatic testing device for the application program, provided by the embodiment of the invention, provides a premise for calculating the page coverage rate by recording the page information of the opened page to the page database.
According to an embodiment of the present invention, the test module 30 is further configured to: acquiring the number of first pages of different pages opened by the application program of the current version since the initial test according to the page information; acquiring the total second page number of the application program of the current version; acquiring a first page coverage rate according to the ratio of the first page quantity to the second page quantity; wherein the first page coverage rate is used for describing the page coverage condition of the current version of the application program since the initial test.
According to the automatic testing device for the application program, provided by the embodiment of the invention, the total second page number of the application program of the current version is obtained by obtaining the first page number of different pages opened by the application program of the current version since the initial test according to the page information, and the first page coverage rate is obtained according to the ratio of the first page number to the second page number, so that the evaluation of the page coverage rate of the application program of the current version in the total testing process is realized.
According to an embodiment of the present invention, the test module 30 is further configured to: recording the number of third pages of different pages opened by the current test task; acquiring a second page coverage rate according to the ratio of the third page quantity to the second page quantity; and the second page coverage rate is used for describing the page coverage condition of the current version of the application program in the current test.
According to the automatic testing device for the application program, provided by the embodiment of the invention, the page coverage rate of the current version of the application program in the current testing process is evaluated by recording the third page number of different pages opened by the current testing task and acquiring the second page coverage rate according to the ratio of the third page number to the second page number.
According to the automatic testing device for the application program provided by the embodiment of the present invention, when the testing module 30 is used for opening pages based on the preset number of page routing addresses to perform the current automatic testing, the testing module is specifically configured to: based on the priority attribute of the page routing address, acquiring the page routing address meeting the priority attribute from the preset number of page routing addresses, and acquiring and opening the page according to the page routing address meeting the priority attribute for performing the current automatic test.
According to the automatic testing device for the application program, provided by the embodiment of the invention, the page routing addresses meeting the priority attributes are obtained from the preset number of page routing addresses based on the priority attributes of the page routing addresses, and the pages are obtained and opened for the current automatic test according to the page routing addresses meeting the priority attributes, so that the optimal page traversal strategies can be customized for different stages, different testing requirements are further met, and the testing flexibility is improved.
According to the automatic testing device for the application program provided by the embodiment of the invention, the priority attribute comprises weighted priority, the weighted priority is a weighted result of a preset priority factor, and the preset priority factor comprises at least one of equipment priority, service priority and importance priority.
According to the automatic testing device for the application program, provided by the embodiment of the invention, the screening of the page routing address during testing based on various factors is realized by setting the priority attribute of the page routing address to comprise the weighted priority.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device may include: a processor (processor)610, a communication Interface (Communications Interface)620, a memory (memory)630 and a communication bus 640, wherein the processor 610, the communication Interface 620 and the memory 630 communicate with each other via the communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform an application automation test method comprising: acquiring a page routing address set of an application program of a current version to be tested; acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from the page routing address set; and opening pages based on the preset number of page routing addresses to perform the current automatic test.
In addition, the logic instructions in the memory 630 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes 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 steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, the computer program may be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is capable of executing the method for automatically testing an application program provided by the above methods, where the method includes: acquiring a page routing address set of an application program of a current version to be tested; acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from the page routing address set; and opening pages based on the preset number of page routing addresses to perform the current automatic test.
In yet another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform an application automation testing method provided by the above methods when executed by a processor, and the method includes: acquiring a page routing address set of an application program of a current version to be tested; acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from the page routing address set; and opening pages based on the preset number of page routing addresses to perform the current automatic test.
The above-described embodiments of the apparatus are merely illustrative, and 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, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. An automated application testing method, comprising:
acquiring a page routing address set of an application program of a current version to be tested;
acquiring preset page routing addresses with the minimum number of accumulated reading times of previous tests from the page routing address set;
and opening pages based on the preset number of page routing addresses to perform the current automatic test.
2. The method for automatically testing the application program according to claim 1, wherein the opening of the page based on the preset number of page routing addresses for the current automatic test comprises:
and reading the page routing addresses according to the sequence of the accumulated reading times from small to large, and acquiring and opening the corresponding page according to the page routing addresses to perform current automatic test.
3. The method according to claim 1, wherein the predetermined number is less than or equal to a nominal page count for a single automated test.
4. The method for automated testing of applications according to claim 2 or 3, further comprising:
and after reading the page routing address, adding 1 to the accumulated reading times of the page routing address.
5. The method for automated testing of applications of claim 1, further comprising:
recording the page information of the opened page to a page database; the page database records the page information of a page opened by the application program of the current version since the initial test, wherein the page information comprises a page name, application program information and version information.
6. The method for automated testing of applications of claim 5, further comprising:
acquiring the number of first pages of different pages opened by the application program of the current version since the initial test according to the page information;
acquiring the total second page number of the application program of the current version;
acquiring a first page coverage rate according to the ratio of the first page quantity to the second page quantity; wherein the first page coverage rate is used for describing the page coverage condition of the current version of the application program since the initial test.
7. The method for automated testing of applications of claim 6, further comprising:
recording the number of third pages of different pages opened by the current test task;
acquiring a second page coverage rate according to the ratio of the third page quantity to the second page quantity; and the second page coverage rate is used for describing the page coverage condition of the current version of the application program tested at the time.
8. The method for automatically testing the application program according to claim 1, wherein the opening of the page based on the preset number of page routing addresses for the current automatic test comprises:
based on the priority attribute of the page routing address, acquiring the page routing address meeting the priority attribute from the preset number of page routing addresses, and acquiring and opening the page according to the page routing address meeting the priority attribute for performing the current automatic test.
9. The method of claim 8, wherein the priority attributes comprise weighted priorities, the weighted priorities being weighted results of pre-set priority factors, the pre-set priority factors comprising at least one of device priority, traffic priority, and importance priority.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method for automated testing of an application program according to any of claims 1 to 9 are implemented when the program is executed by the processor.
11. A non-transitory computer readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the application program automation testing method according to any one of claims 1 to 9.
12. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method for automated testing of an application according to any one of claims 1 to 9.
CN202210302698.7A 2022-03-24 2022-03-24 Application program automation test method, device, storage medium and program product Pending CN114860569A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210302698.7A CN114860569A (en) 2022-03-24 2022-03-24 Application program automation test method, device, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210302698.7A CN114860569A (en) 2022-03-24 2022-03-24 Application program automation test method, device, storage medium and program product

Publications (1)

Publication Number Publication Date
CN114860569A true CN114860569A (en) 2022-08-05

Family

ID=82628999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210302698.7A Pending CN114860569A (en) 2022-03-24 2022-03-24 Application program automation test method, device, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114860569A (en)

Similar Documents

Publication Publication Date Title
CN106888060B (en) Anti-interference test method and system for wireless communication module
CN111159031B (en) Method for automatically testing application mobile terminal, computer device and computer readable storage medium
CN105068935B (en) Method and device for processing software test result
CN105426310A (en) Method and apparatus for detecting performance of target process
CN111835790B (en) Risk identification method, device and system
CN105487970B (en) A kind of method for showing interface and device
CN101246444B (en) Module testing method and system
CN104427547A (en) Business and network association test method, device and system
CN110019067A (en) A kind of log analysis method and system
CN112269697A (en) Equipment storage performance testing method, system and related device
CN109857643A (en) A kind of method and device of virtual platform performance automatic test
CN112748990A (en) Quartz-based data quality task execution method and device and computer equipment
CN114329452A (en) Abnormal behavior detection method and device and related equipment
CN110047560A (en) A kind of protokaryon transcript profile automated analysis method based on the sequencing of two generations
CN107656849B (en) Method and device for positioning performance problem of software system
CN114860569A (en) Application program automation test method, device, storage medium and program product
CN115686984B (en) Board card function testing method and device, computer and readable storage medium
CN115934568A (en) Method and related device for automatically testing performance of exported file
CN112084108A (en) Test script generation method and device and related components
CN114500348B (en) CDN gateway testing method and system
CN107222368B (en) Data playback method and device
CN113238901B (en) Multi-device automatic testing method and device, storage medium and computer device
CN111367820B (en) Sequencing method and device for test cases
CN112948276A (en) Fuzzy test method and device and electronic equipment
CN114676043A (en) Testing method and device of intelligent voice module, storage medium and electronic device

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