Application page detection method and device, storage medium and electronic equipment
Through automated comparison and classification processing of target page files, the problem of low application page detection efficiency in the prior art is solved, and stability and consistency detection in different network and client environments are achieved.
Patent Information
- Application Number
- CN202411353849.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In the prior art, the application of page detection methods is inefficient and requires manual construction of different networks and client environments, which leads to high time consumption and prone to errors.
By obtaining the files of the target page in multiple network environments, comparing files that meet the preset conditions into candidate folders, putting them into exception folders if the conditions are not met, and confirming that the page passes detection without exception files.
Automatic detection is realized, efficiency is improved, labor costs are reduced, and page stability and consistency in different environments.
Smart Images

Figure CN119311551A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of mobile terminal testing, and in particular to a method and device for detecting an application page, a storage medium, and an electronic device. Background Art
[0002] In mobile application development, different networks and clients will affect the application performance, response speed, page display, etc. Therefore, in order to provide users with a stable and consistent user experience, it is necessary to ensure that the application has the same performance for the same application page scenario in different network environments or different clients, that is, the application needs to be tested in different network environments or clients.
[0003] However, in the related art, when testing applications in different network environments or clients, testers need to manually build different test environments to verify the display pages and processing logic of application page scenarios in different networks and clients. This process needs to be performed manually, which takes a lot of time when there are many test contents, and it is easy to have errors in setting the verification environment, resulting in inaccurate verification. That is, the application page detection method provided by the related art has the problem of low efficiency.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method and device for detecting an application page, a storage medium, and an electronic device, so as to at least solve the technical problem that the application page detection method provided by the related art has low efficiency.
[0006] According to one aspect of an embodiment of the present application, a method for detecting an application page is provided, including: obtaining multiple target page files displayed by a target page in a target client under multiple network environments, wherein the network environments correspond to the target page files one by one; comparing any two of the multiple target page files, moving the target page files that meet a preset comparison condition to a candidate folder, and moving the target page files that do not meet the preset comparison condition to a first abnormal folder; obtaining a reference folder corresponding to the target page in a reference client, wherein each reference page file in the reference folder is used to indicate a page file that meets the preset comparison condition and is obtained by the reference client in a network environment; comparing the reference page file with the target page file in the candidate folder, and moving the reference page file and the target page file that do not meet the preset comparison condition to a second abnormal folder; and determining that the target page passes the detection when the target page file does not exist in the first abnormal folder, and when the reference page file and the target page file do not exist in the second abnormal folder.
[0007] According to another aspect of an embodiment of the present application, a detection device for an application page is also provided, including: a target page file acquisition unit, used to acquire multiple target page files displayed by a target page in a target client under multiple network environments, wherein the network environments correspond to the target page files one by one; a first comparison unit, used to compare any two target page files among the multiple target page files, move the target page files that meet the preset comparison conditions to a candidate folder, and move the target page files that do not meet the preset comparison conditions to a first abnormal folder; a reference folder acquisition unit, used to acquire a reference folder corresponding to the target page in a reference client, wherein each reference page file in the reference folder is used to indicate a page file that meets the preset comparison conditions and is acquired by the reference client in a network environment; a second comparison unit, used to compare the reference page file with the target page file in the candidate folder, respectively, and move the reference page file and the target page file that do not meet the preset comparison conditions to a second abnormal folder; a detection judgment unit, used to determine that the target page passes the detection when the target page file does not exist in the first abnormal folder, and the reference page file and the target page file do not exist in the second abnormal folder.
[0008] Optionally, the above-mentioned first comparison unit includes: a target file combination module, which is used to select all combinations of two target page files from N target page files to obtain H target page file combinations, where N is a positive integer and H is a positive integer; a target operation execution module, which is used to traverse the H target page file combinations, take each target page file combination in the H target page file combinations as the kth target page file combination in turn, and perform the following operations: compare the two target page files in the kth target page file combination to obtain a corresponding first comparison result, where k is an integer greater than or equal to 1 and less than or equal to H; a first set composition module, which is used to obtain a first comparison result set composed of the first comparison results corresponding to each of the H target page file combinations after the operation is performed on the Hth target page file combination.
[0009] Optionally, the target operation execution module is further used to: obtain the first image data, the first text data, the second image data and the second text data corresponding to each of the two target page files in the kth target page file combination, wherein the first image data and the first text data indicate the same target page file, and the second image data and the second text data indicate the same target page file; obtain a first histogram corresponding to the first image data and a second histogram corresponding to the second image data, and compare the first histogram and the second histogram to obtain a target image comparison value corresponding to the kth target page file combination; compare the first text data and the second text data to obtain a target text comparison value corresponding to the kth target page file combination; and determine a first comparison result based on the target image comparison value and the target text comparison value.
[0010] Optionally, the above-mentioned first comparison unit also includes: an abnormality detection module, which is used to perform abnormality detection on N target page files in turn, and move the target page files whose image data meets the abnormality detection conditions to a third abnormality folder to obtain multiple updated target page files, wherein the abnormality detection conditions are used to indicate the image quality of the image data.
[0011] Optionally, the above-mentioned second comparison unit includes: a reference file combination module, which is used to select all combinations of two reference page files and a target page file from M reference page files and multiple target page files to obtain L reference page file combinations, where M is a positive integer and L is a positive integer; a reference operation execution module, which is used to traverse the L reference page file combinations, take each reference page file combination in the L reference page file combinations as the jth reference page file combination in turn, and perform the following operations: compare the reference page file and the target page file in the jth reference page file combination to obtain a corresponding second comparison result, where j is an integer greater than or equal to 1 and less than or equal to L; a second set composition module, which is used to obtain a second comparison result set composed of the second comparison results corresponding to each of the L reference page file combinations after the operation is performed on the Lth reference page file combination.
[0012] Optionally, the reference operation execution module is further used to: obtain the third image data, third text data, fourth image data and fourth text data corresponding to the reference page file and the target page file in the jth reference page file combination, wherein the third image data and the third text data indicate the same reference file or target page file, and the fourth image data and the fourth text data indicate the same reference file or target page file; obtain a third histogram corresponding to the third image data and a fourth histogram corresponding to the fourth image data, and compare the third histogram with the fourth histogram to obtain a reference image comparison value corresponding to the jth reference page file combination; compare the third text data with the fourth text data to obtain a reference text comparison value corresponding to the jth reference page file combination; and determine a second comparison result based on the reference image comparison value and the reference text comparison value.
[0013] Optionally, the target page file acquisition unit includes: a network traversal module, used to traverse N network environments, taking each of the N network environments as the qth network environment in turn, and after performing the operation on the Nth network environment, obtaining N target page files corresponding to the N network environments, wherein q is an integer greater than or equal to 1 and less than or equal to N; a loading module, used to load the target page in the qth network environment; a page file generation module, used to obtain the image data and text data of the target page in the qth network environment, and generate the target page file.
[0014] Optionally, the above-mentioned network traversal module is also used to: determine the first type of mobile communication network environment as the first network environment; when the first type of mobile communication network environment is closed, determine the second type of mobile communication network environment as the second network environment; when the wireless communication network is turned on, determine the wireless communication network environment as the third network environment; obtain the bandwidth delay and network transmission parameters of the basic bandwidth, and determine the fourth network environment based on the bandwidth delay and network transmission parameters.
[0015] Optionally, the above-mentioned loading module is also used to: obtain the network address of the target page, and load the target page through the network address of the target page; obtain the operation combination corresponding to the target page, and load the target page by executing the operation combination, wherein the operation combination is used to indicate a combination of simulated operations performed on the client.
[0016] Optionally, the page file generation module is further used to: capture the display interface of the target page in the qth network environment as image data; obtain text information displayed on the target page in the qth network environment, and use the text information as text data.
[0017] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned application page detection method when running.
[0018] According to another aspect of the embodiments of the present application, a computer program product is provided, the computer program product including a computer program / instruction, the computer instruction being stored in a computer-readable storage medium. A processor of a computer device reads the computer program / instruction from the computer-readable storage medium, and the processor executes the computer program / instruction, so that the computer device performs the above detection method for application pages.
[0019] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned application page detection method through the above-mentioned computer program.
[0020] In an embodiment of the present application, a plurality of target page files displayed respectively in a plurality of network environments of a target page in a target client are obtained, wherein the network environments correspond to the target page files one by one; any two target page files among the plurality of target page files are compared, and the target page files that meet the preset comparison conditions are moved to a candidate folder, and the target page files that do not meet the preset comparison conditions are moved to a first abnormal folder; a reference folder corresponding to the target page in a reference client is obtained, wherein each reference page file in the reference folder is used to indicate a page file that meets the preset comparison conditions obtained by the reference client in a network environment; the reference page file and the target page file in the candidate folder are compared respectively, and the reference page file and the target page file that do not meet the preset comparison conditions are moved to a second abnormal folder; when the target page file does not exist in the first abnormal folder, and the reference page file and the target page file do not exist in the second abnormal folder, it is determined that the target page passes the detection. The above method solves the technical problem that the application page detection method provided by the related art has low efficiency.
[0021] In an embodiment of the present application, for a page to be tested, it can be used as a target page, and the target page can be accessed in a client based on different network environments to obtain the target page files of the target page under different network environments. Different target page files are used for mutual comparison, and the target page files whose comparison results do not meet the preset comparison conditions are placed in the first abnormal folder, and the target page files that meet the preset comparison conditions are placed in the candidate folder to facilitate the subsequent comparison of different clients. The reference page files of the target pages under different clients can be obtained, and the reference page files and the target page files are compared to move the reference page files and the target page files that do not meet the preset comparison conditions to the second abnormal folder. The files in the first abnormal folder and the second abnormal folder do not meet the preset comparison conditions. When there are files in them, it can be considered that the display pages or text information of the target page in different networks or clients are different, and the same and stable performance cannot be achieved under different working conditions. In the case where there is no page file, it is considered that the target page can achieve stable performance in the client of the tested network environment. In this way, it is possible to automatically detect whether the processing logic of the target page under different working conditions is correct, improve the detection efficiency, and reduce the labor cost to achieve the stability and consistency of the target page. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0023] Figure 1 is a schematic diagram of a hardware environment of an optional application page detection method according to an embodiment of the present application;
[0024] Figure 2 is a flow chart of an optional application page detection method according to an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of an optional application page detection method according to an embodiment of the present application;
[0026] Figure 4 is a schematic diagram of another optional application page detection method according to an embodiment of the present application;
[0027] Figure 5 is a schematic diagram of another optional application page detection method according to an embodiment of the present application;
[0028] Figure 6 is a schematic diagram of an optional application page detection device according to an embodiment of the present application;
[0029] Figure 7 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] According to one aspect of the embodiments of the present application, a method for detecting an application page is provided. As an optional implementation, the above-mentioned method for detecting an application page can be applied to, but is not limited to, Figure 1 The detection system of the application page in the hardware environment shown in FIG. The detection system of the application page may include but is not limited to the terminal device 102, the network 110, the server 112, the database 114, and the terminal device 118. The terminal device 102 runs a target program (such as Figure 1As shown, taking the target program as a program that can detect application pages as an example). The above-mentioned terminal device 102 includes a display 108, a processor 106 and a memory 104. The display 108 can be used to display the target page under different working conditions, etc., and is also used to provide a human-computer interaction interface to receive touch human-computer interaction operations on different information. The processor is used to generate an interaction instruction in response to the above-mentioned human-computer interaction operation, and send the interaction instruction to the server to obtain the stored target page file and reference page file. The memory is used to store data such as image data and text data of the target page displayed by the running client. The above-mentioned terminal device 118 includes a display 120, a processor 122, and a memory 124. The client can be run in the terminal device 118, and the target page can be accessed through the client.
[0033] In addition, the server 112 includes a processing engine 116, which is used to perform storage or reading operations on the database 114. Specifically, the processing engine 116 reads the target page file and the reference page file from the database 114.
[0034] Assumptions Figure 1 A program for detecting the target page of the application is running in the terminal device 102. The specific process of this embodiment is as follows: As in step S102, the terminal device 102 requests the target page file and the reference page file from the server 112 and / or the terminal device 118 through the network 110. The terminal device 102 may be one or more devices; after receiving the request sent by the terminal device 102, the server 112 obtains the relevant information about the target page from the database 114, and sends the target page file and the reference page file to the terminal device 102, or the terminal device 118 obtains the relevant information about the target page from the memory 124, and sends the target page file and the reference page file to the terminal device 102.
[0035] After the terminal device 102 obtains the target page file and the reference page file from the server 112 and / or the terminal device 118, steps S104-S110 are executed in the terminal device 102 to compare any two target page files in the target page file, and move the target page files that meet the preset comparison conditions to the candidate folder, and move the target page files that do not meet the preset comparison conditions to the first abnormal folder. Then, the reference page file is compared with the total target page files in the candidate folder, and the reference page files and target page files that do not meet the preset comparison conditions are moved to the second abnormal folder. Finally, it is determined whether the target page passes the detection based on the files in the first abnormal folder and the second abnormal folder.
[0036] Optionally, in this embodiment, the terminal device 102 may be a terminal device configured with a target program, and may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The terminal device 118 may be a device configured with different clients, and may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The client may be a client that supports the detection task of providing an application page, such as a video client, a browser client, or a client that can access the target page. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network, and a wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment is not limited to this.
[0037] Optionally, in this embodiment, the above-mentioned detection method of application page can be applied to, but not limited to, detecting the core page of an application. In mobile applications, in different usage scenarios, the performance, response speed and page display of the application may be affected by the network and the client. In order to determine whether the core page of an application can have stable performance in different environments, the above-mentioned detection method of application page can be used to detect the core page. The image data and text data displayed by the core page on different clients and different networks can be obtained, and the files corresponding to different environments can be used for comparison to indicate whether the core page of the application is stable and consistent in different environments.
[0038] In an embodiment of the present application, a plurality of target page files displayed respectively in a plurality of network environments of a target page in a target client are obtained, wherein the network environments correspond to the target page files one by one; any two target page files among the plurality of target page files are compared, and the target page files that meet the preset comparison conditions are moved to a candidate folder, and the target page files that do not meet the preset comparison conditions are moved to a first abnormal folder; a reference folder corresponding to the target page in a reference client is obtained, wherein each reference page file in the reference folder is used to indicate a page file that meets the preset comparison conditions obtained by the reference client in a network environment; the reference page file and the target page file in the candidate folder are compared respectively, and the reference page file and the target page file that do not meet the preset comparison conditions are moved to a second abnormal folder; when the target page file does not exist in the first abnormal folder, and the reference page file and the target page file do not exist in the second abnormal folder, it is determined that the target page passes the detection. The above method solves the technical problem that the application page detection method provided by the related art has low efficiency.
[0039] In an embodiment of the present application, for a page to be tested, it can be used as a target page, and the target page can be accessed in a client based on different network environments to obtain the target page files of the target page under different network environments. Different target page files are used for mutual comparison, and the target page files whose comparison results do not meet the preset comparison conditions are placed in the first abnormal folder, and the target page files that meet the preset comparison conditions are placed in the candidate folder to facilitate the subsequent comparison of different clients. The reference page files of the target pages under different clients can be obtained, and the reference page files and the target page files are compared to move the reference page files and the target page files that do not meet the preset comparison conditions to the second abnormal folder. The files in the first abnormal folder and the second abnormal folder do not meet the preset comparison conditions. When there are files in them, it can be considered that the display pages or text information of the target page in different networks or clients are different, and the same and stable performance cannot be achieved under different working conditions. In the case where there is no page file, it is considered that the target page can achieve stable performance in the client of the tested network environment. In this way, it is possible to automatically detect whether the processing logic of the target page under different working conditions is correct, improve the detection efficiency, and reduce the labor cost to achieve the stability and consistency of the target page.
[0040] As an optional implementation, Figure 2 As shown, the above-mentioned application page detection method includes the following steps:
[0041] S202, obtaining a plurality of target page files displayed by the target page in the target client in a plurality of network environments, wherein the network environments correspond to the target page files one by one;
[0042] It should be noted that the target page can be a web page of a mobile application, which can be a core page of the mobile application, such as the homepage of the application, the default opening display page of the application, etc., or it can be a sub-page of the mobile application, such as a page entered by touching the controls in the homepage or sub-page.
[0043] The target client can be software running in a terminal device that can provide local services to users and can perform data transmission with the server to achieve specific functions.
[0044] The target page may include image data and text data indicating the target page.
[0045] In an optional implementation, after the terminal device is determined, a target client may be started in the terminal device, and the target client may be used to access the target webpage to obtain image data and text data of the target webpage to obtain the target page file.
[0046] In an optional implementation, the target page stored in the server or terminal device may be directly obtained and the corresponding target page file may be run in the target client.
[0047] It should be noted that in different network environments, after the target client accesses the target page, the interface displayed on the terminal device may be different, so it is necessary to obtain the page file of the target page in different network environments.
[0048] In an optional implementation, the target page can be accessed by using the target client in a network environment, and the image data and text data of the target page can be obtained to obtain the target page file corresponding to the current network environment. After obtaining the current corresponding target page file, the network environment can be switched, and the target page can be accessed again by using the target client, and the image data and text data of the currently displayed target page can be obtained as the corresponding target page file.
[0049] In an optional implementation, when the target page needs to be detected, the target page file corresponding to the target page in the different network environments can be directly obtained from the server.
[0050] It should be noted that the image data of the target page may be different images of the target page, page composition and other information, such as indicating different modules on the target page. In an optional embodiment, different modules in the page may correspond to different types of interaction intent. The application may be operated through touch commands received by different modules. Therefore, the image data may indicate the module arrangement in the target page, the display interval of the module, the display of the module, etc.
[0051] It should be noted that the text data of the target page can be the text displayed in different parts of the target page, such as relevant information in the header of the target page (interface name, logo, etc.), navigation information, etc. The text displayed in the target page that can provide instructions to the user can be regarded as text information. Extracting and storing the text information will obtain text data.
[0052] Figure 3 is a schematic diagram of an optional application page detection method according to an embodiment of the present application; Figure 3 As shown, after the target page is opened by the target client, the target page can be displayed in the terminal device, and the resources of the target page can be acquired to obtain the image data 302 and text data 304 of the target page.
[0053] The method of obtaining the image data and text data of the target page under different networks will be described in detail below and will not be repeated here.
[0054] S204, comparing any two target page files among the multiple target page files, moving the target page files that meet the preset comparison condition to the candidate folder, and moving the target page files that do not meet the preset comparison condition to the first abnormal folder;
[0055] It should be noted that after obtaining the target page files of the target client in different network environments, the corresponding image data and text data in the different network environments can be loaded for one-by-one comparison and detection.
[0056] In an optional implementation, after obtaining N target page files, any two target page files can be compared. After comparing every two target page files, a first comparison result can be obtained, and after comparing all target page files, a set of first comparison results (first comparison result set) can be obtained. Wherein, N is a positive integer.
[0057] In an optional implementation, the two target page files are compared, and the image data and text data in the two target page files can be compared respectively. The similarity between the image data and the overlap between the text data can be compared to determine the first comparison result.
[0058] In an optional implementation, by comparing any two target page files among multiple target page files, the first comparison result corresponding to any two target page files can be obtained as above, that is, a first comparison result set is obtained, and the first comparison result in the first comparison result set can be compared with a preset comparison condition.
[0059] In an optional embodiment, the preset comparison condition may be that the first comparison result is considered to satisfy the preset comparison condition within a preset result interval. The result interval may be preset, and the standard for page detection may be constrained by setting the result interval. For example, for a core page, it may be hoped that it can be displayed nearly consistently in different environments, and the preset result interval may be set at 99%-100% to improve the detection standard. Only if the first comparison result is within this interval will the target page be considered stable. For example, for a partial function page, it may be hoped that it can display most of the functions, and the preset result interval may be set at 90%-100%, which relaxes the interval range compared to the core page.
[0060] In an optional implementation, when the first comparison result meets the preset comparison condition, the corresponding two target page files can be placed in a candidate folder, and the two target page files can be named according to the network environment, the name of the target client, etc., for easy viewing.
[0061] In an optional implementation, when the first comparison result does not meet the preset comparison condition, the corresponding two target page files can be placed in the first abnormal folder, and the two target page files can be named according to the network environment, the name of the target client, etc. Or the current network environment and the target client can be recorded in a specified file.
[0062] S206, obtaining a reference folder corresponding to the target page in the reference client, wherein each reference page file in the reference folder is used to indicate a page file that meets a preset comparison condition and is obtained by the reference client in a network environment;
[0063] It should be noted that the reference client can be software that can be run in the terminal device other than the target client, and can provide local services to users and can perform data transmission with the server to achieve specific functions.
[0064] In an optional implementation, the reference folder may be a folder containing M reference page files, and the reference page files may be image data and text data of target pages that have been detected in different network environments and meet preset comparison conditions, wherein M is a positive integer.
[0065] In an optional implementation, the reference folder may be a reference page file corresponding to a reference client, which may be a page file that meets preset comparison conditions after the target page runs in the reference client and obtains image data and text data in different network environments and compares different environments.
[0066] In an optional implementation, the reference folder may be a reference page file corresponding to multiple reference clients, or a page file corresponding to each reference client in a different network environment that meets a preset comparison condition, or a page file that meets a preset comparison condition after an overall comparison of page files corresponding to different reference clients.
[0067] S208, comparing the reference page file and the target page file in the candidate folder respectively, and moving the reference page file and the target page file that do not meet the preset comparison condition to a second abnormal folder;
[0068] It should be noted that after obtaining the reference folder, the reference page file can be compared with the target page file in the candidate folder, and the preset comparison condition can be the same as that set when detecting the network environment above, or can be set differently.
[0069] In an optional implementation, when the second comparison result meets the preset comparison condition, the corresponding reference page file and the target page file can be placed in a result folder. When the second comparison result does not meet the preset comparison condition, the corresponding reference page file and the target page file can be placed in a second abnormal folder. The second abnormal folder can be the same folder as the first abnormal folder, or it can be a different folder.
[0070] S210 , when there is no target page file in the first abnormal folder and there are no reference page file and target page file in the second abnormal folder, determining that the target page passes the detection.
[0071] It should be noted that, in the case where the reference page file and the target page file do not exist in the first abnormal folder and the second abnormal folder, it can be considered that the reference page file and the target page file meet the preset comparison condition, and therefore, it can be considered that the target page is stable and consistent in different network environments and clients. It is determined that the target page passes the detection.
[0072] In an embodiment of the present application, a plurality of target page files displayed respectively in a plurality of network environments of a target page in a target client are obtained, wherein the network environments correspond to the target page files one by one; any two target page files among the plurality of target page files are compared, and the target page files that meet the preset comparison conditions are moved to a candidate folder, and the target page files that do not meet the preset comparison conditions are moved to a first abnormal folder; a reference folder corresponding to the target page in a reference client is obtained, wherein each reference page file in the reference folder is used to indicate a page file that meets the preset comparison conditions obtained by the reference client in a network environment; the reference page file and the target page file in the candidate folder are compared respectively, and the reference page file and the target page file that do not meet the preset comparison conditions are moved to a second abnormal folder; when the target page file does not exist in the first abnormal folder, and the reference page file and the target page file do not exist in the second abnormal folder, it is determined that the target page passes the detection. The above method solves the technical problem that the application page detection method provided by the related art has low efficiency.
[0073] In an embodiment of the present application, for a page to be tested, it can be used as a target page, and the target page can be accessed in a client based on different network environments to obtain the target page files of the target page under different network environments. Different target page files are used for mutual comparison, and the target page files whose comparison results do not meet the preset comparison conditions are placed in the first abnormal folder, and the target page files that meet the preset comparison conditions are placed in the candidate folder to facilitate the subsequent comparison of different clients. The reference page files of the target pages under different clients can be obtained, and the reference page files and the target page files are compared to move the reference page files and the target page files that do not meet the preset comparison conditions to the second abnormal folder. The files in the first abnormal folder and the second abnormal folder do not meet the preset comparison conditions. When there are files in them, it can be considered that the display pages or text information of the target page in different networks or clients are different, and the same and stable performance cannot be achieved under different working conditions. In the case where there is no page file, it is considered that the target page can achieve stable performance in the client of the tested network environment. In this way, it is possible to automatically detect whether the processing logic of the target page under different working conditions is correct, improve the detection efficiency, and reduce the labor cost to achieve the stability and consistency of the target page.
[0074] In an optional implementation, the above-mentioned comparison of any two target page files from multiple target page files includes: selecting all combinations of two target page files from N target page files to obtain H target page file combinations, where N is a positive integer and H is a positive integer; traversing the H target page file combinations, taking each target page file combination in the H target page file combinations as the kth target page file combination in turn, and performing the following operations: comparing the two target page files in the kth target page file combination to obtain a corresponding first comparison result, where k is an integer greater than or equal to 1 and less than or equal to H; after the operation is performed on the Hth target page file combination, a first comparison result set consisting of the first comparison results corresponding to each of the H target page file combinations is obtained.
[0075] In an optional implementation, after obtaining the target page files of the target client under different network environments, the target page files can be combined in pairs to obtain a target page file combination. The H target page file combinations are traversed to compare the two target page files in each target page file combination to obtain a corresponding first comparison result. After the traversal is completed, the first comparison result corresponding to each target page file combination is obtained to generate a first comparison result set.
[0076] Through the above implementation of the present application, the N target page files corresponding to the target page obtained by the target client under different network environments can be compared in pairs, and the first comparison result corresponding to each target page file combination can be obtained, so that the target page file corresponding to the first comparison result can be found later. This improves the accuracy of dividing the target page files into corresponding folders, thereby improving the accuracy of target page detection. In addition, during the detection process, there is no need to separately design and verify the corresponding page files under each network environment, and it is not necessary to pay attention to whether a single page is correct, so as to improve the accuracy of target page detection.
[0077] In an optional embodiment, the above-mentioned comparison of two target page files in the kth target page file combination to obtain a corresponding first comparison result includes: obtaining first image data, first text data, second image data, and second text data corresponding to each of the two target page files in the kth target page file combination, wherein the first image data and the first text data indicate the same target page file, and the second image data and the second text data indicate the same target page file; obtaining a first histogram corresponding to the first image data and a second histogram corresponding to the second image data, and comparing the first histogram and the second histogram to obtain a target image comparison value corresponding to the kth target page file combination; comparing the first text data and the second text data to obtain a target text comparison value corresponding to the kth target page file combination; and determining the first comparison result based on the target image comparison value and the target text comparison value.
[0078] It should be noted that the histogram of an image is a graph that can indicate the brightness or color distribution of pixels in an image. For a color image, there are usually three color channels. After obtaining two target page files in a target page file combination, the first image data and the second image data corresponding to the two target page files can be obtained, and the first histogram of the first image data and the second histogram of the second image data can be obtained.
[0079] In an optional embodiment, the first histogram and the second histogram may be compared to obtain a target image contrast value. As described above, the histogram may display the number of pixels or color values of each brightness or color in the image, and the square of the difference in the number of pixels at corresponding positions between the first histogram and the second histogram may be calculated. All square errors are summed, and the sum is divided by the total number of pixels to obtain a mean value, and the mean value is squared to obtain a root mean square error.
[0080] In an optional implementation, the first text data and the second text data corresponding to the two target page files in a target page file combination may be obtained. The text data may be stored in a text file (text, txt) format or in a table (list) format.
[0081] In an optional implementation, the cosine similarity between the first text data and the second text data may be used as the target text comparison value, or the Euclidean distance between the first text data and the second text data may be used as the target text comparison value.
[0082] In an optional embodiment, the first image data and the second image data can be processed using an image processing model to obtain a target image contrast value. The image processing model can be a pre-trained image model, or it can be an image processing model obtained by fine-tuning the pre-trained image processing model using the image data corresponding to the page.
[0083] In an optional implementation, the first text data and the second text data may be processed using a text processing model to obtain a target text comparison value. The text processing model may be a pre-trained text model, or a text processing model obtained by fine-tuning a pre-trained text processing model using text data corresponding to the page.
[0084] In an optional implementation, the obtained target image contrast value and target text contrast value may be weighted and summed to determine the first contrast result. The first contrast result may also be determined based on the first image data, the second image data, the first text data, and the second text data using a multimodal model. The graphic features of different data may be feature extracted to perform graphic feature processing to obtain the first contrast result.
[0085] Through the above implementation of the present application, the first image data, the second image data, the first text data and the second text data corresponding to the two target page files in a target page file combination can be used to perform similarity calculation to obtain a first comparison result between the two target page files. By comparing the image data and the text data in combination, the accuracy of the first comparison result is improved, thereby improving the accuracy of subsequent detection.
[0086] In an optional embodiment, before comparing the two target page files in the kth target page file combination to obtain the corresponding first comparison result, it includes: performing anomaly detection on the N target page files in turn, moving the target page files whose image data meets the anomaly detection conditions to a third anomaly folder, and obtaining multiple updated target page files, wherein the anomaly detection conditions are used to indicate the image quality of the image data.
[0087] In an optional implementation, after switching different networks in a client and accessing the target page, an abnormality detection can be performed on the target page, such as a preliminary detection of common abnormalities of the page, such as a blank screen or blank blocks on the target page, overlapping text, blocked images and text, garbled characters, etc. If the target page meets the abnormality detection conditions after abnormality detection, it is considered that the target page has an abnormality under the current environment.
[0088] In an optional implementation, the abnormality detection condition can be determined according to the items to be detected. For example, when detecting a blank screen or a blank block, the abnormality detection condition can be set to the presence of an abnormal white block. The element outline in the confirmation page can be located on the original image pixel point, or the white area can be distinguished by the boundary. In the case of the presence of a blank block, it can be considered that the target page in the current environment is abnormal, and the target page in the current environment can be named according to the network environment, client, etc. and stored in a third abnormal folder. The third abnormal folder can be the same folder as the first abnormal folder and the second abnormal folder, or it can be a separate folder.
[0089] In an optional embodiment, anomaly detection can be performed on image data in the target page file after the target page file is acquired, or anomaly detection can be performed directly after the target page is accessed, and the image data and text data of the target page that pass the anomaly detection can be acquired to generate the target page file.
[0090] Through the above-mentioned implementation mode of the present application, before comparing the target page files corresponding to different network environments, anomaly detection can be performed on the target pages under different network environments, so as to screen out the target pages with common anomalies in advance, save resources in subsequent target page comparisons, improve comparison efficiency, and thereby improve page detection efficiency.
[0091] In an optional implementation, after comparing N target page files corresponding to the target client in N network environments and dividing each target page file into candidate folders and a first abnormal folder according to preset comparison conditions, a reference folder corresponding to the target page in the reference client can be obtained.
[0092] It should be noted that the reference folder may be a folder corresponding to one reference client or may be a folder corresponding to multiple reference clients.
[0093] In an optional implementation, the page files corresponding to each reference client under different network environments can be obtained, and the page files under different network environments of each reference client can be compared, and the page files that meet the preset comparison conditions can be moved to an abnormal folder, and the page files that do not meet the preset comparison conditions can be moved to a candidate folder corresponding to the reference client.
[0094] In an optional implementation, the abnormal folder can be named according to the name of the reference client, or the page files that do not meet the preset comparison conditions can be placed in a unified abnormal folder. The candidate folder can also be named according to the name of the reference client, or the page files that meet the preset comparison conditions can be placed in a unified candidate folder.
[0095] In an optional implementation, the page files in the candidate folder corresponding to at least one reference client may be compared, and the page files that meet the preset comparison conditions after comparison may be moved to the reference folder as reference page files. Alternatively, all the page files in the candidate folder may be moved to the reference folder as reference page files.
[0096] In an optional implementation, the above-mentioned comparing the reference page file and the target page file in the candidate folder respectively includes: selecting all combinations of two reference page files and the target page file from M reference page files and multiple target page files to obtain L reference page file combinations, where M is a positive integer and L is a positive integer; traversing the L reference page file combinations, taking each reference page file combination in the L reference page file combinations as the jth reference page file combination in turn, and performing the following operations: comparing the reference page file in the jth reference page file combination with the target page file to obtain a corresponding second comparison result, where j is an integer greater than or equal to 1 and less than or equal to L; after completing the operation on the Lth reference page file combination, a second comparison result set consisting of the second comparison results corresponding to each of the L reference page file combinations is obtained.
[0097] In an optional implementation, after obtaining a reference page file corresponding to at least one reference client, the reference page file can be used to compare with the target page file in the candidate folder, the reference page file and the target page file can be randomly combined to obtain a reference page file combination, and the two page files in each reference page file combination can be compared to obtain a corresponding second comparison result.
[0098] In an optional implementation, after obtaining the reference page file corresponding to at least one reference client, the target page file and the reference page file in the candidate folder can be put together into a list to be combined, and two reference page files or the reference page file and the target page file can be combined to obtain a reference page file combination, and the page files in the reference page file combination can be compared to obtain a corresponding second comparison result.
[0099] Through the above-mentioned implementation mode of the present application, the reference page files obtained after network environment detection in different clients can be compared with the target page files, and the stability of the target page in different clients can be detected. Through pair-by-pair comparison, abnormal page files can be automatically detected, and the corresponding target client or reference client, as well as the corresponding network environment, can be indicated to realize automatic detection and improve the detection efficiency of the target page.
[0100] In an optional embodiment, the above-mentioned comparison of the reference page file and the target page file in the j-th reference page file combination to obtain the corresponding second comparison result includes: obtaining the third image data, the third text data, the fourth image data and the fourth text data corresponding to the reference page file and the target page file in the j-th reference page file combination, respectively, wherein the third image data and the third text data indicate the same reference file or target page file, and the fourth image data and the fourth text data indicate the same reference file or target page file; obtaining a third histogram corresponding to the third image data and a fourth histogram corresponding to the fourth image data, and comparing the third histogram with the fourth histogram to obtain a reference image comparison value corresponding to the j-th reference page file combination; comparing the third text data with the fourth text data to obtain a reference text comparison value corresponding to the j-th reference page file combination; and determining the second comparison result based on the reference image comparison value and the reference text comparison value.
[0101] As described above, the image data and text data of the page files can be used to determine the image contrast value and text contrast value between the two page files, so as to determine the second contrast result using the image contrast value and text contrast value. The process of determining the second contrast result can be similar to the process of determining the first contrast result.
[0102] Figure 4 is a schematic diagram of another optional application page detection method according to an embodiment of the present application; Figure 4 As shown, by using the target client to load the target page under different network environments, multiple target page files can be obtained, and the target page files can be combined in pairs to obtain multiple target page file combinations. The target page files in the target page file combination are compared according to the image data and the text data, and the target page file combination that meets the preset comparison conditions is stored in the candidate folder, and the target page file combination that does not meet the preset comparison conditions is stored in the first abnormal folder.
[0103] like Figure 4 As shown, when the candidate folder is determined, the target page can be loaded synchronously or asynchronously in at least one reference client under different network environments, and according to the above method, the page file combination that meets the preset comparison conditions in different reference clients is stored in the reference folder, and the page file combination that does not meet the preset comparison conditions is stored in the first abnormal folder. The network environment corresponding to the target page file in the first abnormal folder may be abnormal, which can be recorded.
[0104] like Figure 4As shown, the target page files in the candidate folder and the reference page files in the reference folder can be combined in pairs to obtain a reference page file combination, and the page files that do not meet the preset comparison conditions are stored in the second abnormal folder. The client corresponding to the page file in the second abnormal folder may be abnormal, which can be recorded.
[0105] The client and network environment corresponding to the page files in the first abnormal folder and the second abnormal folder are recorded as a scenario in which the verification fails.
[0106] In an optional embodiment, the above-mentioned method of obtaining multiple target page files that are displayed respectively in multiple network environments for the target page in the target client includes: traversing N network environments, taking each of the N network environments as the qth network environment in turn, and performing the following operations: loading the target page in the qth network environment; obtaining the image data and text data of the target page in the qth network environment, and generating a target page file; after performing the operation on the Nth network environment, obtaining N target page files corresponding to each of the N network environments, wherein q is an integer greater than or equal to 1 and less than or equal to N.
[0107] In an optional implementation, before the above-mentioned traversal of N network environments, at least one of the following is included: determining the first type of mobile communication network environment as the first network environment; when the first type of mobile communication network environment is closed, determining the second type of mobile communication network environment as the second network environment; when the wireless communication network is turned on, determining the wireless communication network environment as the third network environment; obtaining the bandwidth delay and network transmission parameters of the basic bandwidth, and determining the fourth network environment based on the bandwidth delay and network transmission parameters.
[0108] It should be noted that before simulating different network environments, the network environment needs to be configured first to facilitate switching between different network environments. The network environment can be configured as needed, such as configuring a mobile network, a wireless network, or a custom network.
[0109] In an optional implementation, the first type of mobile communication network card can be placed in a hardware module corresponding to the terminal device, and a command line tool can be used to call the mobile communication network to determine the first type of mobile communication network environment as the first network environment. The first type of mobile communication network environment can be a 5G network.
[0110] In an optional implementation, the second type of mobile communication network card can be placed in the hardware module of the terminal device, and the first type of mobile communication network card can be turned off, so that after calling the mobile communication network using a command line tool, the second mobile communication network environment can be determined as the second network environment. The second type of mobile communication network environment can be a 4G network.
[0111] In an optional implementation, a wifi network card may be placed in a hardware module of the terminal device, and after calling the wireless communication network using a command line tool, the wireless communication network environment may be determined as the third network environment.
[0112] Figure 5 is a schematic diagram of another optional application page detection method according to an embodiment of the present application; Figure 5 As shown in (a) of FIG. 1 , the network environment currently running on the terminal device is the first type of mobile communication network environment 502, and its indication information can be displayed. In response to the operation of starting the wireless communication network, the network environment can be switched to the wireless communication network 504 (such as Figure 5 The network environment in which the terminal device operates may be determined as the wireless communication network 504, and the corresponding indication information may be displayed.
[0113] In an optional implementation, a weak network environment can be simulated, that is, an environment with unstable network connection or slow network speed can be simulated. In a weak network environment, the page may be slow to load, etc. Therefore, a weak network environment can be simulated to further detect the target page. The python-based mitmproxy proxy tool can be used for simulation. The bandwidth delay time and network transmission parameters that you want to simulate can be obtained. For example, if you want to simulate a delay of 2 seconds, you can use "set delay=2" to achieve the time delay. If you want to limit the bandwidth speed, you can use "set bandwidth=100" to simulate a speed of 100kb per second. The above is only an optional implementation, and is not limited to setting the network environment in the above manner.
[0114] In an optional implementation, the above network environment can be encapsulated into a fixed interface API, and the network environment can be switched using a pre-set script. For example, the network switching script can be written using the Appium test tool, so that when the network switching API is called, the network environment can be automatically switched upon receiving the network identifier corresponding to the network environment.
[0115] Through the above implementation of the present application, different network environments can be set up and placed in an interface API module. The API can be directly called to achieve fast switching of the network, thereby improving detection efficiency.
[0116] In an optional embodiment, the above-mentioned loading of the target page in the qth network environment includes at least one of the following: obtaining the network address of the target page, and loading the target page through the network address of the target page; obtaining the operation combination corresponding to the target page, and loading the target page by executing the operation combination, wherein the operation combination is used to indicate a combination of simulated operations performed on the client.
[0117] In an optional implementation, after switching the network environment, the target page in the different network environment can be accessed, either directly through the network address of the target page or through a corresponding operation combination.
[0118] In an optional implementation, the network address of the target page can be determined using the Schema URL protocol. The Schema URL is a page jump protocol that can define a unique corresponding protocol for an application, and can directly jump to a page in the application, and addressing access can be automatically completed through the specified fields in the protocol.
[0119] In an optional implementation, the operation combination corresponding to the page can be loaded to access the target page through the operation combination. In the application, the corresponding sub-page can be entered or retreated through the touch operation. The touch operation for accessing the target page can be combined and packaged so that when the target page is desired to be accessed, the target page can be accessed directly by loading the touch operation.
[0120] Through the above-mentioned implementation mode of the present application, the target page can be automatically accessed by means of a network address or a combination of operations, without the need to manually repeat operations on the client, thus saving operation resources and improving detection efficiency.
[0121] In an optional implementation, the above-mentioned acquisition of image data and text data of the target page in the qth network environment includes: intercepting the display interface of the target page in the qth network environment as image data; acquiring the text information displayed by the target page in the qth network environment, and using the text information as text data.
[0122] In an optional implementation, in different network environments, after accessing the target page, the terminal device can be used to take a screenshot of the currently displayed page to obtain image data, and the image data can be saved to a storage address corresponding to the terminal device, and then the image data can be sent to the server. When using the image data, the program can be used to obtain the image data from the server or the memory of the terminal device.
[0123] In an optional embodiment, when acquiring image data, different methods can be used according to different systems. For example, when taking screenshots of an Android system page, a command line tool (Android Debug Bridge, ADB) can be used. ADB can communicate with Android applications for debugging, and its "adb shell screencap -p" command can be used to take screenshots of images and store them in a specified address. The image data can be transferred through the "adb pull" command, for example, from a mobile phone terminal for testing to a computer terminal for executing a detection program.
[0124] In an optional implementation, when taking screenshots of pages on an iOS system, a test framework (WebDriver Agent, WDA) can be used. WDA can capture image data on the device running on the client side through the "self.client = wda.Client (wda_url)" command. The acquired image data can also be stored in a specified address through the "self.client.session.screenshot().save(path)" command, such as transferring from the test mobile phone to the computer executing the detection program.
[0125] In an optional implementation, when acquiring text data, different scripts can also be used according to different systems. For example, when acquiring the page layout text of the Android system, the "uiautomator dump" command can be used to acquire the page layout information of the current device application, and a file containing all the elements on the current page can be generated, and the elements can be located by analyzing the text file. The acquired file can be stored in the device. The "adbpull" command is used to transfer the text data.
[0126] In an optional implementation, when acquiring the page layout file of the iOS system, the “self.client.source()” command may be used to acquire the text file.
[0127] In an optional implementation, image data may be stored in a preset image format (such as a png format file), and text data may be stored in a preset text format (such as a txt format). For a text file, it may be stored in the form of a list, such as setting a list according to the position of the top, main part, footer, etc. of a web page, and storing the acquired data in the list.
[0128] Through the above implementation of the present application, image data and text data in different systems can be automatically acquired, so that when performing page detection, data can be acquired from the stored location. When performing detection, the data acquisition script can also be automatically executed to acquire image data and text data, and detect the target page to improve the efficiency of page detection.
[0129] In an embodiment of the present application, for a page to be tested, it can be used as a target page, and the target page can be accessed in a client based on different network environments to obtain the target page files of the target page under different network environments. Different target page files are used for mutual comparison, and the target page files whose comparison results do not meet the preset comparison conditions are placed in the first abnormal folder, and the target page files that meet the preset comparison conditions are placed in the candidate folder to facilitate the subsequent comparison of different clients. The reference page files of the target pages under different clients can be obtained, and the reference page files and the target page files are compared to move the reference page files and the target page files that do not meet the preset comparison conditions to the second abnormal folder. The files in the first abnormal folder and the second abnormal folder do not meet the preset comparison conditions. When there are files in them, it can be considered that the display pages or text information of the target page in different networks or clients are different, and the same and stable performance cannot be achieved under different working conditions. In the case where there is no page file, it is considered that the target page can achieve stable performance in the client of the tested network environment. In this way, it is possible to automatically detect whether the processing logic of the target page under different working conditions is correct, improve the detection efficiency, and reduce the labor cost to achieve the stability and consistency of the target page.
[0130] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0131] According to another aspect of the embodiment of the present application, there is also provided an application page detection device for implementing the above-mentioned application page detection method. Figure 6 As shown, the device comprises:
[0132] A target page file acquisition unit 602 is used to acquire multiple target page files displayed respectively in multiple network environments of a target page in a target client, wherein the network environments correspond one to one with the target page files; a first comparison unit 604 is used to compare any two target page files among the multiple target page files, and move the target page files that meet the preset comparison conditions to a candidate folder, and move the target page files that do not meet the preset comparison conditions to a first abnormal folder; a reference folder acquisition unit 606 is used to acquire a reference folder corresponding to the target page in a reference client, wherein each reference page file in the reference folder is used to indicate a page file that meets the preset comparison conditions and is acquired by the reference client in a network environment; a second comparison unit 608 is used to compare the reference page file with the target page file in the candidate folder, and move the reference page file and the target page file that do not meet the preset comparison conditions to a second abnormal folder; a detection and judgment unit 610 is used to determine that the target page passes the detection when there is no target page file in the first abnormal folder, and there are no reference page file and the target page file in the second abnormal folder.
[0133] Optionally, the first comparison unit 604 includes: a target file combination module, which is used to select all combinations of two target page files from N target page files to obtain H target page file combinations, where N is a positive integer and H is a positive integer; a target operation execution module, which is used to traverse the H target page file combinations, take each target page file combination in the H target page file combinations as the kth target page file combination in turn, and perform the following operations: compare the two target page files in the kth target page file combination to obtain a corresponding first comparison result, where k is an integer greater than or equal to 1 and less than or equal to H; a first set composition module, which is used to obtain a first comparison result set composed of the first comparison results corresponding to the H target page file combinations after the operation is performed on the Hth target page file combination.
[0134] Optionally, the target operation execution module is further used to: obtain the first image data, the first text data, the second image data and the second text data corresponding to each of the two target page files in the kth target page file combination, wherein the first image data and the first text data indicate the same target page file, and the second image data and the second text data indicate the same target page file; obtain a first histogram corresponding to the first image data and a second histogram corresponding to the second image data, and compare the first histogram and the second histogram to obtain a target image comparison value corresponding to the kth target page file combination; compare the first text data and the second text data to obtain a target text comparison value corresponding to the kth target page file combination; and determine a first comparison result based on the target image comparison value and the target text comparison value.
[0135] Optionally, the above-mentioned first comparison unit 604 also includes: an abnormality detection module, which is used to perform abnormality detection on N target page files in turn, and move the target page files whose image data meets the abnormality detection conditions to a third abnormality folder to obtain multiple updated target page files, wherein the abnormality detection conditions are used to indicate the image quality of the image data.
[0136] Optionally, the second comparison unit 608 includes: a reference file combination module, which is used to select all combinations of two reference page files and a target page file from M reference page files and multiple target page files to obtain L reference page file combinations, where M is a positive integer and L is a positive integer; a reference operation execution module, which is used to traverse the L reference page file combinations, take each reference page file combination in the L reference page file combinations as the jth reference page file combination in turn, and perform the following operations: compare the reference page file in the jth reference page file combination with the target page file to obtain a corresponding second comparison result, where j is an integer greater than or equal to 1 and less than or equal to L; a second set composition module, which is used to obtain a second comparison result set composed of the second comparison results corresponding to each of the L reference page file combinations after the operation is performed on the Lth reference page file combination.
[0137] Optionally, the reference operation execution module is further used to: obtain the third image data, third text data, fourth image data and fourth text data corresponding to the reference page file and the target page file in the jth reference page file combination, wherein the third image data and the third text data indicate the same reference file or target page file, and the fourth image data and the fourth text data indicate the same reference file or target page file; obtain a third histogram corresponding to the third image data and a fourth histogram corresponding to the fourth image data, and compare the third histogram with the fourth histogram to obtain a reference image comparison value corresponding to the jth reference page file combination; compare the third text data with the fourth text data to obtain a reference text comparison value corresponding to the jth reference page file combination; and determine a second comparison result based on the reference image comparison value and the reference text comparison value.
[0138] Optionally, the target page file acquisition unit 602 includes: a network traversal module, which is used to traverse N network environments, and take each of the N network environments as the qth network environment in turn. After the operation is performed on the Nth network environment, N target page files corresponding to the N network environments are obtained, wherein q is an integer greater than or equal to 1 and less than or equal to N; a loading module, which is used to load the target page in the qth network environment; and a page file generation module, which is used to obtain the image data and text data of the target page in the qth network environment, and generate the target page file.
[0139] Optionally, the above-mentioned network traversal module is also used to: determine the first type of mobile communication network environment as the first network environment; when the first type of mobile communication network environment is closed, determine the second type of mobile communication network environment as the second network environment; when the wireless communication network is turned on, determine the wireless communication network environment as the third network environment; obtain the bandwidth delay and network transmission parameters of the basic bandwidth, and determine the fourth network environment based on the bandwidth delay and network transmission parameters.
[0140] Optionally, the above-mentioned loading module is also used to: obtain the network address of the target page, and load the target page through the network address of the target page; obtain the operation combination corresponding to the target page, and load the target page by executing the operation combination, wherein the operation combination is used to indicate a combination of simulated operations performed on the client.
[0141] Optionally, the page file generation module is further used to: capture the display interface of the target page in the qth network environment as image data; obtain text information displayed on the target page in the qth network environment, and use the text information as text data.
[0142] Optionally, in this embodiment, the embodiments to be implemented by the above-mentioned various unit modules can refer to the above-mentioned various method embodiments, which will not be repeated here.
[0143] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned application page detection method is also provided. The electronic device may be Figure 7 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.
[0144] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0145] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0146] S1, obtaining a plurality of target page files displayed by a target page in a target client in a plurality of network environments, wherein the network environments correspond to the target page files one by one;
[0147] S2, comparing any two target page files among the multiple target page files, moving the target page files that meet the preset comparison conditions to the candidate folder, and moving the target page files that do not meet the preset comparison conditions to the first abnormal folder;
[0148] S3, obtaining a reference folder corresponding to the target page in the reference client, wherein each reference page file in the reference folder is used to indicate a page file that meets a preset comparison condition and is obtained by the reference client in a network environment;
[0149] S4, comparing the reference page file and the target page file in the candidate folder respectively, and moving the reference page file and the target page file that do not meet the preset comparison condition to a second abnormal folder;
[0150] S5, when there is no target page file in the first abnormal folder and there are no reference page file and target page file in the second abnormal folder, it is determined that the target page passes the detection.
[0151] Alternatively, a person skilled in the art may understand that: Figure 7The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Figure 7 The electronic device and the electronic equipment described above are not limited in structure. Figure 7 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 7 Different configurations shown.
[0152] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the detection method and device of the application page in the embodiment of the present application. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, realizing the above-mentioned detection method of the application page. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely arranged relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 702 can be specifically, but not limited to, used to store information such as image data and text data. As an example, such as Figure 7 As shown, the memory 702 may include, but is not limited to, the target page file acquisition unit 602, the first comparison unit 604, the reference folder acquisition unit 606, the second comparison unit 608, and the detection and judgment unit 610 in the detection device for the application page. In addition, other module units in the detection device for the application page may also be included but are not limited to, which will not be repeated in this example.
[0153] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0154] In addition, the electronic device further includes: a display 708 for displaying a target page in the interface; and a connection bus 710 for connecting various module components in the electronic device.
[0155] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0156] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.
[0157] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0158] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned application page detection method.
[0159] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0160] S1, obtaining a plurality of target page files displayed by a target page in a target client in a plurality of network environments, wherein the network environments correspond to the target page files one by one;
[0161] S2, comparing any two target page files among the multiple target page files, moving the target page files that meet the preset comparison conditions to the candidate folder, and moving the target page files that do not meet the preset comparison conditions to the first abnormal folder;
[0162] S3, obtaining a reference folder corresponding to the target page in the reference client, wherein each reference page file in the reference folder is used to indicate a page file that meets a preset comparison condition and is obtained by the reference client in a network environment;
[0163] S4, comparing the reference page file and the target page file in the candidate folder respectively, and moving the reference page file and the target page file that do not meet the preset comparison condition to a second abnormal folder;
[0164] S5, when there is no target page file in the first abnormal folder and there are no reference page file and target page file in the second abnormal folder, it is determined that the target page passes the detection.
[0165] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0166] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the above methods in each embodiment of the present application.
[0167] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0168] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0169] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0171] The above are only preferred implementations of the present application. It should be pointed out that ordinary technicians in this technical field can make several improvements and modifications without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for detecting an application page, characterized in that: include: Acquire a plurality of target page files displayed by the target page in the target client in a plurality of network environments, wherein the network environments correspond to the target page files one by one; Comparing any two target page files among the multiple target page files, moving the target page files that meet a preset comparison condition to a candidate folder, and moving the target page files that do not meet the preset comparison condition to a first abnormal folder; Acquire a reference folder corresponding to the target page in a reference client, wherein each reference page file in the reference folder is used to indicate a page file satisfying the preset comparison condition acquired by the reference client in a network environment; Compare the reference page file and the target page file in the candidate folder respectively, and move the reference page file and the target page file that do not meet the preset comparison condition to a second abnormal folder; In a case where the target page file does not exist in the first abnormal folder, and the reference page file and the target page file do not exist in the second abnormal folder, it is determined that the target page file passes the detection.
2. The method according to claim 1, characterized in that The comparing any two target page files among the multiple target page files includes: Select all combinations of two target page files from N target page files to obtain H target page file combinations, where N is a positive integer and H is a positive integer; Traverse the H target page file combinations, take each of the H target page file combinations as the kth target page file combination in turn, and perform the following operations: Comparing the two target page files in the k-th target page file combination to obtain a corresponding first comparison result, wherein k is an integer greater than or equal to 1 and less than or equal to H; When the operation is performed on the Hth target page file combination, a first comparison result set consisting of the first comparison results corresponding to the H target page file combinations is obtained.
3. The method according to claim 2, characterized in that The comparing two target page files in the kth target page file combination to obtain a corresponding first comparison result includes: Acquire first image data, first text data, second image data, and second text data respectively corresponding to two target page files in the kth target page file combination, wherein the first image data and the first text data indicate the same target page file, and the second image data and the second text data indicate the same target page file; Acquire a first histogram corresponding to the first image data and a second histogram corresponding to the second image data, and compare the first histogram with the second histogram to obtain a target image comparison value corresponding to the kth target page file combination; Comparing the first text data with the second text data to obtain a target text comparison value corresponding to the kth target page file combination; A first comparison result is determined based on the target image comparison value and the target text comparison value.
4. The method according to claim 2, characterized in that: Before comparing the two target page files in the kth target page file combination to obtain a corresponding first comparison result, the method includes: Anomaly detection is performed on the N target page files in sequence, and the target page files whose image data meet the anomaly detection condition are moved to a third abnormal folder to obtain the updated multiple target page files, wherein the anomaly detection condition is used to indicate the image quality of the image data.
5. The method according to claim 1, characterized in that The comparing the reference page file with the target page file in the candidate folder respectively includes: Selecting all combinations of two reference page files and the target page files from the M reference page files and the multiple target page files to obtain L reference page file combinations, wherein M is a positive integer and L is a positive integer; Traverse the L reference page file combinations, take each of the L reference page file combinations as the jth reference page file combination in turn, and perform the following operations: Comparing the reference page file in the j-th reference page file combination with the target page file to obtain a corresponding second comparison result, wherein j is an integer greater than or equal to 1 and less than or equal to L; When the operation is performed on the Lth reference page file combination, a second comparison result set consisting of the second comparison results corresponding to each of the L reference page file combinations is obtained.
6. The method according to claim 5, characterized in that The comparing the reference page file in the j-th reference page file combination with the target page file to obtain a corresponding second comparison result includes: Acquire the third image data, the third text data, the fourth image data and the fourth text data respectively corresponding to the reference page file and the target page file in the j-th reference page file combination, wherein the third image data and the third text data indicate the same reference file or the target page file, and the fourth image data and the fourth text data indicate the same reference file or the target page file; Acquire a third histogram corresponding to the third image data and a fourth histogram corresponding to the fourth image data, and compare the third histogram with the fourth histogram to obtain a reference image comparison value corresponding to the j-th reference page file combination; Comparing the third text data with the fourth text data to obtain a reference text comparison value corresponding to the j-th reference page file combination; A second comparison result is determined based on the reference image comparison value and the reference text comparison value.
7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining a plurality of target page files displayed respectively by the target page in the target client under a plurality of network environments includes: Traverse N network environments, take each of the N network environments as the qth network environment in turn, and perform the following operations: Under the qth network environment, loading the target page; Acquire the image data and text data of the target page in the qth network environment, and generate the target page file; When the operation is performed on the Nth network environment, N target page files corresponding to the N network environments are obtained, wherein q is an integer greater than or equal to 1 and less than or equal to N.
8. The method according to claim 7, characterized in that Before traversing the N network environments, at least one of the following is included: Determine the first type of mobile communication network environment as the first network environment; In the case where the first type of mobile communication network environment is closed, determining the second type of mobile communication network environment as the second network environment; In a case where the wireless communication network is turned on, determining the wireless communication network environment as a third network environment; The bandwidth delay and network transmission parameters of the basic bandwidth are obtained, and a fourth network environment is determined based on the bandwidth delay and the network transmission parameters.
9. The method according to claim 7, characterized in that: The step of loading the target page under the qth network environment includes at least one of the following: Obtaining the network address of the target page, and loading the target page through the network address of the target page; An operation combination corresponding to the target page is acquired, and the target page is loaded by executing the operation combination, wherein the operation combination is used to indicate a combination of simulated operations executed on the client.
10. The method according to claim 7, characterized in that The obtaining of the image data and text data of the target page in the qth network environment comprises: intercepting a display interface of the target page in the qth network environment as the image data; The text information displayed by the target page in the qth network environment is obtained, and the text information is used as text data.
11. A detection device for an application page, characterized in that: include: A target page file acquisition unit, used to acquire a plurality of target page files displayed by the target page in the target client in a plurality of network environments, wherein the network environments correspond to the target page files one by one; A first comparison unit, configured to compare any two target page files among the plurality of target page files, move the target page files that meet a preset comparison condition to a candidate folder, and move the target page files that do not meet the preset comparison condition to a first abnormal folder; A reference folder acquisition unit, used to acquire a reference folder corresponding to the target page in a reference client, wherein each reference page file in the reference folder is used to indicate a page file satisfying the preset comparison condition acquired by the reference client in a network environment; A second comparison unit, configured to compare the reference page file with the target page file in the candidate folder, and move the reference page file and the target page file that do not meet the preset comparison condition to a second abnormal folder; The detection and judgment unit is used to determine that the target page passes the detection when the target page file does not exist in the first abnormal folder and the reference page file and the target page file do not exist in the second abnormal folder.
12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 10 through the computer program.
Citation Information
Patent Citations
APP compatibility test method and device, computer equipment and storage medium
CN110347587A
Page evaluation method, model construction method and equipment
CN110837460A
Benchmarking test system, method and device, computer equipment and storage medium
CN114143213A
Method for detecting webpage consistency under different networks and related equipment
CN115297042A
Method and system for detecting application page of mobile terminal
CN117971671A
