Test method, device, equipment, storage medium and program product for display content

By acquiring and comparing interface images in basic and accessible display modes, and utilizing OCR recognition technology, the problem of low accuracy in accessibility function testing in existing technologies has been solved, achieving more efficient accessibility testing results.

CN114356747BActive Publication Date: 2025-12-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111412084.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2025-12-12
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

Existing accessibility testing methods are rather one-sided and fail to accurately reflect the user experience, resulting in low testing accuracy.

Method used

By acquiring interface images of the target interface in basic display mode and accessibility display mode, optical character recognition (OCR) is performed, and the recognition results are compared to determine the accessibility test results, thereby improving the accuracy of the test.

Benefits of technology

It improves the accuracy of accessibility mode testing, can intuitively reflect the information transmission effect in accessibility mode, and ensures the integrity and accuracy of the displayed content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356747B_ABST
    Figure CN114356747B_ABST
Patent Text Reader

Abstract

The application discloses a test method, device, equipment, storage medium and program product of display content, and relates to the technical field of computers. The method comprises the following steps: acquiring interface content of a target interface; acquiring a first interface image of the target interface in a basic display mode; acquiring a second interface image of the target interface in an accessibility display mode; performing content recognition on the first interface image to obtain first recognized content; performing content recognition on the second interface image to obtain second recognized content; and determining an accessibility test result based on the interface content, the first recognized content and the second recognized content. By comparing the interface content acquired in the background with the display result in the basic display mode and the display result in the accessibility display mode, the difference between the content displayed in the accessibility display mode and the content that should be displayed can be determined, and the information transmission effect of the content displayed in the accessibility mode can be intuitively reflected.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a display content testing method and device, equipment, storage medium and program product. BACKGROUND

[0002] Information accessibility means that anyone can access and use information equally, conveniently and without obstacles in any situation. For visually impaired people, such as people with blurred vision, dim vision, high hyperopia or myopia, color blindness and tubular vision, it is difficult to read the text or images on the computer screen. Therefore, it is necessary to provide accessibility functions, i.e., to enlarge the display size of interface content, such as to enlarge the text display.

[0003] In related technologies, in the process of testing accessibility functions, the display size, display color and display contrast of text after the accessibility function is turned on are mainly matched with standard requirements, so as to determine whether the accessibility function meets the testing requirements.

[0004] However, the accessibility function test in related technologies is one-sided, and cannot accurately test the effect of the accessibility function in the user's use process, so the test accuracy is low. SUMMARY

[0005] Embodiments of the present application provide a display content testing method, device, equipment, storage medium and program product, which can improve the test accuracy of the accessibility mode. The technical solution is as follows.

[0006] In one aspect, a display content testing method is provided, which includes:

[0007] Obtaining interface content of a target interface, the interface content being content configured to be displayed in the target interface;

[0008] Obtaining a first interface image of the target interface in a basic display mode, the first interface image being used to represent the display content of the target interface in the basic display mode;

[0009] Obtaining a second interface image of the target interface in an accessibility display mode, the second interface image being used to represent the display content of the target interface in the accessibility display mode;

[0010] Performing content recognition on the first interface image to obtain first recognized content, and performing content recognition on the second interface image to obtain second recognized content;

[0011] Determining an accessibility test result of the target interface based on the interface content, the first recognized content and the second recognized content.

[0012] In another aspect, a test device for displaying content is provided, the device comprising:

[0013] an acquisition module configured to acquire interface content of a target interface, the interface content being content configured to be displayed in the target interface; acquire a first interface image of the target interface in a basic display mode, the first interface image being used to represent display content of the target interface in the basic display mode; and acquire a second interface image of the target interface in an accessibility display mode, the second interface image being used to represent display content of the target interface in the accessibility display mode;

[0014] an identification module configured to perform content identification on the first interface image to obtain first identification content; and perform content identification on the second interface image to obtain second identification content;

[0015] a determination module configured to determine an accessibility test result of the target interface based on the interface content, the first identification content, and the second identification content.

[0016] In another aspect, a computer device is provided, the computer device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the test method for displaying content according to any one of the above embodiments of the present application.

[0017] In another aspect, a computer-readable storage medium is provided, the storage medium storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by a processor to implement the test method for displaying content according to any one of the above embodiments of the present application.

[0018] In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the test method for displaying content according to any one of the above embodiments.

[0019] The technical solutions provided by the embodiments of the present application have at least the following beneficial effects:

[0020] By comparing the interface content obtained by the target interface itself after being configured in the background with the display result in the basic display mode and the display result in the barrier-free display mode, differences between the content displayed in the barrier-free display mode and the content that should be displayed are determined, barrier-free test results are obtained, the display effect in the barrier-free mode is determined, the test accuracy and effectiveness of the barrier-free mode are improved, and the information transmission effect of the content displayed in the barrier-free mode can be intuitively reflected. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 is a whole flowchart of the display content test method provided by an example embodiment of the present application;

[0023] Figure 2 is a schematic diagram of an implementation environment provided by an example embodiment of the present application;

[0024] Figure 3 is a flowchart of the display content test method provided by an example embodiment of the present application;

[0025] Figure 4 is based on Figure 3 the embodiment shown in the figure;

[0026] Figure 5 is based on Figure 3 the embodiment shown in the figure;

[0027] Figure 6 is a flowchart of the display content test method provided by another example embodiment of the present application;

[0028] Figure 7 is based on Figure 6 the embodiment shown in the figure;

[0029] Figure 8 is based on Figure 6 the embodiment shown in the figure;

[0030] Figure 9 is a flowchart of the display content test method provided by another example embodiment of the present application;

[0031] Figure 10 is based on Figure 9 The embodiment shown provides a text processing process schematic diagram;

[0032] Figure 11 The interface schematic diagram of the barrier-free test result provided by one exemplary embodiment of the present application;

[0033] Figure 12 The structural block diagram of the display content testing device provided by one exemplary embodiment of the present application;

[0034] Figure 13 The structural block diagram of the display content testing device provided by another exemplary embodiment of the present application;

[0035] Figure 14 The structural block diagram of the computer device provided by one exemplary embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical scheme and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the drawings.

[0037] Information accessibility means that anyone can acquire and use information equally, conveniently and without barriers in any situation. For visually impaired people, such as people with blurred vision, dim vision, high hyperopia or myopia, color blindness and tubular vision, there are certain difficulties in viewing the text or image on the computer screen. Therefore, it is necessary to provide accessibility functions according to requirements, i.e. to expand the display size of interface content, such as to enlarge the text display, to set high contrast display, screen reader, etc.

[0038] However, due to the need to enlarge some elements in the webpage or interface for display, it is easy to cause incomplete display, display distortion or display failure. For example, when the "confirmation information" in the control is enlarged and displayed in the webpage, the control itself cannot accommodate the complete display of the enlarged text due to the insufficient magnification multiple, so under the accessibility function, the control displays "confirmation information", which leads to inaccurate content in the control and affects the expression of the control. Based on this problem, it is necessary to test the accessibility function of different webpages or interfaces to avoid or reduce the information transmission error under the accessibility function.

[0039] In the related art, when performing accessibility function testing, mainly the display size, display color, display contrast, and the like of text after the accessibility function is turned on are matched with standard requirements, so as to determine whether the accessibility function meets the testing requirements. However, this testing method is relatively one-sided for accessibility function testing, and cannot accurately test the effect of the accessibility function in the user's use process, that is, it is not possible to accurately know whether the text or image under the display size can be completely displayed in the interface, and the testing accuracy is relatively low.

[0040] The embodiment of the present application provides a testing method for display content, Figure 1 The embodiment of the present application provides a testing method for display content, Figure 1 As shown in the figure, in the process, first, a tested website 100 is acquired, the tested website 100 being a website input by a user or automatically acquired.

[0041] On the one hand, web page content 110 in the tested website 100 is acquired, wherein the web page content 110 is content configured in a web page in a web page design process and needing to be displayed, such as text content needing to be displayed in the tested website 100.

[0042] On the other hand, a first screenshot 120 is obtained by performing screenshot on display content of the tested website 100 in a normal display mode, and a second screenshot 130 is obtained by performing screenshot on display content of the tested website 100 in an accessibility mode.

[0043] Optical character recognition (OCR) is performed on the first screenshot 120 and the second screenshot 130, to obtain a first recognition result 121 of the first screenshot 120 and a second recognition result 131 of the second screenshot 130.

[0044] The web page content 110 is matched with the first recognition result 121 and the second recognition result 131, so as to output an accessibility test result 140. The accessibility test result 140 is used to indicate the display accuracy in the accessibility mode.

[0045] The embodiment of the present application can be applied to a terminal, can be applied to a server, and can also be applied to an interactive scenario of the terminal and the server. When the accessibility test process is applied to the terminal, the terminal directly acquires web page content, and performs accessibility testing on the web page according to screenshots of the web page in a normal display mode and an accessibility display mode (hereinafter referred to as an accessibility mode). In the embodiment of the present application, the accessibility test process is applied to the interactive scenario of the terminal and the server as an example.

[0046] The implementation environment involved in the embodiment of the present application is described, and for illustration, reference is made toFigure 2 The implementation environment involves the terminal 210 and the server 220, and the terminal 210 and the server 220 are connected through the communication network 230.

[0047] In some embodiments, the terminal 210 is a terminal capable of browsing a webpage, or the terminal 210 is a terminal installed with a target application program, which can be implemented as any type of program, such as an instant messaging application program, a shopping application program, a financial management application program, a multimedia playing program, etc., which is not limited in the embodiment. In the embodiment, the terminal 210 is taken as an example to perform accessibility testing on a webpage. Then, the terminal 210 inputs the URL of the webpage to be tested in the test platform, and sends a test request to the server 220, the test request including the URL of the webpage to be tested, and the server 220 is configured to perform accessibility testing on the webpage to be tested according to the test request. It is worth noting that when the terminal 210 performs accessibility testing on the display interface of the target application program, the program name of the target application program and the corresponding function module name can be sent to the server 220 for testing.

[0048] After receiving the test request reported by the terminal 210, the server 220 obtains the URL of the webpage to be tested from the test request, and obtains the webpage content of the test URL. At the same time, the server 220 simulates running the webpage to be tested, and respectively takes screenshots of the webpage to be tested in the normal display mode and the accessibility display mode, and performs OCR identification on the screenshot results, so as to generate an accessibility test report according to the OCR identification results and the webpage content, and obtain the accessibility test result corresponding to the webpage to be tested. In some embodiments, the accessibility test result is represented by an accessibility test score.

[0049] The terminal described above can be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, a smart television, a smart home device, a vehicle-mounted terminal, and various forms of terminal devices, which are not limited in the embodiment of the application.

[0050] It is worth noting that the server described above can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0051] Among them, cloud technology refers to the series of resources such as hardware, software, network, etc. in the wide area network or local area network, to realize the calculation, storage, processing and sharing of data. Cloud technology is based on the network technology, information technology, integration technology, management platform technology, application technology and other technologies applied in cloud computing business model, which can form a resource pool, and can be used as needed, flexible and convenient. Cloud computing technology will become an important support. The background service of the technical network system needs a lot of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, every item may have its own identification mark in the future, and it needs to be transmitted to the background system for logical processing. Different levels of data will be processed separately, and various industry data will need strong system support, which can only be realized through cloud computing.

[0052] In some embodiments, the above-mentioned server can also be implemented as a node in a blockchain system. Blockchain is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Blockchain is essentially a decentralized database, which is a series of data blocks associated using cryptographic methods, each of which contains information about a batch of network transactions, used to verify the validity of the information (anti-fake) and generate the next block. Blockchain can include blockchain underlying platform, platform product service layer and application service layer.

[0053] In combination with the above introduction, the test method of the display content provided by the present application is described. The method can be executed by a server or a terminal, or by a server and a terminal together. In the embodiments of the present application, the method is executed by the server, as shown in Figure 3 The method includes the following steps.

[0054] Step 301, obtaining the interface content of the target interface.

[0055] The interface content is the content configured to be displayed in the target interface. Alternatively, taking a web page as an example, the web page content of the target web page is obtained.

[0056] The interface content is the content configured to be displayed in the target interface in the web design process. The interface content can be fixed content directly set during the configuration process, such as control content, navigation bar content, icon content, etc., or the interface content can also be dynamic content displayed after being obtained according to the set acquisition path during the configuration process, such as real-time content obtained from database A, date display content, etc. In some embodiments, after obtaining the measured website, the legality of the website is verified by regular method. The legality verification is used to verify the running legality and running logic of the website.

[0057] In some embodiments, the interface content of the target interface is obtained by crawling. It can be understood that in the detailed description of the present application, the data related to interface content, interface image, etc. needs to be obtained with the consent of the user, and the collection, use and processing of the related data need to comply with the relevant laws, regulations and standards of the country and region.

[0058] Optionally, when obtaining the interface content of the target interface, at least one of the following interface content is included: text content (i.e. character content), image content, audio content, structural content, etc.

[0059] The text content refers to the character content displayed in the target interface, such as Chinese characters, English characters, etc., including pre-set static display content and real-time obtained dynamic display content.

[0060] The image content refers to the static / dynamic image displayed in the target interface, including pre-set static display images such as background images and images displayed in a preset position, and real-time obtained dynamic display images such as user avatars displayed in a webpage.

[0061] The audio content refers to the audio content played in the display process of the target interface, including pre-set audios such as background music and real-time obtained dynamic audios such as audio played for a received voice message.

[0062] The structural content refers to the layout structure when displaying the content of each part in the target interface, such as displaying social content in the form of feed flow or waterfall flow in the target interface, or dividing the target interface into left and right two parts for displaying function area a and function area b respectively.

[0063] It is worth noting that the above interface content is only an illustrative example, and the content form of the interface content is not limited in the embodiments of the present application.

[0064] Step 302, obtaining a first interface image of the target interface in a basic display mode.

[0065] The first interface image is used to represent the display content of the target interface in the basic display mode.

[0066] The basic display mode refers to a display mode automatically adapted by the target interface according to the size and resolution of the terminal display screen, and the interface display content in the target interface in the basic display mode is in a basic moderate size. Alternatively, the basic display mode is a mode corresponding to the basic display size of each display element designed in the development process of the target interface, that is, in the basic display mode, the display elements in the target interface are displayed in a size that matches each other and are uniformly distributed in the target interface.

[0067] Alternatively, the target interface runs in the basic display mode; a screenshot is taken of the running result of the target interface in the basic display mode to obtain a first interface image. That is, the first interface image is a screenshot when the target interface is displayed in the basic display mode.

[0068] In some embodiments, taking the target interface implemented as a web page interface as an example, the manner of obtaining the first interface image includes at least one of the following manners:

[0069] First, a browser is started by a headless browser software development kit (Software Development Kit, SDK) puppeteer, and the website of the web page under test is input and accessed; a screenshot of the browsing interface of the accessed web page under test is taken and saved as the first interface image;

[0070] Second, collection is performed by group control. The group control refers to controlling multiple devices with one device to achieve simultaneous and synchronous operation of the multiple devices, for example, controlling hundreds of mobile phones with one computer to achieve simultaneous and synchronous operation of the hundreds of mobile phones. The group control is divided into line control and cloud control. Taking cloud group control as an example, control instructions are sent to multiple devices by a cloud server to perform simultaneous and synchronous control operation. The multiple devices are controlled by the group control to run a browser to access the website under test, and a screenshot of the browsing interface of the accessed web page is taken and saved as the first interface image. Since multiple devices are controlled to access the website under test in the group control process, the multiple devices are different models of terminals; or the multiple devices are different brands of terminals; or the multiple devices are terminals with different screen sizes / shapes, which are not limited in the embodiment.

[0071] It is worth noting that the above-mentioned manner of obtaining the first interface image is only an illustrative example, which is not limited in the embodiment.

[0072] Step 303: obtaining a second interface image of the target interface in the barrier-free display mode.

[0073] The second interface image is used to represent the display content of the target interface in the barrier-free display mode.

[0074] The barrier-free display mode refers to a display mode in which the target interface is enlarged or emphasized to a certain extent on the basis of automatically adapting the display size. In the barrier-free display mode, the interface display content in the target interface is larger than the basic moderate size, such as the overall size of the control is larger than the basic size, and the font size of the text characters in the control is larger than the default moderate font size. In some embodiments, the barrier-free display mode is pre-set, and the interface display elements are pre-set to be enlarged by a preset magnification factor, and the interface elements are displayed in the barrier-free display mode.

[0075] Optionally, the target interface runs in the barrier-free display mode; and a second interface image is obtained by taking a screenshot of a running result of the target interface in the barrier-free display mode. That is, the second interface image is a screenshot of the target interface when displayed in the barrier-free display mode.

[0076] In some embodiments, taking the target interface implemented as a web page interface as an example, the manner of obtaining the second interface image includes at least one of the following manners:

[0077] First, a browser is started through a headless browser SDK (puppeteer), and a website of the web page to be tested is accessed by inputting the website address. When the web page to be tested is accessed, the font size, line height, and element size are set according to the barrier-free display mode for enlarged display, and a screenshot is taken and saved as the second interface image.

[0078] Second, the collection is performed through group control. The browser is controlled by the group control to access the website to be tested. In the process of accessing the web page, the enlarged display interface is screenshot and saved as the second interface image. Since the group control process controls multiple terminals to access the website to be tested, the multiple terminals are different models of terminals, different brands of terminals, or different screen sizes / shapes of terminals, which are not limited in the embodiment. The multiple terminals are controlled to access the website to be tested respectively, and the second interface image corresponding to each terminal is obtained according to the enlarged display result. The enlarged display includes: 1, directly enlarging and displaying the entire web page; and 2, enlarging and displaying the font size in the web page.

[0079] It is worth noting that the above-mentioned manner of obtaining the second interface image is only an illustrative example, which is not limited in the embodiment.

[0080] As shown in Figure 4 , the manner of obtaining the first interface image and the second interface image is as shown in Figure 4 , first, the website to be tested is input 400, and in the data collection stage, at least one of the following two cases is included:

[0081] 1. Puppeteer headless browser collection 410

[0082] When collecting through the puppeteer headless browser, first, open the browser and access the test website; take a screenshot of the access result (first interface image) and save it; second, set the font size, display elements, and line height magnification, and in some embodiments, the contrast of the webpage display also needs to be improved in the accessibility display mode; access the webpage and take a screenshot (second interface image) and save it.

[0083] Optionally, when collecting through the headless browser, simulate the effect of running the browser on different models and different brands of terminals through the headless browser, and take screenshots of the access results and magnification results respectively.

[0084] Illustratively, as shown in Figure 5 , the mobile terminal webpage controlled by puppeteer to access the test website is displayed on the interface 500, and the webpage effect diagram of the terminal of the specified model controlled by puppeteer to access the test website is displayed in the interface 500. Optionally, traverse the element attributes in the webpage dom node, control the font size and line height, and magnify it by 1.5 to 2 times to obtain the effect diagram 510.

[0085] 2. Group control collection 420

[0086] When collecting through the group control, first open the browser and access the test website; take a screenshot of the access result (first interface image) and save it; second, set the display magnification, that is, set the webpage to display with a certain magnification, access the webpage and take a screenshot (second interface image) and save it; in addition, set the font magnification, access the webpage and take a screenshot (second interface image) and save it.

[0087] Among them, the second interface image corresponding to the two different magnification methods in the group control collection 420 is analyzed subsequently, or one of them is analyzed subsequently.

[0088] It is worth noting that the above-mentioned puppeteer headless browser collection 410 and group control collection 420 can be applied alternatively, or can be applied simultaneously. When the puppeteer headless browser collection 410 and the group control collection 420 are applied simultaneously, the results obtained by the simultaneous application are fused to obtain the final test result.

[0089] Step 304, content recognition is performed on the first interface image to obtain first recognition content.

[0090] The first recognition content is content extracted from the first interface image, or the first recognition content is content obtained by image recognition on the first interface image. Illustratively, in the embodiments of the present application, taking testing of text displayed in the interface as an example, the first recognition content is text content obtained by text recognition on the first interface image.

[0091] That is, the interface content includes target text content in the target interface, text recognition is performed on the first interface image, and first text content in the first interface image is obtained as the first recognition content.

[0092] Step 305, content recognition is performed on the second interface image to obtain second recognition content.

[0093] The second recognition content is content extracted from the second interface image, or the second recognition content is content obtained by image recognition on the second interface image. Illustratively, in the embodiments of the present application, taking testing of text displayed in the interface as an example, the second recognition content is text content obtained by text recognition on the second interface image.

[0094] That is, text recognition is performed on the second interface image, and second text content in the second interface image is obtained as the second recognition content.

[0095] Step 306, based on the interface content, the first recognition content and the second recognition content, a barrier-free test result of the target interface is determined.

[0096] According to different content types of the first recognition content, the second recognition content and the interface content, the manner of determining the barrier-free test result includes at least one of the following cases:

[0097] First, the interface content includes target text content

[0098] The first text content is matched with the target text content to obtain a first matching result, the second text content is matched with the target text content to obtain a second matching result, and a barrier-free test result of the target interface is obtained based on a difference amplitude between the first matching result and the second matching result.

[0099] Second, the interface content includes target image content

[0100] The first image content cropped from the first interface image is matched with the target image content to obtain a first image matching result, the second image content cropped from the second interface image is matched with the target image content to obtain a second image matching result, and a barrier-free test result of the target interface is obtained based on a difference amplitude between the first image matching result and the second image matching result.

[0101] Third, the interface content includes structural content

[0102] Then, the first interface image is subjected to structural recognition to obtain first structural data, and the second interface image is subjected to structural recognition to obtain second structural data, wherein the first interface image and the second interface image are subjected to structural recognition by the neural network model obtained through pre-training. The structural content is matched with the first structural data to obtain a first structural matching result, and the structural content is matched with the second structural data to obtain a second structural matching result, and a difference between the first structural matching result and the second structural matching result is obtained to obtain the barrier-free test result of the target interface.

[0103] It is worth noting that the above-mentioned barrier-free test result acquisition method is only an illustrative example, and the present embodiment is not limited in this regard.

[0104] In summary, the test method for display content provided in the present embodiment compares the interface content obtained in the background when the target interface is configured with the display result in the basic display mode and the display result in the barrier-free display mode, thereby determining the difference between the content displayed in the barrier-free display mode and the content that should be displayed, obtaining the barrier-free test result, determining the display effect in the barrier-free mode, and improving the test accuracy and effectiveness of the barrier-free mode, which can intuitively reflect the information transmission effect of the content displayed in the barrier-free mode.

[0105] In an optional embodiment, the barrier-free test is performed by the target text content in the target interface. Figure 6 is a flowchart of a test method for display content provided in another exemplary embodiment of the present application. The method can be executed by a server or a terminal, or by a server and a terminal together. In the present embodiment, the method is executed by the server, as shown in Figure 6 The method includes the following steps.

[0106] Step 601: Obtain the interface content of the target interface.

[0107] The interface content is the content configured to be displayed in the target interface. Alternatively, taking a web page as an example, the interface content is the content configured to be displayed in the target interface during web page design, wherein the interface content can be fixed content directly set during the configuration process, or the interface content can also be dynamic content displayed after being obtained according to the set acquisition path during the configuration process.

[0108] Step 602: Obtain the first interface image of the target interface in the basic display mode.

[0109] The first interface image is used to represent the display content of the target interface in the basic display mode.

[0110] The basic display mode refers to a display mode that is automatically adapted by the target interface according to the size and resolution of the terminal display screen, and the interface display content in the target interface in the basic display mode is in a basic moderate size.

[0111] In step 603, a second interface image of the target interface in the barrier-free display mode is obtained.

[0112] The second interface image is used to represent the display content of the target interface in the barrier-free display mode.

[0113] The barrier-free display mode refers to a display mode in which the target interface is enlarged or strengthened to a certain extent on the basis of automatically adapting the display size, and the interface display content in the target interface in the barrier-free display mode is greater than the basic moderate size, such as the overall size of the control being greater than the basic size, and the font size of the text characters in the control being greater than the default moderate font size.

[0114] In step 604, text recognition is performed on the first interface image to obtain first text content in the first interface image as first recognition content, and to obtain a first confidence degree corresponding to each first character in the first text content.

[0115] In some embodiments, the first interface image is subjected to OCR recognition to obtain the first text content and the first confidence degree corresponding to each first character in the first text content. Optionally, the first interface image is subjected to OCR recognition through a pre-trained neural network model, or the first interface image is subjected to OCR recognition through a pre-set text recognition interface to call a text recognition function.

[0116] In some embodiments, after the first interface image is subjected to OCR recognition through a plurality of OCR recognition methods, the confidence degree of the first character in each OCR recognition is obtained, and the first confidence degree of the first character is finally obtained through weighted average of the confidence degrees.

[0117] Illustratively, after the first interface image is subjected to OCR recognition, the recognition result includes "I: 100", "want: 100", "send: 100", and "speak: 82", wherein the confidence degrees of "I", "want", and "send" are 100, and the confidence degree of "speak" is 82.

[0118] The confidence degree is the accuracy prediction data for the output result output by the machine learning model after recognition.

[0119] In some embodiments, the first character in the first text content whose first confidence degree is lower than a first threshold value is filtered.

[0120] That is, after OCR recognition, filtering is performed through the filtering stage, that is, the text in the interface content is extracted, the first character recognized by OCR is compared with the extracted text, and the text with low confidence in the first character is filtered to avoid noise. This stage is mainly to avoid some noise in OCR recognition and some low-confidence recognized text.

[0121] In step 605, text recognition is performed on the second interface image to obtain second text content in the second interface image as second recognition content, and to obtain a second confidence of each second character in the second text content.

[0122] In some embodiments, the second interface image is subjected to OCR recognition to obtain the second text content and the second confidence of each second character in the second text content. Optionally, the second interface image is subjected to OCR recognition by a pre-trained neural network model, or the second interface image is subjected to OCR recognition by calling a text recognition function through a pre-set text recognition interface.

[0123] In some embodiments, the second interface image is subjected to OCR recognition by a plurality of OCR recognition methods to obtain the confidence of the second character in each OCR recognition, and the second confidence of the second character is finally obtained by weighted average of the confidence.

[0124] In some embodiments, the second character with a second confidence lower than a second threshold in the second text content is filtered.

[0125] That is, after OCR recognition, filtering is performed through the filtering stage, that is, the text in the interface content is extracted, the second character recognized by OCR is compared with the extracted text, and the text with low confidence in the second character is filtered to avoid noise. This stage is mainly to avoid some noise in OCR recognition and some low-confidence recognized text.

[0126] In step 606, the first text content is matched with the target text content to obtain a first matching result.

[0127] Optionally, the first text content is aligned and matched with the characters in the target text content to obtain a first character corresponding to a target character in the target text content in the first text content, wherein the first character also corresponds to a first confidence. Optionally, according to the alignment and matching result, a first matching degree of the first character and the target character is determined.

[0128] In step 607, the second text content is matched with the target text content to obtain a second matching result.

[0129] Optionally, the second text content is aligned and matched with characters in the target text content to obtain a second character in the second text content corresponding to a target character in the target text content, where the second character also corresponds to a second confidence. Optionally, according to the alignment and matching result, a second matching degree of the second character and the target character is determined.

[0130] In step 608, an accessibility test result of the target interface is obtained based on a difference amplitude between the first matching result and the second matching result.

[0131] Optionally, based on the first matching degree of the first character and the target character and the second matching degree of the second character and the target character, a character test result corresponding to the target character is determined; and based on the character test result of each character in the target text content, the accessibility test result of the target interface is determined.

[0132] In some embodiments, the first confidence of the first character is determined as the first matching degree of the first character and the target character, the second confidence of the second character is determined as the second matching degree of the second character and the target character, and the character test result corresponding to the target character is determined based on the first confidence and the second confidence.

[0133] Illustratively, as shown in Table 1 below:

[0134] Table 1

[0135]

[0136] The first confidence of the character “point” is 100 and the second confidence is 100, i.e., the difference between the first confidence and the second confidence is 0; the first confidence of the character “click” is 100 and the second confidence is 100, i.e., the difference between the first confidence and the second confidence is 0; the first confidence of the character “and” is 100 and the second confidence is 100, i.e., the difference between the first confidence and the second confidence is 0; the first confidence of the character “enter” is 100 and the second confidence is 0, i.e., the difference between the first confidence and the second confidence is 100; and the first confidence of the character “into” is 100 and the second confidence is 0, i.e., the difference between the first confidence and the second confidence is 100.

[0137] That is, in the basic display mode, “click and enter” is completely displayed, while in the accessibility display mode, “enter” is not recognized, i.e., in the accessibility display mode, only “click and” is displayed.

[0138] Illustratively, as shown in Table 1 below: Figure 7 In the basic display mode, the control 710 is displayed, while in the accessibility display mode, the control 720 is displayed, and in the control 710, “click and enter” is completely displayed, while in the control 720, “click and” is displayed.

[0139] Indicative, such as Figure 8 As shown, the process includes three stages: original webpage content 810, basic mode screenshot 820, and accessibility mode screenshot 830.

[0140] After taking screenshots in basic mode 820 and accessibility mode 830, OCR recognition is performed on the captured images 840 to obtain the text and confidence level 850 in the screenshots. The original webpage content 810 is compared and analyzed with the text and confidence level 850 to generate an accessibility test report 860.

[0141] In summary, the display content testing method provided in this embodiment compares the interface content obtained in the background when configuring the target interface with the display results in the basic display mode and the display results in the accessibility display mode. This determines the difference between the content displayed in the accessibility display mode and the content that should be displayed, thereby obtaining the accessibility test results, determining the display effect in the accessibility mode, improving the accuracy and effectiveness of the accessibility mode test, and intuitively reflecting the information transmission effect of the content displayed in the accessibility mode.

[0142] The method provided in this embodiment uses the target text content in the target interface as a benchmark to compare the first text content displayed in the basic display mode with the second text content displayed in the accessibility display mode, and judges the fluctuation of the text in the basic display mode and the accessibility display mode, thereby determining the display accuracy of the accessibility display mode and improving the test accuracy of the accessibility display mode.

[0143] The method provided in this embodiment first filters out characters with low confidence after performing OCR recognition on the first interface image and the second interface image, so as to avoid the interference of low confidence text on the judgment of accessibility test and reduce noise.

[0144] The method provided in this embodiment performs character alignment matching between the first text content and the second text content and the target text content, thereby determining the fluctuation of each target character in the first text content and the second text content based on the alignment matching results, which improves the testing efficiency of accessibility display mode.

[0145] In an alternative embodiment, the accessibility test result is determined based on the fluctuation between the first confidence level and the second confidence level. Figure 9 This is a flowchart of a method for testing display content provided in another exemplary embodiment of this application. This method can be executed by a server or a terminal, or jointly by both. In this embodiment, the method is described using the server as an example. Figure 9 As shown, the method includes the following steps.

[0146] In step 901, interface content of the target interface is acquired.

[0147] The interface content is content configured to be displayed in the target interface.

[0148] Optionally, an interface element tree of the target interface is acquired, the interface element tree including tree nodes, and the interface content of the target interface is acquired by traversing the tree nodes in the interface element tree.

[0149] In step 902, a first interface image of the target interface in a basic display mode is acquired.

[0150] The first interface image is used to represent display content of the target interface in the basic display mode.

[0151] The basic display mode refers to a display mode automatically adapted by the target interface according to a size and resolution of a display screen of a terminal, and display content in the target interface in the basic display mode is in a basic moderate size.

[0152] In step 903, a second interface image of the target interface in an accessibility display mode is acquired.

[0153] The second interface image is used to represent display content of the target interface in the accessibility display mode.

[0154] The accessibility display mode refers to a display mode in which display elements are enlarged or emphasized to a certain extent on the basis of automatically adapting the display size, and display content in the target interface in the accessibility display mode is greater than the basic moderate size, for example, a whole size of a control is greater than a basic size, and a font size of text characters in the control is greater than a default moderate font size.

[0155] In step 904, text recognition is performed on the first interface image to obtain first text content in the first interface image as first recognition content, and to obtain a first confidence degree corresponding to each first character in the first text content.

[0156] In some embodiments, the first text content and the first confidence degree corresponding to each first character in the first text content are obtained by performing OCR recognition on the first interface image.

[0157] In step 905, text recognition is performed on the second interface image to obtain second text content in the second interface image as second recognition content, and to obtain a second confidence degree corresponding to each second character in the second text content.

[0158] In some embodiments, the second text content and the second confidence degree corresponding to each second character in the second text content are obtained by performing OCR recognition on the second interface image.

[0159] Step 906, obtaining a first character in the first text content corresponding to the target character in the target text content, and determining a first matching degree of the first character and the target character.

[0160] Optionally, the first confidence of the first character is determined as the first matching degree of the first character and the target character.

[0161] Step 907, obtaining a second character in the second text content corresponding to the target character in the target text content, and determining a second matching degree of the second character and the target character.

[0162] Optionally, the second confidence of the second character is determined as the second matching degree of the second character and the target character.

[0163] Step 908, determining a character test result corresponding to the target character based on the first matching degree of the first character and the target character and the second matching degree of the second character and the target character.

[0164] In some embodiments, a character score corresponding to the target character is determined as the character test result based on a difference between the first matching degree and the second matching degree.

[0165] Optionally, the character test result corresponding to the target character is determined based on the first confidence and the second confidence. Optionally, a difference between the first confidence and the second confidence is determined as the character test result corresponding to the target character, i.e., a fluctuation of the character under different display modes.

[0166] Step 909, determining an accessibility test result of the target interface based on the character test results of the characters in the target text content.

[0167] The character scores of the characters are fused based on the score threshold to obtain an accessibility test score corresponding to the target interface as the accessibility test result.

[0168] Optionally, display weights corresponding to the characters in the target text content are determined; the character scores of the characters are weightedly fused based on the display weights and the score threshold to obtain an accessibility test score corresponding to the target interface as the accessibility test result.

[0169] Illustratively, a calculation manner of the accessibility test score is shown in the following Formula One:

[0170] Formula One:

[0171] Wherein, W represents the accessibility test score, k represents a total number of characters, m represents a confidence fluctuation, i.e., a difference between the first confidence and the second confidence, and n represents a score threshold, i.e., a confidence difference threshold. Illustratively, n takes a value of 30.

[0172] As shown in Figure 10 As shown in FIG. 10, for the original webpage content 1000, the dom nodes of the original webpage content 1000 are traversed, and the text content 1010 is obtained from the dom nodes. The text and the confidence 1020 obtained by OCR recognition are obtained. First, based on the text content 1010, the text with low confidence in the text and the confidence 1020 is filtered to obtain the filtered text and the confidence 1030. The filtered text and the confidence 1030 are compared and analyzed to determine the text that has a large fluctuation between the basic display mode and the barrier-free display mode, and a barrier-free test report is generated.

[0173] In summary, the test method for displaying content provided in the embodiment compares the interface content obtained in the background when the target interface is configured with the display results in the basic display mode and the display results in the barrier-free display mode, to determine the difference between the content displayed in the barrier-free display mode and the content that should be displayed, thereby obtaining the barrier-free test result and determining the display effect in the barrier-free mode. The test accuracy and effectiveness of the barrier-free mode are improved, and the information transmission effect of the content displayed in the barrier-free mode can be intuitively reflected.

[0174] The method provided in the embodiment simulates the behavior of visually impaired people and the aging population using mobile terminal webpage applications, and judges the barrier-free effect through visual recognition means and front-back comparative analysis, which has more practical significance. The output report can actually help improve the experience of visually impaired people and the aging population using mobile terminal products.

[0175] As shown in Figure 11 is an interface diagram of the barrier-free test result provided in an example embodiment of the present application, as shown in Figure 11 In the test result interface 1100, the barrier-free test score 1110 and the problem instance display area 1120 are included. The problem instance display area 1120 includes character matching problems corresponding to the normal display mode and the barrier-free display mode, respectively.

[0176] Figure 12 is a structural block diagram of a test device for displaying content provided in an example embodiment of the present application, as shown in Figure 12 The device includes:

[0177] The acquisition module 1210 is configured to acquire interface content of a target interface, the interface content being content configured to be displayed in the target interface; acquire a first interface image of the target interface in a basic display mode, the first interface image being used to represent display content of the target interface in the basic display mode; and acquire a second interface image of the target interface in an accessibility display mode, the second interface image being used to represent display content of the target interface in the accessibility display mode.

[0178] The recognition module 1220 is configured to perform content recognition on the first interface image to obtain first recognition content, and perform content recognition on the second interface image to obtain second recognition content.

[0179] The determination module 1230 is configured to determine an accessibility test result of the target interface based on the interface content, the first recognition content, and the second recognition content.

[0180] In an optional embodiment, the interface content includes target text content in the target interface.

[0181] The recognition module 1220 is further configured to perform text recognition on the first interface image to obtain first text content in the first interface image as the first recognition content.

[0182] The recognition module 1220 is further configured to perform text recognition on the second interface image to obtain second text content in the second interface image as the second recognition content.

[0183] In an optional embodiment, as shown in Figure 13 The determination module 1230 includes:

[0184] The matching unit 1231 is configured to match the first text content with the target text content to obtain a first matching result.

[0185] The matching unit 1231 is further configured to match the second text content with the target text content to obtain a second matching result.

[0186] The determination unit 1232 is configured to determine the accessibility test result of the target interface based on a difference amplitude between the first matching result and the second matching result.

[0187] In an optional embodiment, the recognition module 1220 is further configured to perform text recognition on the first interface image to obtain a first confidence degree corresponding to each first character in the first text content; and perform text recognition on the second interface image to obtain a second confidence degree corresponding to each second character in the second text content.

[0188] The apparatus further includes:

[0189] The filtering module 1240 is configured to filter a first character in the first text content with a first confidence lower than a first threshold; and filter a second character in the second text content with a second confidence lower than a second threshold.

[0190] In an optional embodiment, the obtaining module 1210 is further configured to obtain a first character in the first text content corresponding to a target character in the target text content; and obtain a second character in the second text content corresponding to the target character in the target text content.

[0191] The determination unit 1232 is further configured to determine a character test result corresponding to the target character based on a first matching degree of the first character and the target character and a second matching degree of the second character and the target character; and determine an accessibility test result of the target interface based on the character test result of each character in the target text content.

[0192] In an optional embodiment, the determination unit 1232 is further configured to determine the first confidence of the first character as the first matching degree of the first character and the target character; and determine the second confidence of the second character as the second matching degree of the second character and the target character.

[0193] The determination unit 1232 is further configured to determine the character test result corresponding to the target character based on the first confidence and the second confidence.

[0194] In an optional embodiment, the determination unit 1232 is further configured to determine a character score corresponding to the target character as the character test result based on a difference between the first matching degree and the second matching degree.

[0195] The determination unit 1232 is further configured to fuse the character scores of each character based on a score threshold to obtain an accessibility test score corresponding to the target interface as the accessibility test result.

[0196] In an optional embodiment, the determination unit 1232 is further configured to determine a display weight corresponding to each character in the target text content; and perform weighted fusion on the character scores of each character based on the display weight and the score threshold to obtain an accessibility test score corresponding to the target interface as the accessibility test result.

[0197] In an optional embodiment, the obtaining module 1210 is further configured to obtain an interface element tree of the target interface, the interface element tree comprising a tree node; and traverse the tree node in the interface element tree to obtain the interface content of the target interface from the tree node.

[0198] In an optional embodiment, the obtaining module 1210 is further configured to run the target interface in the basic display mode; and capture a screenshot of a running result of the target interface in the basic display mode to obtain the first interface image.

[0199] The obtaining module 1210 is further configured to run the target interface in the barrier-free display mode; and capture a screenshot of a running result of the target interface in the barrier-free display mode to obtain the second interface image.

[0200] In an optional embodiment, the obtaining module 1210 is further configured to obtain the web content of the target webpage.

[0201] In summary, the display content testing device provided in this embodiment compares the interface content obtained by the target interface itself when configured in the background with the display result in the basic display mode and the display result in the barrier-free display mode, thereby determining the difference between the content displayed in the barrier-free display mode and the content that should be displayed, obtaining the barrier-free testing result, determining the display effect in the barrier-free mode, improving the testing accuracy and effectiveness of the barrier-free mode, and intuitively reflecting the information transmission effect of the content displayed in the barrier-free mode.

[0202] It should be noted that the display content testing device provided in the above embodiments is only exemplified by the division of the above functional modules, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the display content testing device and the display content testing method provided in the above embodiments belong to the same concept, and the specific implementation process is described in the method embodiments, which will not be described here.

[0203] Figure 14 A structural schematic diagram of a computer device provided in an example embodiment of the present application is shown. The computer device can be a terminal or a server as shown in Figure 2 .

[0204] In particular: the computer device 1400 includes a central processing unit (CPU) 1401, a system memory 1404 including a random access memory (RAM) 1402 and a read-only memory (ROM) 1403, and a system bus 1405 that couples the system memory 1404 to the central processing unit 1401. The computer device 1400 also includes a mass storage device 1406 for storing an operating system 1413, application programs 1414, and other program modules 1415.

[0205] The mass storage device 1406 connects to the central processing unit 1401 through a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1406 and its associated computer readable media provide non-volatile storage for the computer device 1400. That is, the mass storage device 1406 can include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.

[0206] Without loss of generality, computer readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), flash memory or other solid state memory technology, CD-ROM, digital versatile discs (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices. Of course, computer storage media does not limit to the above-mentioned several kinds. The system memory 1404 and the mass storage device 1406 mentioned above can be collectively referred to as memory.

[0207] According to various embodiments of the present application, the computer device 1400 can further operate connected to a network, such as the Internet, by a network connection. That is, the computer device 1400 can be connected to a network 1412 through a network interface unit 1411 connected to the system bus 1405, or can be connected to other types of networks or remote computer systems (not shown) using the network interface unit 1411.

[0208] The above-mentioned memory further includes one or more programs stored in the memory configured to be executed by the CPU.

[0209] Embodiments of the present application also provide a computer device, which can be implemented as a terminal or a server as shown in Figure 2 The computer device includes a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set, which are loaded and executed by the processor to implement the display content testing method provided by the above-mentioned method embodiments.

[0210] Embodiments of the present application also provide a computer readable storage medium, which stores at least one instruction, at least one program, a code set or an instruction set, which are loaded and executed by the processor to implement the display content testing method provided by the above-mentioned method embodiments.

[0211] Embodiments of the present application also provide a computer program product or a computer program, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the display content testing method described in any of the above-mentioned embodiments.

[0212] Optionally, the computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a solid state disk (SSD) or an optical disk. The random access memory can include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0213] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or can be instructed to relevant hardware by program. The program can be stored in a computer readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0214] The above only describes optional embodiments of the present application and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for testing displayed content, characterized in that, The method includes: Obtain the interface content of the target interface, wherein the interface content is the content configured to be displayed in the target interface, and the interface content includes structural content, wherein the structural content refers to the layout structure when displaying each part of the content in the target interface; Obtain a first interface image of the target interface in the basic display mode, wherein the first interface image is used to represent the display content of the target interface in the basic display mode; Acquire a second interface image of the target interface in an accessibility display mode, the second interface image being used to represent the display content of the target interface in the accessibility display mode; Perform content recognition on the first interface image to obtain first recognized content; and perform content recognition on the second interface image to obtain second recognized content; A first matching result is obtained based on the interface content and the first identification content. The first matching result includes a first structural matching result obtained by matching the structural content with the first structural data. The first identification content includes the first structural data obtained by performing structural identification on the first interface image. A second matching result is obtained based on the interface content and the second identification content. The second matching result includes a second structural matching result obtained by matching the structural content with the second structural data. The second identification content includes the second structural data obtained by performing structural identification on the second interface image. The accessibility test result of the target interface is determined based on the difference between the first matching result and the second matching result.

2. The method according to claim 1, characterized in that, The interface content includes the target text content in the target interface; The step of performing content recognition on the first interface image to obtain the first recognized content includes: Perform text recognition on the first interface image to obtain the first text content in the first interface image as the first recognized content; The step of performing content recognition on the second interface image to obtain the second recognized content includes: Text recognition is performed on the second interface image to obtain the second text content in the second interface image as the second recognition content.

3. The method according to claim 2, characterized in that, The step of obtaining a first matching result based on the interface content and the first identified content; and obtaining a second matching result based on the interface content and the second identified content, includes: The first text content is matched with the target text content to obtain the first matching result; The second text content is matched with the target text content to obtain the second matching result.

4. The method according to claim 3, characterized in that, The method further includes: Perform text recognition on the first interface image to obtain the first confidence level corresponding to each first character in the first text content; Perform text recognition on the second interface image to obtain the second confidence level corresponding to each second character in the second text content; Before matching the first text content with the target text content, the method further includes: Filter out the first character in the first text content whose first confidence level is lower than the first threshold; Filter out second characters in the second text content whose second confidence level is lower than the second threshold.

5. The method according to claim 3, characterized in that, Determining the accessibility test result of the target interface based on the difference between the first matching result and the second matching result includes: Obtain the first character in the first text content that corresponds to the target character in the target text content; Obtain the second character in the second text content that corresponds to the target character in the target text content; Based on the first matching degree between the first character and the target character, and the second matching degree between the second character and the target character, the character test result corresponding to the target character is determined; Based on the character test results of each character in the target text content, the accessibility test results of the target interface are determined.

6. The method according to claim 5, characterized in that, The step of determining the character test result corresponding to the target character based on the first matching degree between the first character and the target character, and the second matching degree between the second character and the target character, includes: The first confidence level of the first character is determined as the first matching degree between the first character and the target character; The second confidence level of the second character is determined as the second matching degree between the second character and the target character; The character test result corresponding to the target character is determined based on the first confidence level and the second confidence level.

7. The method according to claim 5, characterized in that, The step of determining the character test result corresponding to the target character based on the first matching degree between the first character and the target character, and the second matching degree between the second character and the target character, includes: Based on the difference between the first matching degree and the second matching degree, the character score corresponding to the target character is determined as the character test result; The process of determining the accessibility test result of the target interface based on the character test results of each character in the target text content includes: The character scores of each character are fused based on the score threshold to obtain the accessibility test score corresponding to the target interface, which is then used as the accessibility test result.

8. The method according to claim 7, characterized in that, The process of fusing the character scores of each character based on a score threshold to obtain the accessibility test score corresponding to the target interface as the accessibility test result includes: Determine the display weight of each character in the target text content; The character scores of each character are weighted and fused based on the display weight and the score threshold to obtain the accessibility test score corresponding to the target interface as the accessibility test result.

9. The method according to any one of claims 1 to 8, characterized in that, The acquisition of the target interface content includes: Obtain the interface element tree of the target interface, wherein the interface element tree includes tree nodes; Traverse the tree nodes in the interface element tree and obtain the interface content of the target interface from the tree nodes.

10. The method according to any one of claims 1 to 8, characterized in that, The step of acquiring the first interface image of the target interface in the basic display mode includes: The target interface is run in the basic display mode; a screenshot of the running result of the target interface in the basic display mode is taken to obtain the first interface image; The step of acquiring the second interface image of the target interface in accessibility display mode includes: The target interface is run in the accessibility display mode; a screenshot of the running result of the target interface in the accessibility display mode is taken to obtain the second interface image.

11. The method according to any one of claims 1 to 8, characterized in that, The acquisition of the target interface content includes: Retrieve the content of the target webpage.

12. A testing device for display content, characterized in that, The device includes: The acquisition module is used to acquire the interface content of the target interface, wherein the interface content is the content configured to be displayed in the target interface, and the interface content includes structural content, which refers to the layout structure when displaying each part of the content in the target interface; acquire a first interface image of the target interface in the basic display mode, wherein the first interface image is used to represent the display content of the target interface in the basic display mode; and acquire a second interface image of the target interface in the accessibility display mode, wherein the second interface image is used to represent the display content of the target interface in the accessibility display mode. The recognition module is used to perform content recognition on the first interface image to obtain first recognized content; and to perform content recognition on the second interface image to obtain second recognized content; The determining module is configured to obtain a first matching result based on the interface content and the first identified content, wherein the first matching result includes a first structural matching result obtained by matching the structural content with the first structural data, and the first identified content includes the first structural data obtained by performing structural recognition on the first interface image; and to obtain a second matching result based on the interface content and the second identified content, wherein the second matching result includes a second structural matching result obtained by matching the structural content with the second structural data, and the second identified content includes the second structural data obtained by performing structural recognition on the second interface image; and to determine the accessibility test result of the target interface based on the difference between the first matching result and the second matching result.

13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the test method for display content as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is loaded and executed by a processor to implement the test method for display content as described in any one of claims 1 to 11.

15. A computer program product, characterized in that, Includes a computer program or instructions that, when executed by a processor, implement the test method for display content as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Display adjustment method and device, storage medium and electronic equipment

    CN111949181A

  • Interface language display test method and device, computer equipment and storage medium

    CN112100063A

  • Interface testing method and device, equipment and storage medium

    CN112882947A