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

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

Info

Publication number
CN113971123A
CN113971123A CN202010728003.2A CN202010728003A CN113971123A CN 113971123 A CN113971123 A CN 113971123A CN 202010728003 A CN202010728003 A CN 202010728003A CN 113971123 A CN113971123 A CN 113971123A
Authority
CN
China
Prior art keywords
page
content
target page
test
application
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
CN202010728003.2A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010728003.2A priority Critical patent/CN113971123A/en
Publication of CN113971123A publication Critical patent/CN113971123A/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides an application program testing method, an application program testing device, a testing terminal and a storage medium, and relates to the technical field of application program development. The method comprises the following steps: intercepting a first network request; determining a test case corresponding to the first network request according to the first network request; acquiring page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request; acquiring at least one target page element in the first application page according to the page data; according to the element identification of the target page element, determining second check content corresponding to the target page element from the first check content; and checking the target page element according to the second checking content to obtain a test result of the target page element. Therefore, the testing personnel do not need to compare the played back picture with the recorded picture, and the accuracy of software testing is improved.

Description

Application program testing method and device, testing terminal and storage medium
Technical Field
The present disclosure relates to the field of application development technologies, and in particular, to an application testing method, an application testing device, a testing terminal, and a storage medium.
Background
In the process of developing the application program, the application program testing becomes an important link in the development process. In particular, after some functions of an application are updated, in order to ensure that the functions updated to the application do not affect the functions not updated in the application, it is often necessary to perform a regression test on the functions not updated in the application.
In the related art, a test case is obtained by recording an operation of a user and a first display picture corresponding to the operation, and then the test case is played back, and a tester judges whether a second display picture in the playback process is the same as the first display picture in the recording process, so that the test of an application program is completed.
In the testing process, the obtained second display picture is compared with the recorded first display picture by a tester to obtain a testing result, so that the testing result of the application program is influenced by subjective factors of the tester, and the testing result is inaccurate.
Disclosure of Invention
The embodiment of the disclosure provides an application program testing method, an application program testing device, a testing terminal and a storage medium, which can improve the accuracy of application program testing. The technical scheme is as follows:
in one aspect, an application program testing method is provided, and the method includes:
intercepting a first network request;
determining a test case corresponding to the first network request according to the first network request;
acquiring page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request;
acquiring at least one target page element in the first application page according to the page data;
according to the element identification of the target page element, determining second check content corresponding to the target page element from the first check content;
and checking the target page element according to the second checking content to obtain a test result of the target page element.
In one possible implementation, the second check-up content includes first element content of the target page element; the verifying the target page element according to the second verification content to obtain a test result of the target page element includes:
determining an element category of the target page element;
according to the element category, identifying second element content of the target page element from the target page element;
and verifying the target page element according to the first element content and the second element content until the test result is obtained.
In another possible implementation manner, the identifying, from the target page element according to the element category, second element content of the target page element includes at least one of the following manners:
in response to the fact that the element category of the target page element is a text category, extracting second element content of the target page element from the target page element;
responding to the element category of the target page element as an image category, and converting the target page element into binary data to obtain second element content of the target page element;
and responding to the situation that the element category of the page element is an interactive category, determining the page operation on the target page element, acquiring a response message corresponding to the page operation according to the page operation, and taking the response message as the second element content of the target page element.
In another possible implementation, the second check-up content includes a first element parameter of the target page element;
the verifying the target page element according to the second verification content to obtain a test result of the target page element includes:
acquiring a second element parameter of the target page element in the first application page;
determining a degree of match between the first element parameter and the second element parameter;
and determining the test result of the target page element according to the matching degree.
In another possible implementation manner, before intercepting the first network request, the method further includes:
starting a test plug-in, and intercepting a second network request of the application program through the test plug-in;
sending the second network request to a service server corresponding to the application program;
receiving page data of a second application page corresponding to the second network request returned by the service server;
generating the first verification content according to the page data;
and composing the second network request, the page data and the first inspection content into the test case.
In another possible implementation manner, the generating the first check content according to the page data includes:
rendering the second application page according to the page data;
determining at least one target page element in the second application page;
identifying element content of the target page element, and using the element content as second check-up content of the target page element;
and generating the first check content according to the second check content of at least one target page element and the element identification of at least one target page element.
The generating the first check content according to the second check content of at least one of the target page elements and the element identifier of at least one of the target page elements includes:
binding the element identifier with the second check content to obtain the first check content;
the determining, according to the element identifier of the target page element, second verification content corresponding to the target page element from the first verification content includes:
and according to the element identification, querying second verification content corresponding to the element identification from the first verification content.
In another aspect, an application testing apparatus is provided, the apparatus including:
the intercepting module is used for intercepting a first network request;
the first determining module is used for determining a test case corresponding to the first network request according to the first network request;
the first obtaining module is used for obtaining page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request;
the second acquisition module is used for acquiring at least one target page element in the first application page according to the page data;
a second determining module, configured to determine, according to the element identifier of the target page element, second verification content corresponding to the target page element from the first verification content;
and the checking module is used for checking the target page element according to the second checking content to obtain a test result of the target page element.
In one possible implementation, the second check-up content includes first element content of the target page element; the verification module comprises:
a first determination unit, configured to determine an element category of the target page element;
the first identification unit is used for identifying second element content of the target page element from the target page element according to the element category;
and the checking unit is used for checking the target page element according to the first element content and the second element content to obtain the test result.
In another possible implementation manner, the first identifying unit is configured to, in response to that the element category of the target page element is a text category, extract second element content of the target page element from the target page element;
the first identification unit is used for responding to the fact that the element category of the target page element is an image category, converting the target page element into binary data, and obtaining second element content of the target page element;
the first identification unit is configured to determine a page operation on the target page element in response to that the element category of the page element is an interactive category, acquire a response message corresponding to the page operation according to the page operation, and use the response message as a second element content of the target page element.
In another possible implementation, the second check-up content includes a first element parameter of the target page element; the verification module comprises:
the acquisition unit is used for acquiring a second element parameter of the target page element in the first application page;
a second determination unit configured to determine a degree of matching between the first element parameter and the second element parameter;
and the second determining unit is used for determining the test result of the target page element according to the matching degree.
In another possible implementation manner, the apparatus further includes:
the starting module is used for starting a test plug-in and intercepting a second network request of the application program through the test plug-in;
the sending module is used for sending the second network request to a service server corresponding to the application program;
the receiving module is used for receiving page data of a second application page corresponding to the second network request returned by the service server;
the generating module is used for generating the first verification content according to the page data;
and the composition module is used for composing the second network request, the page data and the first inspection content into the test case.
In another possible implementation manner, the generating module includes:
a rendering unit, configured to render the second application page according to the page data;
a third determining unit, configured to determine at least one target page element in the second application page;
a second identifying unit, configured to identify an element content of the target page element, as a second check content of the target page element;
and the generating unit is used for generating the first check content according to the second check content of at least one target page element and the element identification of at least one target page element.
In another possible implementation manner, the generating unit is configured to bind the element identifier with the second check content to obtain the first check content;
the second determining module is configured to query, according to the element identifier, second verification content corresponding to the element identifier from the first verification content.
In another aspect, a test terminal is provided, where the test terminal includes a processor and a memory, and the memory stores at least one program code, and the program code is loaded and executed by the processor to implement the operations executed in the application program test method according to the embodiments of the present invention.
In another aspect, a computer-readable storage medium is provided, in which at least one program code is stored, and the program code is loaded and executed by a processor to implement the operations performed in the application test method according to the embodiment of the present invention.
In another aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer program code, the computer program code being stored in a computer-readable storage medium, the computer program code being read by a processor of a computer device from the computer-readable storage medium, the computer program code being executed by the processor to cause the computer device to perform the operations performed in the application testing method described above.
The technical scheme provided by the embodiment of the disclosure has the following beneficial effects:
in the embodiment of the disclosure, in the process of testing the application program, a first network request is intercepted, page data and first verification content corresponding to the first network request are obtained from a test case corresponding to the first network request, and verification of a target page element is completed by comparing the target page element in the page data with second verification content corresponding to the first verification content. The test terminal acquires the second check content, so that the target page element can be automatically checked according to the second check data. Therefore, the application program can be tested without the participation of testers, so that the influence of subjective factors of the testers on the test result is avoided, and the accuracy of the application program test can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, 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 only some embodiments of the present disclosure, 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 schematic diagram of an implementation environment involved in a method for testing an application provided in accordance with an illustrative embodiment;
FIG. 2 is a flow chart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 3 is a flow chart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 4 is a flow chart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 5 is a schematic illustration of an application page provided in accordance with an exemplary embodiment;
FIG. 6 is a flow chart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 7 is a schematic illustration of an application page provided in accordance with an exemplary embodiment;
FIG. 8 is a flowchart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 9 is a schematic illustration of an application page provided in accordance with an exemplary embodiment;
FIG. 10 is a flowchart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 11 is a flowchart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 12 is a schematic illustration of an application page provided in accordance with an exemplary embodiment;
FIG. 13 is a flowchart of a method for testing an application provided in accordance with an exemplary embodiment;
FIG. 14 is a block diagram of an application testing device provided in accordance with an exemplary embodiment;
fig. 15 is a schematic structural diagram of a test terminal according to an exemplary embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a schematic diagram of an implementation environment involved in an application testing method according to an exemplary embodiment. Referring to fig. 1, the implementation environment includes a test terminal 101 and a service server 102. The test terminal 101 and the service server 102 perform data interaction through a network connection or a data interface. The test terminal 101 is installed with an application program to be tested, and the service server 102 is a server corresponding to the application program. Optionally, the application is any type of application, for example, the application is a short video playback application, a social application, or the like. In the embodiment of the present disclosure, the type of the application is not particularly limited. The test terminal is also provided with a test plug-in used for carrying out case management, case issuing, result reporting and the like on the test case. The test plug-in comprises a kernel unit, a management unit, a user interaction unit and a control unit. The kernel unit is used for generating a test case. The management unit is used for controlling the test plug-in to automatically restart and locally store the test case. And the user interaction unit is used for managing the test cases through the case tree and determining the selection of the page elements. The control unit is used for coding, controlling test case playback and the like. And storing verification contents for verifying the page elements in the test case. Optionally, the verification content is mock (fictional) data for the page element, and is generated by intercepting the network request and data returned by the service server in the recording process.
In one possible implementation, the implementation environment further includes a test server 103. The test terminal 101 and the test server 103 perform data interaction through a network connection or a data interface. Correspondingly, at least one test case is stored in the test server 103, and the test terminal 101 can call the test case in the test server 103 to test the application program.
Optionally, the test terminal 101 is a mobile phone, a computer, a tablet computer, or a wearable device. Optionally, the operating system of the test terminal 101 is an os (operating system), an Android (operating system), and the like, and in the embodiment of the present disclosure, the operating system of the test terminal 101 is not specifically limited.
The service server 102 or the test server 103 is a different server. Optionally, the service server 102 or the test server 103 is an independent server, or a server cluster composed of a plurality of servers, or a cloud server, etc. In the embodiments of the present disclosure, this is not particularly limited.
Fig. 2 is a flowchart of an application testing method according to an exemplary embodiment, which is described as an example in the embodiment of the present disclosure. As shown in fig. 2, the method comprises the steps of:
step 201: a first network request is intercepted.
Step 202: and determining a test case corresponding to the first network request according to the first network request.
Step 203: and acquiring page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request.
Step 204: and acquiring at least one target page element in the first application page according to the page data.
Step 205: and determining second check content corresponding to the target page element from the first check content according to the element identifier of the target page element.
Step 206: and checking the target page element according to the second checking content to obtain a test result of the target page element.
In one possible implementation, the second check-up content includes first element content of the target page element; the verifying the target page element according to the second verification content to obtain a test result of the target page element includes:
determining the element category of the target page element;
according to the element category, identifying second element content of the target page element from the target page element;
and checking the target page element according to the content of the first element and the content of the second element until the test result is obtained.
In another possible implementation manner, the identifying the second element content of the target page element from the target page element according to the element category includes at least one of the following manners:
in response to the fact that the element category of the target page element is a text category, extracting second element content of the target page element from the target page element;
responding to the element category of the target page element as an image category, converting the target page element into binary data, and obtaining second element content of the target page element;
and responding to the element category of the page element as an interactive category, determining the page operation on the target page element, acquiring a response message corresponding to the page operation according to the page operation, and taking the response message as the second element content of the target page element.
In another possible implementation, the second check-up content includes a first element parameter of the target page element;
the verifying the target page element according to the second verification content to obtain a test result of the target page element includes:
acquiring a second element parameter of the target page element in the first application page;
determining a degree of match between the first element parameter and the second element parameter;
and determining the test result of the target page element according to the matching degree.
In another possible implementation manner, before intercepting the first network request, the method further includes:
starting a test plug-in, and intercepting a second network request of the application program through the test plug-in;
sending the second network request to a service server corresponding to the application program;
receiving page data of a second application page corresponding to the second network request returned by the service server;
generating the first check content according to the page data;
and composing the second network request, the page data and the first inspection content into the test case.
In another possible implementation manner, the generating the first check content according to the page data includes:
rendering the second application page according to the page data;
determining at least one target page element in the second application page;
identifying the element content of the target page element, and using the element content as the second check-up content of the target page element;
and generating the first check content according to the second check content of at least one target page element and the element identification of at least one target page element.
The generating the first check content according to the second check content of at least one of the target page elements and the element identifier of at least one of the target page elements includes:
binding the element identifier with the second check content to obtain the first check content;
the determining, according to the element identifier of the target page element, second check content corresponding to the target page element from the first check content includes:
and according to the element identification, querying second check content corresponding to the element identification from the first check content.
In the embodiment of the disclosure, in the process of testing the application program, a first network request is intercepted, page data and first verification content corresponding to the first network request are obtained from a test case corresponding to the first network request, and verification of a target page element is completed by comparing the target page element in the page data with second verification content corresponding to the first verification content. The test terminal acquires the second check content, so that the target page element can be automatically checked according to the second check data. Therefore, the application program can be tested without the participation of testers, so that the influence of subjective factors of the testers on the test result is avoided, and the accuracy of the application program test can be improved.
Before the application program is tested through the embodiment of the disclosure, the test case is recorded through the test plug-in, so that a subsequent test terminal can call the test case to test the application programs of different versions. Fig. 3 is a flowchart of an application testing method according to an exemplary embodiment, which is described in the embodiment of the present disclosure by taking a recorded test case as an example. As shown in fig. 3, the method comprises the steps of:
step 301: and the test terminal starts a test plug-in, and intercepts a second network request of the application program through the test plug-in.
Wherein, a test plug-in is installed in the test terminal. The test plug-in is an application program test plug-in with the functions of recording, playback and the like. Optionally, the test plug-in is a plug-in developed by any development tool. For example, the test plug-in is a plug-in developed by SDK (Software Development Kit). The test plug-in can be installed in any application. The second network request is a network request sent by the application program to the service server in the process of recording the test case by the test terminal. The second network request is a network request for the application to obtain page data of the second application page. For example, the application program is a short video playing application, and correspondingly, the second network request is an acquisition request of a short video playing page sent by the application program to the service server.
Optionally, a hook function is included in the test plug-in. And the test terminal intercepts a second network request sent by the application program to the service server through a hook function in the test plug-in.
In addition, referring to fig. 4, optionally, after intercepting the second network request, the test terminal records the second network request. Referring to fig. 5, the test terminal generates a second network request through the application 501, and sends the second network request to the test server 103, where the test plug-in 502 intercepts the second network request and generates a second request identifier according to the second network request. Optionally, the test terminal obtains feature data of the second network request, for example, feature data such as a request parameter, and calculates the feature data according to any algorithm to obtain a second request identifier of the second network request. For example, the test terminal generates the second request identifier according to MD5(Message Digest Algorithm MD5, fifth version of the Message Digest Algorithm). Accordingly, the second request identifier is determined based on the MD5 algorithm according to the characteristic data of the second network request.
It should be noted that, in the process of recording the test case by the test terminal, the application program may send a plurality of second network requests to the service server, and for each second network request, the terminal intercepts, by the test plug-in, the second network request sent by the application program. Optionally, with reference to fig. 5, the test terminal encodes the second request identifier in an incremental manner, and accordingly, the encoding of the first network request in the test case is set to MD5_0, and when a new second network request is subsequently received, the encoding of the new second network request is set to MD5_ 1.
In addition, the test terminal also records the sending time stamp of the second network request, so that the sending time of the second network request can be restored according to the time stamp when software test is carried out according to the test case playback in the following. Accordingly, in this step, see fig. 4, 403: the test terminal records the second network request, and records the intercepted second network request, the response message corresponding to the second network request, the sending timestamp of the second network request and other information in the test case. The test terminal performs slicing processing on the intercepted second network request, and removes a WNS (a wireless transmit data packet) in the second network request, so that the test terminal does not send the second network request to the service server when performing a subsequent test through the test case. And, the second network request, page data corresponding to the second network request, and information such as a generation time stamp are recorded.
After the test plug-in is started, the test button 601 corresponding to the test plug-in is displayed in the display interface of the test terminal. Referring to fig. 6, a floating layer is shown in the current display interface, on which the test button 601 is displayed. Optionally, the shape and position of the test button 601 are set and changed as needed, and in the implementation of the present disclosure, the shape and position of the test button 601 are not particularly limited. Alternatively, the test terminal receives a movement operation input by the user, and moves the test button 601 to the target position according to the movement operation.
In response to the terminal detecting that the test button 601 is triggered, the terminal records the test case through the test plug-in.
In a possible implementation manner, the test terminal detects that the test button 601 is triggered in any application page of the application program, and the test terminal intercepts the second network request directly in the application page. In the implementation manner, the test terminal directly starts to record the test case in the application page triggered by the test button 601, so that the generated test case can be directly tested from the current second application page, the purpose of the application program test is strong, the time of the application program test is saved, and the efficiency of the application program test is improved.
In another possible implementation, referring to fig. 4, the test terminal detects that a test button 601 is triggered in any application page of the application program, 401: initializing recording environment of test cases, 402: and restarting the current application program, and intercepting the second network request in the re-entering application page in the restarted application program. In this implementation manner, when it is detected that the test button 601 is triggered, the application program is restarted according to the triggered test button 601, and the second application page is re-entered from the application program, so that it can be tested whether the second application page can be normally started or not in the test process.
Step 302: and the test terminal sends the second network request to a service server corresponding to the application program.
With reference to fig. 5, the test terminal determines the service server corresponding to the application program according to the application program, and sends the second network request to the service server. The service server is used for sending the page data of the first page to the test terminal according to the second network request.
Step 303: and the test terminal receives the page data of the second application page corresponding to the second network request returned by the service server.
With reference to fig. 5, after receiving the second network request, the service server determines page data corresponding to the second network request according to the second network request, and returns the page data to the test terminal.
For example, the application is a short video playing application, correspondingly, the second network request is a network request for requesting short video data, and correspondingly, the server determines the short video data according to the page information carried by the second network request and returns the short video data to the test terminal.
Step 304: and the test terminal generates first verification content according to the page data.
With reference to fig. 5, in this step, the test terminal intercepts the page data to the recording process through a hook function in the test plug-in, and generates a first verification content corresponding to the second network request. This step is realized by the following steps (a1) - (a4), including:
(A1) and rendering the second application page by the test terminal according to the page data.
In this step, the test terminal renders a second application page corresponding to the page data in the test terminal according to the received page data.
(A2) The test terminal determines at least one target page element in the second application page.
Also included in the test plug-in is an element extractor, see FIG. 4, for extracting at least one page element 404 in the second application page. Referring to fig. 7, the test terminal scans the second application page while displaying the second application page 701 and the page 702 of the test plug-in, so as to obtain at least one page element in the second application page. For example, if the second application page is a short video playing page, the page elements summarized by the second application page include a video picture, an attention tag, a recommendation tag, a title tag, a praise tag, a comment tag sharing tag, and the like. The test terminal records the position, content, binary data and other element contents of the scanned at least one page element in the second application page through the element extractor.
Optionally, the test terminal takes all of the scanned at least one page element as a target page element.
Optionally, the test terminal selects at least one page element from the scanned at least one page element as a target page element. Correspondingly, the process is as follows: the test terminal traverses the page elements in the second application page to obtain at least one page element; displaying at least one page element; and acquiring at least one selected target page element in at least one page.
The test terminal receives a selection instruction; and determining at least one selected target page element according to the selection instruction. Optionally, the test terminal marks at least one target page element, or displays the at least one target page element in an element display page. Referring to fig. 7, the test terminal presents the scanned at least one page element in the second application page, and presents the selected at least one target page element in the element presentation page. In this implementation manner, the test terminal displays different page elements in the test plug-in and marks the page elements in the second application page, so that a tester can more intuitively know the currently scanned page elements and know the currently to-be-tested page elements.
Accordingly, in one possible implementation, the test terminal marks the scanned at least one page element. For example, the test terminal marks the scanned at least one page element through the colored translucent frame. Optionally, the color of the translucent frame is set and changed as needed, and in the embodiment of the present disclosure, the color of the translucent frame is not particularly limited. In this implementation, the test terminal marks out at least one page element, so that a tester can visually see the at least one page element in the second application page.
In another possible implementation manner, the test terminal displays the scanned at least one page element in an element display page corresponding to the test plug-in. In the implementation mode, the test terminal displays at least one scanned page element in the element display page corresponding to the test plug-in, so that a tester can visually determine the page element from the element display page.
In addition, the page elements in the page 702 of the test plug-in may be displayed separately according to the category of the page elements. Referring to fig. 7, page elements such as an image class, a text class, and the like are respectively displayed.
In addition, the test terminal also generates an element identifier. Wherein the element identification is used to mark the page element. Optionally, the test terminal encodes the element features of the page elements, and uses the identifiers obtained by encoding as the element identifiers of the page elements. Alternatively, the encoding method may be any data encoding method, for example, the encoding method may be an MD5 encoding method.
(A3) And the test terminal identifies the element content of the target page element and takes the element content as second check content of the target page element.
In this step, with continued reference to fig. 4, the test terminal determines the element category of the target page element, and generates the second verification content corresponding to the page element according to the element category.
And the test terminal classifies the data type or function of the current page element into page elements. For example, with continued reference to fig. 4, the test terminal classifies the target page elements into text classes, image classes, and the like according to the data types of the target page elements; dividing the target page elements into an interactive class and a non-interactive class according to the functions of the target page elements; and dividing the target page elements into a dynamic display class, a direct display class and the like according to the display conditions of the target page elements. In the embodiment of the present disclosure, the classification method of the target page element is not particularly limited.
After determining the element category of the target page element, the test terminal identifies the element content corresponding to the target element according to the element category of the target element, and takes the element content as the second check content of the target page element.
For example, in response to that the element category of the page element is a text category, the test terminal extracts the text content of the target page element from the target page element to obtain the element content of the target page element. For example, if the target page element is a title of a video file in a video playing page, the test terminal identifies the content of the title, and takes the identified content of the title as the element content of the target page element.
And responding to the fact that the element category of the page element is the image category, converting the target page element into binary data by the test terminal, and obtaining the element content of the target page element. For example, if the page element is a head portrait of a user in a video playing page, the test terminal identifies an image corresponding to the head portrait, converts the image into binary data, and uses the binary data as the element content of the page element.
And responding to the interactive type of the element category of the page element, determining the page operation of the target page element by the test terminal, acquiring a response message corresponding to the page operation according to the page operation, and taking the response message as the element content of the target page element. Additionally, with continued reference to fig. 4, 405: the test terminal records an operation record, and for a target page element which can be interacted, the test terminal also records a generation timestamp of a page operation corresponding to the target page element, a page operation request generated by the page operation and the like, and records the timestamp, the page operation request and the like as second check content of the target page element. For example, the page element is a sharing button in the second application page, a trigger operation on the sharing button is detected, a new sharing request is generated according to the trigger operation, the sharing request is intercepted, and the sharing request is encoded according to the sequence number of the current network request, which is similar to that in step 301 and 302 and is not described herein again. And the test terminal takes the response message corresponding to the received sharing request, the sharing request and the target page element as second verification content of the page element.
And in response to the fact that the element category of the target page element is a dynamic display category, the test terminal detects a specific operation in the second application page, in response to receiving the specific operation, displays the corresponding target page element according to the specific operation, and takes an icon corresponding to the specific operation and the target page element as second check content corresponding to the target page element. For example, the target page element is a pause icon, in response to receiving a click operation on a playing screen in the second application page, the test terminal determines that the specified operation is received, and takes the received specified operation and the pause icon generated after the screen is paused as the second check content of the target page element.
The test terminal further records the position of each target page element, the timestamp requested to be generated, the position and distance of the operation on the page, and the like, and uses the position of each target page element, the timestamp requested to be generated, the position and distance of the operation on the page, and the like as the verification content of the target page element.
In addition, optionally, the test terminal records the second check-up content corresponding to the target page element in the form of a script file. In the embodiment of the present disclosure, the recording form of the verification content of the target page element is not particularly limited.
(A4) And the test terminal generates the first check content according to the second check content of at least one target page element and the element identifier of at least one target page element.
And the test terminal makes the second check content of at least one target page element and the element identification of the target page element corresponding to the second check content form first check content. Correspondingly, the test terminal binds the element identifier with the second verification content to obtain the first verification content.
Step 305: and the test terminal combines the second network request, the page data and the first inspection content into the test case.
In this step, with continued reference to fig. 5, the test terminal matches the second network request, the page data of the second application page, and the first verification content to form the test case. Optionally, the test terminal generates a case identifier of each test case, where the case identifiers correspond to the test cases one to one. Optionally, the case identifier of the test case is a test case name filled by a tester when the test case is generated; or, the use case identifier is automatically generated by a coding algorithm, and in the embodiment of the present disclosure, the use case identifier of the test use case is not specifically limited.
Optionally, after the test terminal generates the test case, the generated test case is stored locally; alternatively, with continued reference to fig. 4 and 5, 406: the test terminal sends the generated test case to the test server, and the test server stores the test case.
In the implementation mode, the test case is generated, so that the software application can be directly tested by replaying the test case in the subsequent software testing process, and the software testing efficiency is improved.
In the embodiment of the disclosure, a second network request sent by a test terminal and page data corresponding to the second network request are intercepted in the process of recording a test case, at least one target page element in the page data is analyzed, first verification content of the at least one target page element is recorded, and the test case is obtained, so that a first network request is intercepted in the process of testing an application program, the page data corresponding to the first network request and the first verification content are obtained from the test case corresponding to the first network request, and the target page element in the page data is verified through the first verification content. The test terminal acquires the first verification content, so that the target page element can be automatically verified according to the first verification data. Therefore, the application program can be tested without the participation of testers, so that the influence of subjective factors of the testers on the test result is avoided, and the accuracy of the application program test can be improved.
After the test cases are recorded, the test terminal can test the application by selecting one test case for playback. The second check-up content in the test case comprises the first element content of the target page element, or the second check-up content comprises the first element parameter of the target page element. Fig. 8 is a flowchart of an application testing method according to an exemplary embodiment, which is described in the embodiment of the present disclosure by taking the first element content of which the second check-up content includes the target page element as an example. As shown in fig. 8, the method comprises the steps of:
step 801: the test terminal intercepts a first network request.
And in the process of playing back the test case, the test terminal sends a network request to the service server according to the network request recorded in the test case. The step is similar to the process of the test terminal intercepting the second network request in step 301, and is not described herein again.
It should be noted that, before this step, the test terminal needs to determine the test case for performing the software test. Referring to fig. 9, a test case list 901 of a test plug-in is shown in a test terminal, and the test case list includes case identifiers of a plurality of test cases. Correspondingly, the test terminal receives the selection operation of the test case in the test case list, determines the test case corresponding to the software test according to the selection operation, and plays back the test case. Optionally, with continued reference to fig. 9, a play button 902 is shown in the test case list, and in response to the terminal detecting that any play button is triggered, the test case corresponding to the play button is determined as the selected test case. In addition, the test terminal also receives the test times input by the tester, and plays back the test case according to the test times. In addition, the page also comprises the options of adding, downloading and the like, the recording of the test case can be directly triggered through the adding option, and other test cases can be downloaded from the test server through the downloading option.
Step 802: and the test terminal determines a test case corresponding to the first network request according to the first network request.
Referring to fig. 10 and fig. 11, after the test terminal intercepts the first network request, it determines a first request identifier of the first network request, 1101: reading a test case; in the course of conducting the test, 1102: restarting the application program; and inquiring a test case corresponding to the first network request according to the first request identifier, and replacing the data in the test case with the data acquired from the service server by the first network request. The process is realized by the following steps (1) to (2), and comprises the following steps:
(1) the test terminal determines a first request identification of the first network request.
The determination manner of the first request identifier is similar to the process of determining, by the test terminal, the second request identifier of the second network request in step 302, and details are not repeated here.
(2) And the test terminal determines a test case corresponding to the first request identifier from the request identifier and the case identifier according to the first request identifier.
In this step, the test terminal determines the test case according to the first request identifier and the corresponding relationship between the request identifier and the case identifier.
The test terminal can prevent the business surface content of the software from changing after the version of the test software is improved and influencing the test result according to the test case corresponding to the first network request without sending the first network request to the business server.
Step 803: the test terminal obtains page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request.
Optionally, the test case is a test case locally stored by the test terminal; or, the test case is a test case stored in the test server. Correspondingly, in response to the test case being the test case stored by the test terminal this time, the test terminal calls the application page and the verification content in the local test case according to the data interface through the corresponding relationship between the test case and the request identifier according to the first request identifier of the first network request. Referring to fig. 10, in response to that the test case is a test case stored in the test server, the test terminal sends a first request identifier of the first network request to the test server, and the test server determines, according to the first request identifier, a test case corresponding to the first request identifier, and sends page data and first verification content of a first application page in the test case to the test terminal, accordingly, referring to fig. 11, 1103: the test terminal receives page data and first verification content of a first application page sent by the test server. And rendering the page data in a display page by the test terminal to obtain the first application page.
In addition, referring to fig. 10, in response to receiving the returned page data, the test terminal performs error reporting.
Step 804: and the test terminal acquires at least one target page element in the first application page according to the page data.
This step is similar to step (a2) in step 304, and will not be described herein. Referring to fig. 11, 1104: and extracting at least one target page element in the first application page.
Step 805: and the test terminal inquires second verification content corresponding to the element identifier from the first verification content according to the element identifier.
And responding to the binding of the element identification in the first checking content and the second checking content, and inquiring the second checking content corresponding to the element identification from the first checking content by the testing terminal according to the element identification.
In this step, the test terminal determines the element identifier of the target page element. This process is similar to the process of generating the element identifier in step (a2) in step 304, and is not described here again.
Step 806: and the test terminal determines the element category of the target page element.
This step is similar to the process of determining the element type of the target page element by the test terminal in step (a3) in step 304, and is not repeated here.
Step 807: and the test terminal identifies the second element content of the target page element from the target page element according to the element category.
1105: and for different types of page elements, the test terminal verifies the page elements according to different test modes.
In one possible implementation manner, in response to that the element category of the target page element is a text class, second element content of the target page element is extracted from the target page element.
In another possible implementation manner, in response to that the element category of the target page element is an image class, the target page element is converted into binary data, and second element content of the target page element is obtained.
In another possible implementation manner, in response to that the element category of the page element is an interactive category, determining a page operation on the target page element, acquiring a response message corresponding to the page operation according to the page operation, and using the response message as second element content of the target page element.
Step 808: and the test terminal checks the target page element according to the first element content and the second page content to obtain the test result.
And the first page element is a content element included in the second check content in the test case. In response to the first element content being the same as the second element content, determining that the page element is verified successfully; and determining that the page element check fails in response to the first element content being different from the second element content. Referring to fig. 12, the test terminal displays a test result through a display page of the test plug-in, marks the page element through the first mark 1201 in response to the successful verification of the page element, and marks the page element through the second mark in response to the failed verification of the page element. The first mark 1201 and the second mark 1202 are different marks, and the first mark 1201 and the second mark 1202 are set and changed as needed, and in the embodiment of the present disclosure, the first mark 1201 and the second mark 1202 are not particularly limited. For example, the first mark 1201 is a green tick mark, and the second mark 1202 is a red cross mark.
It should be noted that, in a possible implementation manner, in the process of performing the test by the test terminal, for each page element, the test terminal records the page element, marks the tested page element, serially processes a plurality of page elements, and performs the test on the next page element after one page element is tested. In the implementation mode, the test terminal tests each page element in series, so that each page element is ensured to finish testing according to the element identifier of the page element, testing errors are prevented, and the accuracy of software testing is improved. In another possible implementation manner, the test terminal simultaneously tests a plurality of page elements, the page elements are processed in parallel, and the efficiency of software testing is improved by simultaneously testing a plurality of test software.
Another point to be explained is, see fig. 11, 1106: after the test terminal finishes the test, the test result is reported to a tester, and the tester further operates the test result.
Another point to be noted is that, in the process of testing the application program by the test terminal according to the test case, referring to fig. 10, the application program also establishes a communication connection with the service server for reporting the heartbeat, so as to inform the service server that the application program is working normally.
In the embodiment of the disclosure, in the process of testing the application program, a first network request is intercepted, page data and first verification content corresponding to the first network request are obtained from a test case corresponding to the first network request, and verification of a target page element is completed by comparing the target page element in the page data with second verification content corresponding to the first verification content. The test terminal acquires the second check content, so that the target page element can be automatically checked according to the second check data. Therefore, the application program can be tested without the participation of testers, so that the influence of subjective factors of the testers on the test result is avoided, and the accuracy of the application program test can be improved.
Fig. 13 is a flowchart of an application testing method according to an exemplary embodiment, which is described in the embodiment of the present disclosure by taking an example that the second check-up content includes a first element parameter of a target page element. As shown in fig. 13, the method includes the steps of:
step 1301: the test terminal intercepts a first network request.
This step is similar to step 801 and will not be described herein again.
Step 1302: and the test terminal determines a test case corresponding to the first network request according to the first network request.
This step is similar to step 802 and will not be described herein.
Step 1303: the test terminal obtains page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request.
This step is similar to step 803 and will not be described herein.
Step 1304: and the test terminal acquires at least one target page element in the first application page according to the page data.
This step is similar to step 804 and will not be described herein again.
Step 1305: and the test terminal acquires a second element parameter of the target page element in the first application page.
The element parameters comprise parameters such as the position or the size of the target page element. Correspondingly, in the step, the test terminal determines information such as position parameters and size parameters of the target page element in the first application page.
Step 1306: the test terminal determines a degree of match between the first elemental parameter and the second elemental parameter.
In this step, the test terminal determines a difference range between the position or size indicated by the second element parameter and the position or size preset in the first element parameter, and the smaller the difference range is, the higher the matching degree is, the larger the difference range is, the smaller the matching degree is.
Step 1307: and the test terminal determines the test result of the target page element according to the matching degree.
This step is similar to step 808. The manufacturing process is not described in detail.
In the embodiment of the disclosure, in the process of testing the application program, a first network request is intercepted, page data and first verification content corresponding to the first network request are obtained from a test case corresponding to the first network request, and verification of a target page element is completed by comparing the target page element in the page data with second verification content corresponding to the first verification content. The test terminal acquires the second check content, so that the target page element can be automatically checked according to the second check data. Therefore, the application program can be tested without the participation of testers, so that the influence of subjective factors of the testers on the test result is avoided, and the accuracy of the application program test can be improved.
FIG. 14 is a block diagram of an application testing device according to an example embodiment. Referring to fig. 14, the apparatus includes:
an intercept module 1401 for intercepting a first network request;
a first determining module 1402, configured to determine, according to the first network request, a test case corresponding to the first network request;
a first obtaining module 1403, configured to obtain page data of a first application page to be tested and first verification content of the first application page from the test case, where the first application page is a page corresponding to the first network request;
a second obtaining module 1404, configured to obtain at least one target page element in the first application page according to the page data;
a second determining module 1405, configured to determine, according to the element identifier of the target page element, second check content corresponding to the target page element from the first check content;
the checking module 1406 is configured to check the target page element according to the second checking content, so as to obtain a test result of the target page element.
In one possible implementation, the second check-up content includes first element content of the target page element; the verification module 1406 includes:
a first determination unit, configured to determine an element category of the target page element;
the first identification unit is used for identifying second element content of the target page element from the target page element according to the element category;
and the checking unit is used for checking the target page element according to the first element content and the second element content to obtain the test result.
In another possible implementation manner, the first identifying unit is configured to, in response to that the element category of the target page element is a text class, extract second element content of the target page element from the target page element;
the first identification unit is used for responding to the condition that the element category of the target page element is an image category, converting the target page element into binary data and obtaining second element content of the target page element;
the first identification unit is configured to determine a page operation on the target page element in response to that the element category of the page element is an interactive category, acquire a response message corresponding to the page operation according to the page operation, and use the response message as a second element content of the target page element.
In another possible implementation, the second check-up content includes a first element parameter of the target page element; the verification module 1406 includes:
the acquisition unit is used for acquiring a second element parameter of the target page element in the first application page;
a second determining unit configured to determine a degree of matching between the first element parameter and the second element parameter;
and the second determining unit is used for determining the test result of the target page element according to the matching degree.
In another possible implementation manner, the apparatus further includes:
the starting module is used for starting the test plug-in and intercepting a second network request of the application program through the test plug-in;
the sending module is used for sending the second network request to a service server corresponding to the application program;
the receiving module is used for receiving page data of a second application page corresponding to the second network request returned by the service server;
the generating module is used for generating the first verification content according to the page data;
and the composition module is used for composing the second network request, the page data and the first inspection content into the test case.
In another possible implementation manner, the generating module includes:
the rendering unit is used for rendering the second application page according to the page data;
a third determining unit, configured to determine at least one target page element in the second application page;
a second identifying unit, configured to identify the element content of the target page element, and use the element content as a second check content of the target page element;
and the generating unit is used for generating the first check content according to the second check content of at least one target page element and the element identification of at least one target page element.
In another possible implementation manner, the generating unit is configured to bind the element identifier with the second check content to obtain the first check content;
the second determining module 1405 is configured to query, according to the element identifier, second check-up content corresponding to the element identifier from the first check-up content.
In the embodiment of the disclosure, in the process of testing the application program, a first network request is intercepted, page data and first verification content corresponding to the first network request are obtained from a test case corresponding to the first network request, and verification of a target page element is completed by comparing the target page element in the page data with second verification content corresponding to the first verification content. The test terminal acquires the second check content, so that the target page element can be automatically checked according to the second check data. Therefore, the application program can be tested without the participation of testers, so that the influence of subjective factors of the testers on the test result is avoided, and the accuracy of the application program test can be improved.
It should be noted that: in the application test device provided in the above embodiment, only the division of the functional modules is exemplified when testing the application, and in practical applications, the function distribution may be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the application program testing device and the application program testing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 15 shows a block diagram of a test terminal 101 according to an exemplary embodiment of the present application. The test terminal 101 may be a portable mobile terminal, such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The test terminal 101 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
Generally, the test terminal 101 includes: a processor 10101 and a memory 10102.
The processor 10101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 10101 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 10101 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also referred to as a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 10101 may be integrated with a GPU (Graphics Processing Unit) which is responsible for rendering and drawing content required to be displayed by the display screen. In some embodiments, the processor 10101 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
The memory 10102 may include one or more computer-readable storage media, which may be non-transitory. The memory 10102 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 10102 is used to store at least one program code for execution by the processor 10101 to implement the application testing method provided by the method embodiments herein.
In some embodiments, the test terminal 101 may further include: a peripheral interface 10103 and at least one peripheral. The processor 10101, the memory 10102, and the peripheral interface 10103 may be connected by a bus or signal lines. Various peripheral devices may be connected to peripheral interface 10103 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 10104, a display screen 10105, a camera assembly 10106, an audio circuit 10107, a positioning assembly 10108, and a power supply 10109.
The peripheral interface 10103 can be used to connect at least one peripheral related to I/O (Input/Output) to the processor 10101 and the memory 10102. In some embodiments, the processor 10101, memory 10102, and peripheral interface 10103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 10101, the memory 10102 and the peripheral interface 10103 can be implemented on a single chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 10104 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuit 10104 communicates with a communication network and other communication devices by electromagnetic signals. The radio frequency circuit 10104 converts an electric signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electric signal. Optionally, the radio frequency circuit 10104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 10104 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 10104 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display 10105 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 10105 is a touch display, the display 10105 also has the ability to capture touch signals on or above the surface of the display 10105. The touch signal may be input to the processor 10101 as a control signal for processing. At this time, the display 10105 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 10105 may be one, disposed on the front panel of the test terminal 101; in other embodiments, the display 10105 may be at least two, respectively disposed on different surfaces of the test terminal 101 or in a folded design; in other embodiments, the display 10105 may be a flexible display disposed on a curved surface or a folded surface of the test terminal 101. Even, the display 10105 can be arranged in a non-rectangular irregular figure, namely, a special-shaped screen. The Display 10105 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 10106 is used to capture images or video. Optionally, the camera assembly 10106 comprises a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 10106 can also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 10107 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 10101 for processing or inputting the electric signals to the radio frequency circuit 10104 for realizing voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the test terminal 101. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert the electrical signal from the processor 10101 or the radio frequency circuit 10104 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuit 10107 may also include a headphone jack.
The positioning component 10108 is used to locate the current geographic Location of the test terminal 101 for navigation or LBS (Location Based Service). The Positioning component 10108 can be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
The power supply 10109 is used to power the various components in the test terminal 101. The power source 10109 can be ac, dc, disposable or rechargeable. When the power source 10109 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the test terminal 101 also includes one or more sensors 10110. The one or more sensors 10110 include, but are not limited to: an acceleration sensor 10111, a gyro sensor 10112, a pressure sensor 10113, a fingerprint sensor 10114, an optical sensor 10115, and a proximity sensor 10116.
The acceleration sensor 10111 can detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the test terminal 101. For example, the acceleration sensor 10111 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 10101 can control the display screen 10105 to display a user interface in a transverse view or a longitudinal view according to the gravity acceleration signal acquired by the acceleration sensor 10111. The acceleration sensor 10111 can also be used for acquisition of motion data of a game or a user.
The gyroscope sensor 10112 may detect a body direction and a rotation angle of the test terminal 101, and the gyroscope sensor 10112 and the acceleration sensor 10111 may cooperate to acquire a 3D motion of the user on the test terminal 101. The processor 10101 may implement the following functions according to the data collected by the gyro sensor 10112: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 10113 may be disposed on a side frame of the test terminal 101 and/or under the display 10105. When the pressure sensor 10113 is disposed on the side frame of the test terminal 101, the holding signal of the user to the test terminal 101 can be detected, and the processor 10101 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 10113. When the pressure sensor 10113 is disposed at a lower layer of the display screen 10105, the processor 10101 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 10105. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 10114 is configured to collect a fingerprint of the user, and the processor 10101 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 10114, or the fingerprint sensor 10114 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, the processor 10101 authorizes the user to perform relevant sensitive operations, including unlocking a screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 10114 may be disposed on the front, back, or side of the test terminal 101. When a physical button or a manufacturer Logo is provided on the test terminal 101, the fingerprint sensor 10114 may be integrated with the physical button or the manufacturer Logo.
The optical sensor 10115 is used to collect the ambient light intensity. In one embodiment, the processor 10101 can control the display brightness of the display screen 10105 according to the ambient light intensity collected by the optical sensor 10115. Specifically, when the ambient light intensity is high, the display brightness of the display screen 10105 is increased; when the ambient light intensity is low, the display brightness of the display screen 10105 is reduced. In another embodiment, the processor 10101 can also dynamically adjust the shooting parameters of the camera assembly 10106 according to the intensity of the ambient light collected by the optical sensor 10115.
The proximity sensor 10116, also referred to as a distance sensor, is typically disposed on the front panel of the test terminal 101. The proximity sensor 10116 is used to capture the distance between the user and the front face of the test terminal 101. In one embodiment, when the proximity sensor 10116 detects that the distance between the user and the front surface of the test terminal 101 gradually decreases, the processor 10101 controls the display 10105 to switch from the bright screen state to the dark screen state; when the proximity sensor 10116 detects that the distance between the user and the front surface of the test terminal 101 gradually becomes larger, the processor 10101 controls the display 10105 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in FIG. 15 does not constitute a limitation of test terminal 101, and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components may be employed.
In an exemplary embodiment, there is also provided a computer-readable storage medium in which at least one program code is stored, the at least one program code being loaded and executed by a server to implement the application testing method in the above-described embodiments. The computer readable storage medium may be a memory. For example, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, and the like. .
In an exemplary embodiment, a computer program product or a computer program is also provided, which includes computer program code stored in a computer-readable storage medium, which is read by a processor of a computer device from the computer-readable storage medium, and which is executed by the processor to cause the computer device to perform the operations performed in the application test method described above.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by hardware associated with program code, and the program may be stored in a computer readable storage medium, where the above mentioned storage medium may be a read-only memory, a magnetic or optical disk, etc.
The above description is meant as an alternative embodiment of the disclosure and not as a limitation of the disclosure, and any modification, equivalent replacement, or improvement made within the spirit and principle of the disclosure should be included in the scope of protection of the disclosure.

Claims (10)

1. An application testing method, the method comprising:
intercepting a first network request;
determining a test case corresponding to the first network request according to the first network request;
acquiring page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request;
acquiring at least one target page element in the first application page according to the page data;
according to the element identification of the target page element, determining second check content corresponding to the target page element from the first check content;
and checking the target page element according to the second checking content to obtain a test result of the target page element.
2. The method of claim 1, wherein the second check-up content comprises first element content of the target page element; the verifying the target page element according to the second verification content to obtain a test result of the target page element includes:
determining an element category of the target page element;
according to the element category, identifying second element content of the target page element from the target page element;
and verifying the target page element according to the first element content and the second element content to obtain the test result.
3. The method of claim 2, wherein the identifying the second element content of the target page element from the target page elements according to the element category comprises at least one of:
in response to the fact that the element category of the target page element is a text category, extracting second element content of the target page element from the target page element;
responding to the element category of the target page element as an image category, and converting the target page element into binary data to obtain second element content of the target page element;
and responding to the situation that the element category of the page element is an interactive category, determining the page operation on the target page element, acquiring a response message corresponding to the page operation according to the page operation, and taking the response message as the second element content of the target page element.
4. The method of claim 1 or 2, wherein the second check-up content comprises a first element parameter of the target page element; the verifying the target page element according to the second verification content to obtain a test result of the target page element includes:
acquiring a second element parameter of the target page element in the first application page;
determining a degree of match between the first element parameter and the second element parameter;
and determining the test result of the target page element according to the matching degree.
5. The method of claim 1, wherein prior to the intercepting the first network request, the method further comprises:
starting a test plug-in, and intercepting a second network request of the application program through the test plug-in;
sending the second network request to a service server corresponding to the application program;
receiving page data of a second application page corresponding to the second network request returned by the service server;
generating the first verification content according to the page data;
and composing the second network request, the page data and the first inspection content into the test case.
6. The method of claim 5, wherein the generating the first check-up content according to the page data comprises:
rendering the second application page according to the page data;
determining at least one target page element in the second application page;
identifying element content of the target page element, and using the element content as second check-up content of the target page element;
and generating the first check content according to the second check content of at least one target page element and the element identification of at least one target page element.
7. The method of claim 6, wherein generating the first check-up content according to the second check-up content of the at least one target page element and the element identifier of the at least one target page element comprises:
binding the element identifier with the second check content to obtain the first check content;
the determining, according to the element identifier of the target page element, second verification content corresponding to the target page element from the first verification content includes:
and according to the element identification, querying second verification content corresponding to the element identification from the first verification content.
8. An application testing apparatus, the apparatus comprising:
the intercepting module is used for intercepting a first network request;
the first determining module is used for determining a test case corresponding to the first network request according to the first network request;
the first obtaining module is used for obtaining page data of a first application page to be tested and first verification content of the first application page from the test case, wherein the first application page is a page corresponding to the first network request;
the second acquisition module is used for acquiring at least one target page element in the first application page according to the page data;
a second determining module, configured to determine, according to the element identifier of the target page element, second verification content corresponding to the target page element from the first verification content;
and the checking module is used for checking the target page element according to the second checking content to obtain a test result of the target page element.
9. A test terminal, characterized in that it comprises a processor and a memory, in which at least one program code is stored, which program code is loaded and executed by the processor to implement the application testing method according to any of claims 1-7.
10. A computer-readable storage medium, having stored therein at least one program code, which is loaded and executed by a processor, to implement the application testing method according to any one of claims 1 to 7.
CN202010728003.2A 2020-07-23 2020-07-23 Application program testing method and device, testing terminal and storage medium Pending CN113971123A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010728003.2A CN113971123A (en) 2020-07-23 2020-07-23 Application program testing method and device, testing terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010728003.2A CN113971123A (en) 2020-07-23 2020-07-23 Application program testing method and device, testing terminal and storage medium

Publications (1)

Publication Number Publication Date
CN113971123A true CN113971123A (en) 2022-01-25

Family

ID=79585924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010728003.2A Pending CN113971123A (en) 2020-07-23 2020-07-23 Application program testing method and device, testing terminal and storage medium

Country Status (1)

Country Link
CN (1) CN113971123A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114579433A (en) * 2022-02-15 2022-06-03 北京达佳互联信息技术有限公司 Page parameter checking method, device, electronic equipment, medium and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114579433A (en) * 2022-02-15 2022-06-03 北京达佳互联信息技术有限公司 Page parameter checking method, device, electronic equipment, medium and program product

Similar Documents

Publication Publication Date Title
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN111858382A (en) Application program testing method, device, server, system and storage medium
CN111177013A (en) Log data acquisition method and device, computer equipment and storage medium
CN113076051A (en) Slave control terminal synchronization method, device, terminal and storage medium
CN114064450A (en) Application program testing method and device, electronic equipment and storage medium
CN109684123B (en) Problem resource positioning method, device, terminal and storage medium
CN111338933A (en) Buried point verification method, device, equipment and storage medium
CN108492339B (en) Method and device for acquiring resource compression packet, electronic equipment and storage medium
CN112118353A (en) Information display method, device, terminal and computer readable storage medium
CN111797017A (en) Method and device for storing log, test equipment and storage medium
CN113971123A (en) Application program testing method and device, testing terminal and storage medium
CN110825465A (en) Log data processing method and device, electronic equipment and storage medium
CN111258683A (en) Detection method, detection device, computer equipment and storage medium
CN113688043B (en) Application program testing method, device, server, iOS device and medium
CN112597417B (en) Page updating method and device, electronic equipment and storage medium
CN113591090B (en) Program bug reporting method, device, equipment and storage medium
CN113268234A (en) Page generation method, device, terminal and storage medium
CN113342635A (en) Acquisition of differential code coverage rate and differential code file sending method and device
CN112000576A (en) Code data detection method, device, equipment and storage medium
CN113342645B (en) Method, device, equipment and storage medium for testing business function
CN111858367A (en) Code coverage rate testing method, system, device, electronic equipment and storage medium
CN113312249A (en) Log data generation method, log data display method and device
CN111309538B (en) Memory checking method and device, electronic equipment and storage medium
CN114071119B (en) Resource testing method and device, electronic equipment and storage medium
CN111666214B (en) Client fault tolerance test method, device, terminal, server and storage medium

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