A compatibility test method, electronic device and computer readable storage medium

CN116340179BActive Publication Date: 2026-10-23PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310340973.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2026-10-23
Estimated Expiration
2043-03-27

AI Technical Summary

Benefits of technology

[0008]上述技术方案,对于各测试界面图像,将测试界面图像和与测试界面图像对应的录制界面图像进行全图像比对,确定各测试界面图像是否与对应的录制界面图像匹配。故,将各测试界面图像和与各测试界面图像对应的录制界面图像进行全图像比对,即可确定测试界面图像和与测试界面图像对应的录制界面图像是否匹配,即,对包含大量元素需要验证的测试界面图像只需要一次比对即可,而无需将各个元素分别执行验证匹配的过程,提高了对测试界面图像验证的速度,从而提高对测试移动端的兼容性测试的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340179B_ABST
    Figure CN116340179B_ABST
Patent Text Reader

Abstract

The application discloses a compatibility testing method, an electronic device and a computer readable storage medium. The method comprises the following steps: an image comparison server receives a plurality of test interface images sent by a test client; for each test interface image, the test interface image and a recorded interface image corresponding to the test interface image are compared in full image, and a comparison result is obtained; wherein the comparison result is used to indicate whether the test interface image and the recorded interface image corresponding to the test interface image match; in response to any test interface image and the recorded interface image corresponding to the test interface image not matching, it is determined that a target program is incompatible with a test mobile terminal. Through the above method, the efficiency of compatibility testing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and in particular to a compatibility testing method, electronic device, and computer-readable storage medium. Background Technology

[0002] In front-end compatibility testing, conducting compatibility tests on different devices is a very common requirement. Currently, most of these tests are done manually, which requires a lot of manpower and time, and the accuracy of manual testing is not high. Summary of the Invention

[0003] The main technical problem addressed by this application is to provide a compatibility testing method, electronic device, and computer-readable storage medium that can improve the efficiency of compatibility testing.

[0004] To address the aforementioned technical problems, this application provides a compatibility testing method, comprising: an image comparison server receiving several test interface images sent by a test client; wherein the test interface is the interface of a test script running on a test mobile terminal connected to the test client, and the test script is recorded while the target program is running on a recording mobile terminal connected to the recording client; for each test interface image, a full image comparison is performed between the test interface image and the corresponding recorded interface image to obtain a comparison result; wherein the comparison result indicates whether the test interface image and the corresponding recorded interface image match, the recorded interface is the interface of the mobile terminal running the target program when the test script is recorded, and the recorded interface image is sent by the recording client to the script storage server after completing the test script recording, and forwarded by the script storage server to the image comparison server; in response to any mismatch between a test interface image and the corresponding recorded interface image, it is determined that the target program is incompatible with the test mobile terminal.

[0005] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a compatibility testing method, which includes: a script storage server receiving a test script and several recorded interface images sent by a recording client; wherein the test script and several recorded interface images are sent to the script storage server after the recording client completes the recording of the test script, and the recorded interface is the interface of the mobile terminal running the target program when the test script is recorded; sending the test script to several test clients, so that each test client runs the test script and generates several test interface images corresponding to each test client; and sending the several recorded interface images to an image comparison server, so that after receiving several test interface images sent by any test client, the image comparison server performs a full image comparison based on each test interface image and the corresponding recorded interface image to obtain a comparison result, and in response to any mismatch between any test interface image and the recorded interface image corresponding to the test interface image, determines that the target program is incompatible with the test mobile terminal; wherein the test interface is the interface of the test script running on the test mobile terminal connected to the test client.

[0006] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a compatibility testing method, which includes: a test client receiving a test script sent by a script storage server; wherein the test script is recorded while the target program is running on a recording mobile terminal connected to the recording client; running the test script on the test mobile terminal connected to the test client to generate several test interface images; wherein the test interface is the interface of the test mobile terminal when the test script is running; sending several test interface images to an image comparison server, so that the image comparison server performs a full image comparison based on each test interface image and the corresponding recorded interface image to obtain a comparison result, and in response to any mismatch between any test interface image and the recorded interface image corresponding to the test interface image, determining that the target program is incompatible with the test mobile terminal, wherein the comparison result is used to indicate whether the test interface image and the recorded interface image corresponding to the test interface image match, the recorded interface is the interface of the mobile terminal running the target program when the test script is recorded, and the several recorded interface images are sent by the recording client to the script storage server after the test script is recorded, and forwarded to the image comparison server by the script storage server.

[0007] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a compatibility testing method, which includes: a recording client responding to a user's recording instruction to record a test script and generate several recording interface images; wherein the test script is recorded while the target program is running on the recording mobile terminal connected to the recording client, and the recording interface is the interface of the recording mobile terminal running the target program while the test script is being recorded; sending the test script and several recording interface images to a script storage server, so that the script storage server sends the test script to several test clients and sends the several recording interface images to an image comparison server, thereby enabling the image comparison server, upon receiving several test interface images sent by any test client, to perform a full image comparison based on each test interface image and its corresponding recording interface image, obtain a comparison result, and, in response to any mismatch between a test interface image and its corresponding recording interface image, determine that the target program is incompatible with the test mobile terminal; wherein the test interface images are generated by the test script while the test mobile terminal connected to the test client is running, and are sent to the image comparison server after the test script has finished running.

[0008] The above technical solution performs a full image comparison between each test interface image and its corresponding recorded interface image to determine whether each test interface image matches its corresponding recorded interface image. Therefore, by performing a full image comparison between each test interface image and its corresponding recorded interface image, it is possible to determine whether the test interface image and its corresponding recorded interface image match. In other words, for test interface images containing a large number of elements that need to be verified, only one comparison is required, eliminating the need to perform a verification and matching process for each element separately. This improves the speed of test interface image verification and thus increases the efficiency of compatibility testing for mobile devices.

[0009] Furthermore, since the test script is recorded on the recording client, and the compatibility test for the mobile device is performed separately on the test client connected to the mobile device and on the image comparison server, the test script recording and the mobile device compatibility test are executed on different machines. Separating the execution machine for test script recording from the execution machine for mobile device compatibility testing improves the efficiency of mobile device compatibility testing. Moreover, since the matching of the test interface image generated by running the test script on the mobile device with the corresponding recorded interface image is performed on the image comparison server, the test script does not need to include code for comparing the test interface image and checking for matching with the corresponding recorded interface image. This effectively reduces the amount of code in the test script, increasing the recording speed and thus improving the efficiency of mobile device compatibility testing. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating an embodiment of the compatibility testing method provided in this application;

[0011] Figure 2 This is an interactive schematic diagram of an embodiment of the compatibility test provided in this application;

[0012] Figure 3 yes Figure 1 The flowchart of step S12 shown is a schematic diagram of one embodiment;

[0013] Figure 4 yes Figure 3 The flowchart of step S31 shown is a schematic diagram of one embodiment.

[0014] Figure 5 yes Figure 3 The flowchart of step S33 shown is a schematic diagram of one embodiment.

[0015] Figure 6 This is a flowchart illustrating another embodiment of the compatibility testing method provided in this application;

[0016] Figure 7 This is a flowchart illustrating another embodiment of the compatibility testing method provided in this application;

[0017] Figure 8 This is a flowchart illustrating another embodiment of the compatibility testing method provided in this application;

[0018] Figure 9 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application;

[0019] Figure 10 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0020] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0021] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0022] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the compatibility testing method provided in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that outcome. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes:

[0024] Step S11: The image comparison server receives several test interface images sent by the test client.

[0025] In the process of APP front-end testing, compatibility testing is required for different devices. Compatibility testing generally requires testing the same function on several or even dozens of devices. These devices can be of the same model, such as all iPhone 12s; or they can be of different models, such as iPhone 11, iPhone 12, and iPhone 13; or iPhones, Huawei devices, Xiaomi devices, and Redmi devices. Subsequently, image recognition-based automated testing tools like Airtest emerged. Using image similarity algorithms such as KAZE and BRISK, Airtest can locate elements directly through screenshots and perform test assertions without requiring user identification of page elements. However, this automated testing tool requires comparing screenshots one by one when testing multiple elements, which is inefficient when comparing a large number of elements. Furthermore, all automated testing programs run on the same machine, resulting in slow and inefficient compatibility testing. Therefore, this application provides a compatibility testing method for front-end compatibility testing that can improve the efficiency of compatibility testing.

[0026] In this embodiment, the image comparison server receives several test interface images sent by the test client. These test interface images are the interfaces when the test script runs on the test mobile device connected to the test client. The test script is recorded when the target program runs on the recording mobile device connected to the recording client. In other words, instead of detecting and matching the test interface images on the test client, the test client sends these images to the image comparison server after executing the test script. This allows the image comparison server to subsequently compare and detect the test interface images sent by the client. In other words, the testing of whether the test mobile device can run the test script normally and the detection of whether the test interface images generated by running the test script on the test mobile device match the corresponding recorded interface images are separated and executed by different execution machines, thus improving the efficiency of compatibility testing of the test mobile device.

[0027] The specific type of the target program is not limited; it can be set according to actual usage needs. For example, the target program could be Taobao, JD.com, or Alipay.

[0028] Step S12: For each test interface image, perform a full image comparison between the test interface image and the recorded interface image corresponding to the test interface image to obtain the comparison result.

[0029] In this embodiment, for each test interface image, a full image comparison is performed between the test interface image and the corresponding recorded interface image to obtain a comparison result. The comparison result indicates whether the test interface image and the corresponding recorded interface image match. The recorded interface is the interface of the mobile device running the target program when the test script is recorded. Several recorded interface images are sent by the recording client to the script storage server after completing the test script recording, and then forwarded by the script storage server to the image comparison server. In other words, by performing a full image comparison between each test interface image and its corresponding recorded interface image, it is possible to determine whether the test interface image matches the corresponding recorded interface image. This means that for test interface images containing a large number of elements that need to be verified, only one comparison is required, eliminating the need to perform verification and matching processes for each element separately. This improves the speed of test interface image verification and thus increases the efficiency of compatibility testing for the mobile device.

[0030] Furthermore, since the test script is recorded on the recording client, and the compatibility test for the test mobile device is performed separately on the test client connected to the test mobile device and on the image comparison server, the test to ensure the test script runs correctly on the test client connected to the test mobile device is performed, while the check to see if the test interface image generated by running the test script on the test mobile device matches the corresponding recorded interface image is performed on the image comparison server. Therefore, the test script recording and the compatibility test for the test mobile device can be considered as being executed on different execution machines. Separating the execution machine for test script recording from the execution machine for compatibility testing of the test mobile device improves the efficiency of compatibility testing of the test mobile device. Moreover, since the check to see if the test interface image generated by running the test script on the test mobile device matches the corresponding recorded interface image is performed on the image comparison server, the test script does not need to include program code for comparing the test interface image and checking for matching with the corresponding recorded interface image. This effectively reduces the program code of the test script, allowing for faster recording of the test script and thus improving the efficiency of compatibility testing of the test mobile device.

[0031] Step S13: In response to any mismatch between the test interface image and the recorded interface image corresponding to the test interface image, determine that the target program is incompatible with the test mobile terminal.

[0032] In this embodiment, if any test interface image and the corresponding recorded interface image do not match, it is determined that the target program is incompatible with the test mobile device. In other words, when any test interface image and the corresponding recorded interface image do not match, it indicates that the interface of the test mobile device running the target program connected to the test client is inconsistent with the interface of the recorded mobile device running the target program. That is, it indicates that the test mobile device connected to the test client displays the running interface corresponding to the target program abnormally, and at this time, it is determined that the test mobile device connected to the test client is incompatible with the target program.

[0033] In one specific implementation, such as Figure 2 As shown, Figure 2 This is an interactive schematic diagram of an embodiment of the compatibility test provided in this application. For the recording client (i.e., Figure 2 For example, in the case of an office computer, testers will record the mobile device and the automated testing tool - Airtest - along with the recording client (i.e., Figure 2 The recording client connects to a recording device and records the test script on the recording client while the target program is running on the recording mobile device connected to the recording client. Then, the recording client sends the test script and several recorded interface images generated by recording the test script to the script storage server (i.e., Figure 2(Script storage in the script storage server). For the script storage server, the scheduler in the script storage server pushes the test scripts to the execution cluster (i.e., Figure 2 The script execution machines (each script execution machine can be considered a test client, and each test client connects to a test mobile terminal) push the scripts to several test clients; and the scheduler in the script storage server pushes several recorded interface images to the image comparison server (i.e., ...). Figure 2 Image comparison in the middle). For any test client, the test client will receive the test script sent by the script storage server, and on the test mobile terminal connected to it (i.e., Figure 2 The test script runs on the test machine (in the test server), and several test interface images are generated during the execution of the test script (i.e., Figure 2 The test screenshots (shown in the image) represent the interface of the test script running on the test mobile client connected to the test client. The test client then sends several test interface images to the image comparison server. The image comparison server receives the test interface images sent by the test client and the recorded interface images sent by the script storage server, and performs a full image comparison between each test interface image and its corresponding recorded interface image to determine whether the target program is compatible with the test mobile client.

[0034] In the above embodiments, for each test interface image, a full image comparison is performed between the test interface image and the corresponding recorded interface image to determine whether each test interface image matches the corresponding recorded interface image. Therefore, by performing a full image comparison between each test interface image and the corresponding recorded interface image, it is possible to determine whether the test interface image matches the corresponding recorded interface image. That is, for test interface images containing a large number of elements that need to be verified, only one comparison is required, without having to perform a verification and matching process for each element separately. This improves the speed of test interface image verification, thereby increasing the efficiency of compatibility testing for mobile devices.

[0035] Furthermore, since the test script is recorded on the recording client, and the compatibility test for the mobile device is performed separately on the test client connected to the mobile device and on the image comparison server, the test script recording and the mobile device compatibility test are executed on different machines. Separating the execution machine for test script recording from the execution machine for mobile device compatibility testing improves the efficiency of mobile device compatibility testing. Moreover, since the matching of the test interface image generated by running the test script on the mobile device with the corresponding recorded interface image is performed on the image comparison server, the test script does not need to include code for comparing the test interface image and checking for matching with the corresponding recorded interface image. This effectively reduces the amount of code in the test script, increasing the recording speed and thus improving the efficiency of mobile device compatibility testing.

[0036] Please see Figure 3 , Figure 3 yes Figure 1 The flowchart shown is a schematic diagram of one embodiment of step S12. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 3 The illustrated process sequence is limited. For example... Figure 3 As shown, this embodiment includes:

[0037] Step S31: Determine the base image and the image to be matched from the test interface image and the recorded interface image corresponding to the test interface image.

[0038] In this embodiment, a base image and a matching image are determined from the test interface image and the corresponding recorded interface image. That is, one of the test interface image and the corresponding recorded interface image is used as the base image, and the other is used as the matching image.

[0039] In one implementation, such as Figure 4 As shown, Figure 4 yes Figure 3 The flowchart of step S31 shown is a schematic diagram of an embodiment. The image with the larger size characterization parameter is used as the base image, and specifically includes the following sub-steps:

[0040] Step S41: Obtain the first size representation parameter of the test interface image and the second size representation parameter of the recorded interface image corresponding to the test interface image.

[0041] In this embodiment, a first size characterization parameter of the test interface image and a second size characterization parameter of the recorded interface image corresponding to the test interface image are obtained respectively; wherein, the size characterization parameter includes at least one of size and resolution.

[0042] Step S42: Use the larger of the first size representation parameter and the second size representation parameter as the base image; and use the other as the image to be matched.

[0043] In this embodiment, the larger of the first size characterization parameter and the second size characterization parameter is used as the base image; and the other is used as the image to be matched.

[0044] For example, taking resolution as the size representation parameter; if the resolution of the test interface image is greater than the resolution of the corresponding recorded interface image, then the test interface image is used as the base image and the recorded interface image is used as the image to be matched; if the resolution of the test interface image is less than the resolution of the corresponding recorded interface image, then the recorded interface image is used as the base image and the test interface image is used as the image to be matched.

[0045] Step S32: Determine whether there is a matching region in the base image that matches the image to be matched, and obtain the matching result.

[0046] In this embodiment, the matching result is obtained by determining whether there is a matching region in the base image that matches the image to be matched.

[0047] In one embodiment, the cv2 library matching algorithm is used to match the image to be matched from the base image, thereby determining whether there is a matching region in the base image that matches the image to be matched.

[0048] Step S33: Based on the matching results, obtain the comparison results.

[0049] In this embodiment, the comparison result is obtained based on the matching result.

[0050] In one embodiment, in response to the matching result being that there is no matching region in the base image that matches the image to be matched, it is determined that the test interface image and the recorded interface image corresponding to the test interface image do not match.

[0051] In one embodiment, in response to the matching result indicating the existence of a matching region in the base image that matches the image to be matched, the test interface image and the corresponding recorded interface image are directly determined to be matched; that is, the matching result is directly used as the comparison result. To improve the accuracy of the comparison result, in other embodiments, such as... Figure 5 As shown, Figure 5 yes Figure 3 The flowchart of step S33 shown is a schematic diagram of an embodiment. Obtaining the comparison result based on the matching result specifically includes the following sub-steps:

[0052] Step S51: In response to the matching result that a matching region exists in the base image, the matching region is cropped from the base image and used as the matching image.

[0053] In this embodiment, in response to the matching result indicating the existence of a region to be matched in the base image, a matching region is cropped from the base image and used as the matching image. That is, the region corresponding to the image to be matched is cropped from the base image and used as the matching image.

[0054] Step S52: Adjust the resolution of the matching image or the resolution of the image to be matched so that the resolution of the matching image is the same as the resolution of the image to be matched.

[0055] Since the region in the base image corresponding to the image to be matched may be different in size from the image to be matched, it is not suitable for further matching operations. Therefore, in this embodiment, the resolution of the image to be matched or the resolution of the matching image is adjusted so that the resolution of the matching image is the same as that of the image to be matched, thereby making the size of the matching image and the image to be matched the same.

[0056] In one implementation, the cv2 library is used to scale the matching image and the image to be matched to the same resolution. Of course, in other implementations, other algorithms or models can also be used to scale the matching image and the image to be matched to the same resolution, and no specific limitation is made here.

[0057] Step S53: Divide the image to be matched into several first sub-regions, and divide the matched image into several second sub-regions.

[0058] In this embodiment, the image to be matched is divided into several first sub-regions, and the matching image is divided into several second sub-regions; wherein, a first sub-region corresponds to a second sub-region.

[0059] In one embodiment, before dividing the image to be matched into several first sub-regions and the matching image into several second sub-regions, the image to be matched and the matching image are further processed in grayscale.

[0060] Step S54: For each first sub-region, determine the matching degree between the first sub-region and the corresponding second sub-region.

[0061] In this embodiment, for each first sub-region, the matching degree between the first sub-region and the corresponding second sub-region is determined. That is, the test interface image is divided into multiple sub-regions, and each is matched with a sub-region of the corresponding recorded interface image, thereby more accurately determining whether the test interface image matches the corresponding recorded interface image.

[0062] In one implementation, the SSIM algorithm is used to determine the matching degree between the first sub-region and the corresponding second sub-region. Of course, in other implementations, other algorithms or models can also be used to determine the matching degree between the first sub-region and the corresponding second sub-region, and no specific limitation is made here.

[0063] Step S55: In response to the fact that the matching degree corresponding to any first sub-region does not meet the threshold requirement, determine that the test interface image and the recorded screen image corresponding to the test interface image do not match, and generate a difference result image.

[0064] In this embodiment, in response to the matching degree corresponding to any first sub-region not meeting the threshold requirement, it is determined that the test interface image and the corresponding recorded screen image do not match. That is, when the matching degree corresponding to any first sub-region does not meet the threshold requirement, it indicates that there is a region of difference between the test interface image and the recorded interface image, i.e., it indicates that the test interface image and the recorded interface image do not match.

[0065] In addition, this embodiment also generates a difference result image, which is a test interface image marked with a first sub-region that does not meet the threshold requirement. Since the difference result image marks the first sub-region that does not meet the threshold requirement—the first sub-region that does not meet the threshold requirement is the area where the test interface image differs from the corresponding recorded interface image—the difference result image can intuitively display the differences between the test interface image and the corresponding recorded interface image. This reduces the cost of communicating defects between testing and development, further improves R&D efficiency, and adapts to the rapidly iterating front-end requirements.

[0066] In one specific implementation, the cv2 library algorithm is used to assign a value of 255 to the first sub-region that meets the threshold requirement. Then, the test interface image with the assigned value of 255 is converted back to an RGB image, and a threshold border is drawn to generate a difference result image.

[0067] In one embodiment, after determining that the test interface image and the corresponding recorded interface image do not match when the matching degree corresponding to any first sub-region does not meet the threshold requirement, an initial test report is generated. This initial test report includes the number of first sub-regions whose matching degree does not meet the threshold requirement and the difference result image corresponding to the test interface image. In other words, when it is determined that the test interface image and the corresponding recorded interface image do not match, an assertion is made. This assertion is based on a full image comparison, eliminating the need to write assertions element by element, thus improving the efficiency of compatibility testing for the mobile device.

[0068] In one implementation, upon determining that the target program is incompatible with the test mobile terminal after a mismatch is found between any test interface image and the corresponding recorded interface image, a target test report corresponding to the test mobile terminal connected to the test client is generated. Specifically, the initial test reports corresponding to each test interface image are combined to obtain the target test report; then, the target test report is sent to the report server so that users can download and query the target test report later.

[0069] It should be noted that for any test interface image sent by the test client, steps S31-S33 and their corresponding sub-steps need to be executed respectively.

[0070] Please see Figure 6 , Figure 6 This is a flowchart illustrating another embodiment of the compatibility testing method provided in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that outcome. Figure 6 The illustrated process sequence is limited. For example... Figure 6 As shown, this embodiment includes:

[0071] Step S61: The script storage server receives the test script and several recording interface images sent by the recording client.

[0072] Step S61 is similar to some parts of steps S11 and S12, and will not be repeated here.

[0073] Step S62: Send the test script to several test clients so that each test client runs the test script to generate several test interface images corresponding to each test client; and send several recorded interface images to the image comparison server so that after receiving several test interface images sent by the test clients, the image comparison server performs a full image comparison based on each test interface image and the corresponding recorded interface image to obtain the comparison result, and in response to any mismatch between any test interface image and the recorded interface image corresponding to the test interface image, determines that the target program is incompatible with the test mobile terminal.

[0074] Step S62 is similar to some parts of steps S12 and S13, and will not be repeated here.

[0075] Please see Figure 7 , Figure 7 This is a flowchart illustrating another embodiment of the compatibility testing method provided in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that outcome. Figure 7 The illustrated process sequence is limited. For example... Figure 7 As shown, this embodiment includes:

[0076] Step S71: The test client receives the test script sent by the script storage server.

[0077] Step S71 is similar to some parts of step S11, and will not be repeated here.

[0078] Step S72: Run the test script on the test mobile terminal connected to the test client to generate several test interface images.

[0079] Step S72 is similar to some parts of step S12, and will not be repeated here.

[0080] Step S73: Send several test interface images to the image comparison server so that the image comparison server can perform a full image comparison based on each test interface image and the corresponding recorded interface image to obtain the comparison result. If any test interface image does not match the recorded interface image corresponding to the test interface image, it is determined that the target program is incompatible with the test mobile terminal.

[0081] Step S73 is similar to some parts of steps S12 and S13, and will not be repeated here.

[0082] Please see Figure 8 , Figure 8 This is a flowchart illustrating another embodiment of the compatibility testing method provided in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that outcome. Figure 8 The illustrated process sequence is limited. For example... Figure 8 As shown, this embodiment includes:

[0083] Step S81: The recording client responds to the user's recording command, records the test script, and generates several recording interface images.

[0084] Step S81 is similar to some parts of step S11, and will not be repeated here.

[0085] Step S82: Send the test script and several recorded interface images to the script storage server, so that the script storage server sends the test script to several test clients and sends several recorded interface images to the image comparison server. After receiving several test interface images sent by the test clients, the image comparison server performs a full image comparison based on each test interface image and the corresponding recorded interface image to obtain the comparison result. In response to any mismatch between any test interface image and the corresponding recorded interface image, it determines that the target program is incompatible with the test mobile terminal.

[0086] Step S82 is similar to some parts of steps S12 and S13, and will not be repeated here.

[0087] Please see Figure 9 , Figure 9 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device 90 includes a memory 91 and a processor 92 coupled to each other. The processor 92 is used to execute program instructions stored in the memory 91 to implement the steps of any of the above-described compatibility testing method embodiments. In a specific implementation scenario, the electronic device 90 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 90 may also include mobile devices such as laptops and tablets, which are not limited here.

[0088] Specifically, processor 92 controls itself and memory 91 to implement the steps of any of the above-described compatibility testing method embodiments. Processor 92 may also be referred to as a CPU (Central Processing Unit). Processor 92 may be an integrated circuit chip with signal processing capabilities. Processor 92 may also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 92 may be implemented using integrated circuit chips.

[0089] Please see Figure 10 , Figure 10 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 100 of this embodiment stores program instructions 101. When executed, these program instructions 101 implement the methods provided by any embodiment of the compatibility testing method of this application and any non-conflicting combination thereof. The program instructions 101 can form a program file and be stored in the aforementioned computer-readable storage medium 100 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) can execute all or part of the steps of the methods of various embodiments of this application. The aforementioned computer-readable storage medium 100 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.

[0090] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0091] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A compatibility testing method, characterized in that, The method includes: The image comparison server receives several test interface images sent by the test client; wherein, the test interface is the interface on which the test script runs on the test mobile terminal connected to the test client, and the test script is recorded when the target program is run on the recording mobile terminal connected to the recording client; For each of the test interface images, a full image comparison is performed between the test interface image and the corresponding recorded interface image to obtain a comparison result; wherein, the comparison result is used to indicate whether the test interface image and the corresponding recorded interface image match, the recorded interface is the interface when the recording mobile terminal runs the target program when recording the test script, and the recorded interface image is sent by the recording client to the script storage server after completing the recording of the test script, and then forwarded by the script storage server to the image comparison server; In response to a mismatch between any of the test interface images and the corresponding recorded interface images, it is determined that the target program is incompatible with the test mobile terminal. The step of performing a full image comparison between the test interface image and the recorded interface image corresponding to the test interface image to obtain the comparison result includes: From the test interface image and the recorded interface image corresponding to the test interface image, determine the base image and the image to be matched, and take the one with the larger size characterization parameter as the base image; From the base image, determine whether there is a matching region in the base image that matches the image to be matched, and obtain the matching result; In response to the matching result indicating that the matching region exists in the base image, the matching region is cropped from the base image to form a matching image; Adjust the resolution of the matching image or the resolution of the image to be matched so that the resolution of the matching image is the same as the resolution of the image to be matched; The image to be matched is divided into several first sub-regions, and the image to be matched is divided into several second sub-regions; wherein, a first sub-region corresponds to a second sub-region. For each of the first sub-regions, determine the matching degree between the first sub-region and the corresponding second sub-region; In response to any first sub-region's matching degree failing to meet the threshold requirement, it is determined that the test interface image and the recorded screen image corresponding to the test interface image do not match, and a difference result image is generated; wherein, the difference result image is a test interface image marked with the first sub-region failing to meet the threshold requirement.

2. The method according to claim 1, characterized in that, Before dividing the image to be matched into several first sub-regions and the matching image into several second sub-regions, the method further includes: The image to be matched and the matching image are processed into grayscale.

3. The method according to claim 1, characterized in that, After determining that the test interface image and the recorded screen image corresponding to the test interface image do not match in response to the matching degree corresponding to any of the first sub-regions not meeting the threshold requirement, the method further includes: Generate an initial test report; wherein the initial test report includes the number of first sub-regions whose matching degree does not meet the threshold requirement and the difference result image corresponding to the test interface image; And / or, after determining that the target program is incompatible with the test mobile terminal in response to any mismatch between the test interface image and the recorded interface image corresponding to the test interface image, the method further includes: Combine the initial test reports corresponding to each of the test interface images to obtain the target test report; Send the target test report to the report storage server.

4. The method according to claim 1, characterized in that, After determining whether a matching region exists in the base image that matches the image to be matched, and obtaining the matching result, the method further includes: In response to the matching result being that there is no matching region in the base image that matches the image to be matched, it is determined that the test interface image and the recording interface image corresponding to the test interface image do not match; And / or, from the test interface image and the corresponding recorded interface image, determine the base image and the image to be matched, and use the one with the larger size characterization parameter as the base image, including: The first size characterization parameter of the test interface image and the second size characterization parameter of the recorded interface image corresponding to the test interface image are obtained respectively; wherein, the size characterization parameter includes at least one of size and resolution; The larger of the first size characterization parameter and the second size characterization parameter is used as the base image; and the other is used as the image to be matched.

5. A compatibility testing method, characterized in that, The method includes: The script storage server receives a test script and several recording interface images sent by the recording client; wherein, the test script and several recording interface images are sent to the script storage server after the recording client completes the recording of the test script, and the recording interface is the interface of the mobile terminal running the target program when the test script is being recorded. The test script is sent to several test clients, so that each test client runs the test script to generate several test interface images corresponding to each test client; and the several recorded interface images are sent to an image comparison server, so that after receiving the several test interface images sent by the test clients, the image comparison server performs a full image comparison based on each test interface image and the corresponding recorded interface image to obtain a comparison result, and in response to any mismatch between any test interface image and the recorded interface image corresponding to the test interface image, determines that the target program is incompatible with the test mobile terminal; wherein, the test interface is the interface on which the test script runs when the test client is connected to the test mobile terminal; The step of performing a full image comparison between each of the test interface images and the corresponding recorded interface images to obtain the comparison results includes: From the test interface image and the recorded interface image corresponding to the test interface image, determine the base image and the image to be matched, and take the one with the larger size characterization parameter as the base image; From the base image, determine whether there is a matching region in the base image that matches the image to be matched, and obtain the matching result; In response to the matching result indicating that the matching region exists in the base image, the matching region is cropped from the base image to form a matching image; Adjust the resolution of the matching image or the resolution of the image to be matched so that the resolution of the matching image is the same as the resolution of the image to be matched; The image to be matched is divided into several first sub-regions, and the image to be matched is divided into several second sub-regions; wherein, a first sub-region corresponds to a second sub-region. For each of the first sub-regions, determine the matching degree between the first sub-region and the corresponding second sub-region; In response to any first sub-region's matching degree failing to meet the threshold requirement, it is determined that the test interface image and the recorded screen image corresponding to the test interface image do not match, and a difference result image is generated; wherein, the difference result image is a test interface image marked with the first sub-region failing to meet the threshold requirement.

6. A compatibility testing method, characterized in that, The method includes: The test client receives a test script sent by the script storage server; wherein the test script is recorded while the target program is running on the recording mobile terminal connected to the recording client; The test script is run on a test mobile device connected to the test client to generate several test interface images; wherein, the test interface is the interface when the test mobile device runs the test script. The image comparison server sends the plurality of test interface images to the image comparison server, so that the image comparison server performs a full image comparison based on each of the test interface images and the corresponding recorded interface images to obtain a comparison result. In response to any test interface image and the recorded interface image corresponding to the test interface image not matching, the image comparison server determines that the target program is incompatible with the test mobile terminal. The comparison result is used to indicate whether the test interface image and the recorded interface image corresponding to the test interface image match. The recorded interface is the interface when the recording mobile terminal runs the target program during the recording of the test script. The recorded interface image is sent by the recording client to the script storage server after the recording of the test script is completed, and then forwarded to the image comparison server by the script storage server. The step of performing a full image comparison between each of the test interface images and the corresponding recorded interface images to obtain the comparison results includes: From the test interface image and the recorded interface image corresponding to the test interface image, determine the base image and the image to be matched, and take the one with the larger size characterization parameter as the base image; From the base image, determine whether there is a matching region in the base image that matches the image to be matched, and obtain the matching result; In response to the matching result indicating that the matching region exists in the base image, the matching region is cropped from the base image to form a matching image; Adjust the resolution of the matching image or the resolution of the image to be matched so that the resolution of the matching image is the same as the resolution of the image to be matched; The image to be matched is divided into several first sub-regions, and the image to be matched is divided into several second sub-regions; wherein, a first sub-region corresponds to a second sub-region. For each of the first sub-regions, determine the matching degree between the first sub-region and the corresponding second sub-region; In response to any first sub-region's matching degree failing to meet the threshold requirement, it is determined that the test interface image and the recorded screen image corresponding to the test interface image do not match, and a difference result image is generated; wherein, the difference result image is a test interface image marked with the first sub-region failing to meet the threshold requirement.

7. The method according to claim 6, characterized in that, The image comparison server is further configured to generate a target test report and send the target test report to a report storage server, wherein the target test report includes an initial test report corresponding to each of the test interface images; the method further includes: In response to the user's download operation, a report download instruction is sent to the report storage server; Receive the target test report sent by the report storage server.

8. A compatibility testing method, characterized in that, The method includes: The recording client responds to the user's recording command, records a test script, and generates several recording interface images; wherein, the test script is recorded while the target program is running on the recording mobile terminal connected to the recording client, and the recording interface is the interface when the recording mobile terminal runs the target program while the test script is being recorded; The test script and the plurality of recorded interface images are sent to a script storage server, so that the script storage server sends the test script to a plurality of test clients and sends the plurality of recorded interface images to an image comparison server. Upon receiving the plurality of test interface images sent by the test clients, the image comparison server performs a full image comparison between each test interface image and its corresponding recorded interface image to obtain a comparison result. In response to any mismatch between a test interface image and its corresponding recorded interface image, the server determines that the target program is incompatible with the test mobile terminal. The test interface images are generated by the test script while the test mobile terminal connected to the test client is running, and are sent to the image comparison server after the test script has finished running. The step of performing a full image comparison between each of the test interface images and the corresponding recorded interface images to obtain the comparison results includes: From the test interface image and the recorded interface image corresponding to the test interface image, determine the base image and the image to be matched, and take the one with the larger size characterization parameter as the base image; From the base image, determine whether there is a matching region in the base image that matches the image to be matched, and obtain the matching result; In response to the matching result indicating that the matching region exists in the base image, the matching region is cropped from the base image to form a matching image; Adjust the resolution of the matching image or the resolution of the image to be matched so that the resolution of the matching image is the same as the resolution of the image to be matched; The image to be matched is divided into several first sub-regions, and the image to be matched is divided into several second sub-regions; wherein, a first sub-region corresponds to a second sub-region. For each of the first sub-regions, determine the matching degree between the first sub-region and the corresponding second sub-region; In response to any first sub-region's matching degree failing to meet the threshold requirement, it is determined that the test interface image and the recorded screen image corresponding to the test interface image do not match, and a difference result image is generated; wherein, the difference result image is a test interface image marked with the first sub-region failing to meet the threshold requirement.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing program instructions, and the processor executing the program instructions to implement the compatibility testing method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions that can be executed to implement the compatibility testing method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • An automatic interface compatibility testing method and device based on a debugging bridge

    CN109885480A

  • Compatibility testing method and device of front end, storage medium and electronic equipment

    CN115048302A