Test Method, Apparatus, Device, and Computer Program of Target Program
The simulator-based accessibility testing method enhances test efficiency by visually displaying accessibility information within a simulator, addressing the inefficiencies of traditional terminal-based methods.
Patent Information
- Application Number
- JP2024513528
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-11-26
- Filing Date
- 2022-10-10
- Publication Date
- 2025-08-04
- Estimated Expiration
- 2042-10-10
AI Technical Summary
Existing methods for testing the accessibility of Internet products, such as mini programs, require cumbersome operations on actual terminals and depend on terminal text-to-speech functions, leading to low test efficiency.
A simulator-based accessibility testing method and apparatus that displays accessibility design information visually, including accessibility reading and operable area information, through a toolbar with trigger controls, allowing direct visualization of accessibility features without executing the target program on an actual user terminal.
This approach significantly reduces the number of test steps and improves efficiency by enabling direct visualization of accessibility tests within a simulator, eliminating the need for actual terminal execution.
Smart Images

Figure 0007717966000001 
Figure 0007717966000002 
Figure 0007717966000003
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software testing. In particular, it relates to a method, apparatus, device, and storage medium for testing a target program.
[0002] This application claims priority to a Chinese patent application filed with the State Intellectual Property Office of China on November 26, 2021, with an application number of 202111424326.3 and an invention title of "Method, Apparatus, Device, and Storage Medium for Testing a Target Program", and all of its contents are incorporated herein by reference.
Background Art
[0003] In Internet products, barrier-free design mainly refers to the accessibility of Internet products. Barrier-free design is a characteristic that enables users to directly or indirectly recognize, understand, and exchange the content of Internet products. For example, visually impaired people can also normally use application programs with touch design.
[0004] Taking the development of a certain mini program (also called "mini program", "mini app", "applet") as an example, developers can preview the mini program on an actual client through the preview function of the developer tool, and after starting the barrier-free mode of the client, actually test the barrier-free characteristics of each component element in the mini program. For example, developers can start the screen reading mode by setting -> General -> Accessibility -> Start Narrator on the Apple operating system iOS, and when a certain component is focused, read out the information attached to the Accessible Rich Internet Applications (ARIA) label.
Summary of the Invention
Problems to be Solved by the Invention
[0005] The above test method has to be executed on an actual terminal. Not only are the operation steps cumbersome, but it also depends on the text-to-speech function on the terminal, resulting in low test efficiency.
[0006] This application provides a test method, apparatus, device, and storage medium for a target program. The technical solution is as follows.
Means for Solving the Problem
[0007] According to one aspect of this application, a test method for a target program executed by a terminal device is provided. The method includes: displaying a user interface of a simulator, where the target program is loaded into the simulator, and a program page of the target program is displayed on the user interface; responding to an activation operation of the accessibility mode, and activating the accessibility mode in the simulator; in the accessibility mode, displaying accessibility design information for page elements on the program page of the target program.
[0008] According to one aspect of this application, a test apparatus for a target program is provided. The apparatus includes: a display module for displaying a user interface of a simulator, where the target program is loaded into the simulator, and a program page of the target program is displayed on the user interface; a man-machine interaction module for activating the accessibility mode in the simulator in response to an activation operation of the accessibility mode; In the accessibility mode, an accessibility test module that displays accessibility design information on page elements in the program page of the target program.
[0009] In one possible design, the accessibility access information includes accessibility reading information, the display module displays a toolbar of the accessibility mode on the user interface of the simulator, the toolbar includes a first trigger control, and the accessibility test module responds to a trigger operation on the first trigger control to display the accessibility reading information on page elements in the program page of the target program.
[0010] In one possible design, the program page includes at least one page element having reading information. The accessibility test module responds to a trigger operation on the first trigger control to display a first marking frame on all or some of the page elements in the program page of the target program, and the reading information of the page elements is displayed in the first marking frame.
[0011] In one possible design, the accessibility test module reads the ARIA label of each page element in the program page of the target program in response to a trigger operation on the first trigger control, the reading information of the page element is recorded in the ARIA label, and based on the ARIA label of each page element, the first marking frame is displayed on each page element.
[0012] In one possible design, the accessibility access information includes accessibility operable area information. The display module displays the toolbar of the accessibility mode on the user interface of the simulator. The toolbar includes a second trigger control. The accessibility test module displays the operable area information of the accessibility on the page elements in the program page of the target program in response to a trigger operation on the second trigger control.
[0013] In one possible design, the program page includes at least one page element that supports human-machine interaction operations. The accessibility test module displays a second marking frame on all or some of the page elements in the program page of the target program in response to a trigger operation on the second trigger control. The operable area information of the page element is displayed in the second marking frame.
[0014] In one possible design, the accessibility test module reads, in response to a trigger operation on the second trigger control, each page element to which an operation element is bound and the operable area information of each page element in the program page of the target program, and displays the second marking frame on each page element based on the operable area information of each page element.
[0015] In one possible design, the display module displays the toolbar of the accessibility mode on the user interface of the simulator. The toolbar includes a first trigger control and a second trigger control. The accessibility test module responds to trigger operations on the first trigger control and the second trigger control, and displays a mixed marking frame on page elements in the program page of the target program. The mixed marking frame displays the accessible operable area information and the reading information.
[0016] In one possible design, the accessibility test module responds to the activation operation of the accessibility mode, introduces a script in the simulator plugin into the render layer code of the target program for execution. The simulator plugin provides the functions of the accessibility mode. After introducing the script, the program page of the target program is re-rendered.
[0017] In one possible design, the target program includes at least one of a web page program and a mini program, and the mini program is a program that is executed depending on a host program.
[0018] According to one aspect of the present application, a computer device is provided. The computer device includes a processor and a memory. A computer program is stored in the memory. When the computer program is executed by the processor, the computer device is caused to implement the above-mentioned test method for the target program.
[0019] According to another aspect of the present application, a computer-readable storage medium is provided. A computer program is stored in the storage medium. When the computer program is executed by a processor, the above-mentioned test method for the target program is realized.
[0020] According to another aspect of the present application, a computer program product is provided, in which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned test method for the target program is realized.
Advantages of the Invention
[0021] The beneficial effects of the technical solution provided by the embodiments of the present application include at least the following. By adding an accessibility mode to the simulator and displaying accessibility-related design information in the form of visualization information on the user interface of the simulator in the accessibility mode, the accessibility test of the simulator can be directly realized in a visualization manner, without the need to execute the target program on an actual user terminal, saving a large number of test steps and improving the test efficiency.
Brief Description of the Drawings
[0022]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
Figure 19
Figure 20
Best Mode for Carrying Out the Invention
[0023] To make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in more detail below in conjunction with the drawings.
[0024] FIG. 1 is a structural block diagram of a computer system 100 provided by an exemplary embodiment of the present application. The computer system 100 includes a terminal 120 and a server cluster 140. The "terminal device" referred to in the embodiments of the present application is abbreviated as "terminal".
[0025] The terminal 120 may be a smart phone, a tablet, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a desktop computer, etc. The terminal 120 is applied to the development, compilation, running and testing of target programs. The target program is an application program developed based on the Hyper Text Markup Language (HTML). Generally, the target program includes a web page application and a mini program. The web page application is an application executed by a conventional browser, and the mini program is an application executed depending on the execution environment provided by the host program. The host program provides a web-like execution environment for the mini program, so that the mini program is loaded into and executed in the execution environment provided by the host program. Optionally, a simulator of the target program is executed on the terminal 120, and the simulator simulates an execution environment for the target program.
[0026] The terminal 120 is connected to the server cluster 140 via a wired network or a wireless network.
[0027] The server cluster 140 is any one of a plurality of servers, virtual cloud storage, or a cloud computing center. The server cluster 140 provides background services to a predetermined application program on the terminal 120, a host program on the terminal 120, and a mini-program. The server cluster 140 has a data storage capacity. Optionally, the server cluster 140 includes a host program server 142 and a mini-program server 144. The host program server 142 provides background services to the host program on the terminal 120. The mini-program server 144 provides background services to the mini-program on the terminal 120.
[0028] In this embodiment, an example will be given where the server cluster 140 includes two servers. However, the number of servers included in the server cluster 140 may be two or more or two or less. For example, the server cluster 140 may be implemented by a plurality of simulators on one server or by dozens of servers. This embodiment does not limit this.
[0029] In a typical example, the terminal 120 includes an operating system 161, a host program 162, and a mini-program. Referring to FIG. 2 in combination, in the terminal 120, the operating system 161 is executed, and in the operating system 161, the host program 162 is executed. The host program 162 provides an environment for the execution of the mini-program. The terminal 120 constructs a mini-program logic layer unit 164b for realizing the mini-program and a corresponding mini-program render layer unit 164a based on the mini-program package. The mini-program logic layer unit 164b executes the page logic code in the package, and the mini-program render layer unit 164a executes the page structure code in the package and also executes the page style code in the package. The page logic code, page structure code, and page style code in the package are collectively referred to as page code.
[0030] The operating system 161 is a computer program that manages and controls the hardware and software resources in the terminal 120. It is the most basic system software that is directly executed on the bare machine of the terminal 120. Application programs are executed with the support of the operating system 161. The operating system 161 may be a desktop operating system such as the Windows (registered trademark) operating system, or the Linux (registered trademark) operating system, or the Mac OS (Apple desktop operating system), or it may be a mobile operating system such as the iOS (Apple mobile terminal operating system) or the Android (registered trademark) operating system.
[0031] The host program 162 is an application program that hosts mini-programs and provides an environment for the realization of mini-programs. The host program 162 is a native application program. A native application program is an application program that can be directly executed by the operating system 161. The host program 162 may be a social application program, a dedicated application program that specifically supports mini-programs, a file management application program, a mail application program, or a game application program, etc. The social application program may include an instant messaging application, an SNS (Social Network Service) application, or a live streaming application, etc. A mini-program is an application program that runs in the environment provided by the host program. Specifically, the mini-program may be a social application program, a file management application program, a mail application program, or a game application program, etc.
[0032] The mini-program logic layer unit 164b and the corresponding mini-program renderer layer (also called the view layer) unit 164a realize a mini-program instance. One mini-program is realized by one mini-program logic layer unit 164b and at least one mini-program renderer layer unit 164a. There is a one-to-one correspondence between the mini-program renderer layer unit 164a and the mini-program page.
[0033] The mini-program renderer layer unit 164a organizes and renders the views of the mini-program. The mini-program logic layer unit 164b processes the data processing logic of the mini-program and the corresponding mini-program pages. The unit may specifically be a process or a thread. For example, the mini-program renderer layer unit 164a is, for example, a mini-program renderer layer thread, and the mini-program logic layer unit 164b is, for example, a mini-program logic layer thread. The mini-program logic layer unit 164b can be executed in a simulator. The mini-program renderer layer unit 164a and the mini-program logic layer unit 164b perform relay communication through the host program native unit 162a. The host program native unit 162a is a communication interface between the host program 162 and the mini-program. The host program native unit 162a may be a thread or a process of the host program 162 itself. When the page logic code belonging to the package of each mini-program page is registered and the registered page logic code is executed when the mini-program logic layer unit 164b starts up and uses the page logic code to process data.
[0034] Optionally, in a development environment, instead of the above host program, developer tools such as a compiler device, a simulator, etc. may be used. The developer tool provides an execution environment for the target program.
[0035] Figure 3 is a flowchart of a test method for a target program provided by one exemplary embodiment of the present application. The method is applied to or executed by a terminal. The method includes at least one of the following steps 302 to 306. Step 302: Display the user interface of the simulator. The target program is loaded into the simulator, and the program page of the target program is displayed on the user interface.
[0036] The simulator is a program tool that simulates and executes the target program. Exemplarily, the simulator can be an individual program or a function in developer tools.
[0037] Generally speaking, developer tools provide functions such as simulators, editors, debuggers, visualization, and cloud development. Developers can start the simulator in the developer tools and use the simulator to load the target program.
[0038] The terminal displays the user interface of the simulator. The target program is loaded into the simulator, and the program page of the target program is displayed on the user interface. Generally speaking, the program page can be obtained by rendering based on the render layer code of the target program.
[0039] Step 304: In response to the activation operation of the accessibility mode, activate the accessibility mode in the simulator.
[0040] The simulator provides an accessibility mode. The accessibility mode is a mode that simulates the operating system, activates the barrier-free mode, and then executes the target program. The accessibility mode may be called the barrier-free mode, the barrier-free debug mode, etc.
[0041] The user interface of the simulator displays a trigger entry for the accessibility mode, and the trigger entry includes a menu bar, function buttons, gesture trigger entries, etc. Referring to FIG. 4 in combination, a menu bar 40 is provided in the user interface of the simulator. The menu items of the menu bar 40 display a mini-program mode 42, a plugin mode 44, and an accessibility mode 46.
[0042] The activation operation includes, but is not limited to, click operations, double-click operations, slide operations, gesture operations, somatosensory operations, pressure touch operations, binocular fixation operations, etc.
[0043] Generally, after the user clicks on the accessibility mode 46, the simulator activates the accessibility mode.
[0044] Step 306: In the accessibility mode, display the accessibility design information on the page elements in the program page of the target program.
[0045] Generally, the accessibility design information includes accessible operable area information and accessible reading information.
[0046] The accessible operable area information indicates, in the accessibility mode, the corresponding operation area of each page element that can respond to man-machine interaction operations on the program page.
[0047] The accessible reading information indicates, in the accessibility mode, the voice information that triggers reading after a page element receives a man-machine interaction operation.
[0048] As described above, according to the method provided in this embodiment, an accessibility mode is added to the simulator, and in the accessibility mode, accessibility-related design information is displayed on the user interface of the simulator in the form of visualization information, so that the accessibility test of the simulator can be directly realized in a visualization manner. On an actual user terminal, it is not necessary to execute the target program, saving a large number of test steps and improving the test efficiency.
[0049] FIG. 5 is a flowchart of a test method for a target program provided by an exemplary embodiment of the present application. The method is applied to a terminal or executed by a terminal. The method includes at least one of the following steps 402 to 410. Step 402: Display the user interface of the simulator. The target program is loaded into the simulator, and the program page of the target program is displayed on the user interface.
[0050] The simulator is a program tool for simulating and executing a target program. Exemplarily, the simulator is an individual program or a function in developer tools.
[0051] Generally, developer tools provide functions such as simulators, editors, debuggers, visualization, and cloud development. Developers can start the simulator in the developer tools and use the simulator to load the target program.
[0052] The terminal displays the user interface of the simulator. The target program is loaded into the simulator, and the program page of the target program is displayed on the user interface. Generally, the program page is obtained by rendering based on the render layer code of the target program.
[0053] Step 404: In response to the activation operation of the accessibility mode, activate the accessibility mode in the simulator.
[0054] The simulator provides an accessibility mode, which is a mode that simulates the operating system, activates the barrier-free mode, and then executes the target program. The accessibility mode may be called, for example, the barrier-free mode, the barrier-free debug mode, etc.
[0055] The trigger entry for the accessibility mode is displayed on the user interface of the simulator, and the trigger entry may be, for example, a menu bar, a function button, a gesture trigger entry, etc. Referring to FIG. 4, the user interface of the simulator provides a menu bar 40. The menu items of the menu bar 40 display a mini-program mode 42, a plug-in mode 44, and an accessibility mode 46.
[0056] The activation operation includes, but is not limited to, a single-click operation, a double-click operation, a slide operation, a gesture operation, a somatosensory operation, a pressure touch operation, a binocular fixation operation, etc.
[0057] Generally, after the user clicks the accessibility mode 46, the accessibility mode is activated in the simulator.
[0058] Step 406: Display a toolbar for the accessibility mode on the user interface of the simulator, and the toolbar includes a first trigger control and / or a second trigger control.
[0059] As shown in FIG. 6, after activating the accessibility mode, a toolbar 50 of the accessibility mode is added to and displayed on the user interface of the simulator, and a first trigger control 51 and / or a second trigger control 52 are displayed on the toolbar 50.
[0060] The first trigger control 51 is a control for triggering and displaying the accessibility reading information. The second trigger control 52 is a control for triggering and displaying the accessibility operable area information.
[0061] The control types of the first trigger control 51 and the second trigger control 52 may be buttons, check boxes, menu bars, etc. Since the accessibility reading information is usually called screen reading, the first trigger control 51 is the "scanning screen reading" 51, and the second trigger control 52 is the "scanning hot area" button 52.
[0062] In some embodiments, the toolbar further includes a third trigger control. The third trigger control is a control for triggering and displaying the accessibility reading information and the accessibility operable area information.
[0063] Step 408: In response to a trigger operation on the first trigger control, display the accessibility reading information on the page elements in the program page of the target program.
[0064] In some embodiments, in response to a trigger operation on the first trigger control, display the accessibility reading information on the page elements in the program page of the target program.
[0065] The trigger operation includes, but is not limited to, a single click operation, a double click operation, a slide operation, a gesture operation, a somatosensory operation, a pressure touch operation, a binocular gaze operation, etc.
[0066] The program page of the target program includes a plurality of page elements (corresponding to the first page element) having reading information. All or some of the page elements read out the accessibility reading information after being triggered (e.g., clicked).
[0067] In the accessibility test mode, since the accessibility reading information is generally text, the reading information is displayed on the page element in the form of text. It is not necessary to click on each page element one by one, and the reading information of multiple page elements can be displayed simultaneously. On the other hand, the display by the visualized text is intuitive and can greatly improve the test efficiency.
[0068] Generally speaking, in response to a trigger operation on the first trigger control, a first marking frame is displayed on each page element in the program page of the target program, and the reading information of the page element is displayed in the first marking frame. For the page element having the reading information, a respective first marking frame is associated with each page element, that is, the page element having the reading information corresponds one by one to the first marking frame.
[0069] As shown in FIGS. 7, 8, and 9 (executing a floating overlay for FIGS. 7 and 8 to obtain FIG. 9), after the "Scanning Screen Reading" control 51 is checked, accessibility reading information 53 for each page element is added to the program page and displayed. Generally, a first marking frame is added to each page element, and the reading information of the current page element is displayed in the first marking frame. For example, for the page element 54, the corresponding reading information is "image", and for example, for the page element "Service Platform" 55, the corresponding reading information is "Service Platform", and further, for example, for the page element "Search Box" 56, the corresponding reading information is "Search, Text Box", and details are not elaborated here.
[0070] Optionally, the length and width of the first marking frame are related to the size of the current page element. For example, the length and width of the first marking frame are less than or equal to the length and width of the current page element. Optionally, the present application does not limit the display style of the first marking frame. For example, when the first marking frame is displayed, the page element below the first marking frame may be obscured, and the first marking frame is opaque or semi-transparent.
[0071] Optionally, in response to a selection operation on the first marking frame, the length and width of the first marking frame and / or the display style of the first marking frame are changed. The selection operation includes, but is not limited to, touch operations, click operations, touch hovering operations, etc.
[0072] In one example, the first marking frame is in a translucent form by default. When signals such as touch signals, click signals, and touch hovering signals are detected in the first marking frame, the first marking frame is switched to an opaque form. And / or, the first marking frame is in the form of a first length and width by default. When signals such as touch signals, click signals, and touch hovering signals are detected in the first marking frame, the first marking frame is switched to the form of a second length and width, and the second length and width are larger than the first length and width.
[0073] Step 410: In response to a trigger operation on the second trigger control, display accessibility operable area information on page elements in the program page of the target program.
[0074] In some embodiments, in response to a trigger operation on the second trigger control, display accessibility operable area information on page elements in the program page of the target program.
[0075] The trigger operation includes, but is not limited to, single click operation, double click operation, slide operation, gesture operation, somatosensory operation, pressure touch operation, binocular fixation operation, etc.
[0076] The program page of the target program includes a plurality of page elements (corresponding to the second page elements) that support man-machine interaction operations. All or some of the page elements display accessibility operable area information after being triggered (e.g., clicked). Here, in the same program page, the first page element and the second page element are not necessarily the same, and the two may be different.
[0077] In the accessibility test mode, since the accessible area information of the accessibility is generally text, the accessible area information is displayed in the form of text on the page element. It is not necessary to click on each page element one by one, and the accessible area information of multiple page elements can be displayed simultaneously. On the other hand, the display by the visualized text is intuitive and can greatly improve the test efficiency.
[0078] Generally, in response to a trigger operation on the second trigger control, a second marking frame is displayed on each page element in the program page of the target program, and the accessible area information of the page element is displayed in the second marking frame. For a page element having accessible area information, each page element is associated with its respective second marking frame, that is, the page element having accessible area information corresponds one by one to the second marking frame.
[0079] As shown in FIGS. 10, 11, and 12 (a floating overlay is performed on FIGS. 10 and 11 to obtain FIG. 12), after the "scanning hot area" button 52 is checked, the accessible area information 57 of all or some of the page elements is added and displayed on the program page. Generally, a second marking frame is added to each page element, and the accessible area information of the current page element is displayed in the second marking frame. The accessible area information is indicated by "length * width".
[0080] Optionally, the length and width of the second marking frame are related to the size of the current page element. For example, the length and width of the second marking frame are the same as, slightly smaller than, or slightly larger than the length and width of the current page element. Optionally, the present application does not limit the display style of the second marking frame. For example, when the second marking frame is displayed, the page element below the second marking frame may be shielded, and the second marking frame is opaque or translucent.
[0081] Optionally, in response to a selection operation on the second marking frame, the length, width, and / or display style of the first marking frame is changed. The selection operation includes, but is not limited to, touch operations, click operations, touch hovering operations, etc.
[0082] In one example, the second marking frame is, by default, in a semi-transparent form. When signals such as touch signals, click signals, and touch hovering signals are detected in the second marking frame, the second marking frame is switched to an opaque form. And / or, the second marking frame is, by default, in the form of the first length and width. When signals such as touch signals, click signals, and touch hovering signals are detected in the second marking frame, the second marking frame is switched to the form of the second length and width, and the second length and width are larger than the first length and width.
[0083] Here, in some embodiments, in response to trigger operations on the first trigger control and the second trigger control, a mixed marking frame is displayed for each page element in the program page of the target program, and the current page element's reading information and operable area information are displayed in the mixed marking frame. The mixed marking frame may be the first marking frame and the second marking frame superimposed, or the first marking frame and the second marking frame may be merged into one marking frame.
[0084] As shown in FIG. 9, after both the "Scanning Hot Area" button and the "Scanning Screen Reading" button on the toolbar 50 are checked, the accessible operable area information and screen reading information 58 of all or some page elements are added to and displayed on the program page. Generally, a mixed marking frame is added to each page element, and the operable area information and reading information of the current page element are displayed in the mixed marking frame.
[0085] In some embodiments, in response to a trigger operation on a third trigger control, a mixed marking frame is displayed for each page element in the program page of the target program, and the mixed marking frame displays the reading information and operable area information of the current page element. The mixed marking frame may be a superimposed first marking frame and second marking frame, or the first marking frame and the second marking frame may be merged into one marking frame.
[0086] The functions of "scanning screen reading" and / or "scanning hot area" are respectively realized by the first trigger control, the second trigger control, or the third trigger control, and the classification and visualization test for the functions provided by the accessibility mode are realized.
[0087] As described above, according to the method provided in this embodiment, an accessibility mode is added to the simulator, and in the accessibility mode, accessibility-related design information is displayed in the form of visualization information on the user interface of the simulator, so that the accessibility test of the simulator can be directly realized in a visualization manner, without the need to run the target program on an actual user terminal, saving a large number of test steps and improving the test efficiency.
[0088] FIG. 16 is a flowchart of a test method for a target program provided by one exemplary embodiment of the present application. The method is applied to a terminal or executed by a terminal. The method includes at least one of the following steps 502 to 516. Step 502: Display the user interface of the simulator. The target program is loaded into the simulator, and the program page of the target program is displayed on the user interface.
[0089] A simulator is a program tool that simulates and executes a target program. Exemplarily, a simulator is an individual program or a function in developer tools.
[0090] Generally speaking, developer tools provide functions such as simulators, editors, debuggers, visualization, and cloud development. Developers can start a simulator in the developer tools and use the simulator to load a target program.
[0091] The terminal displays the user interface of the simulator. The target program is loaded into the simulator, and the program page of the target program is displayed on the user interface. Generally speaking, the program page is obtained by rendering based on the render layer code of the target program.
[0092] Step 504: In response to the activation operation of the accessibility mode, introduce and execute the script in the simulator plugin into the render layer code of the target program. The simulator plugin provides the functions of the accessibility mode.
[0093] The simulator provides an accessibility mode. The accessibility mode is a mode that simulates the operating system, activates the barrier-free mode, and then executes the target program. The accessibility mode may be called the barrier-free mode, the barrier-free debug mode, etc.
[0094] The user interface of the simulator displays a trigger entry for the accessibility mode, and the trigger entry can be a menu bar, a function button, a gesture trigger entry, etc. Referring to FIG. 4, a menu bar 50 is provided in the user interface of the simulator. The menu items of the menu bar 50 display a mini-program mode 42, a plugin mode 44, and an accessibility mode 46.
[0095] The activation operation includes, but is not limited to, a single-click operation, a double-click operation, a slide operation, a gesture operation, a somatosensory operation, a pressure touch operation, a binocular fixation operation, etc.
[0096] Generally, after the user clicks on the accessibility mode 46, the simulator activates the accessibility mode.
[0097] Referring to FIG. 17, the accessibility mode is realized using a plugin 62 in the developer tools 60. After the user clicks on the accessibility mode, the developer tools 60 reads and executes the plugin code of the plugin 62. The plugin has a built-in script 64, and by inserting the script into the render layer code of the target program to be executed by the simulator 66 via the program interface of the developer tools, the accessibility mode function provided by the plugin is executed.
[0098] Step 506: After introducing the script, re-render the program page of the target program.
[0099] Even in the process of re-rendering the program page of the target program, the script is executed. The script provides a toolbar for the accessibility mode.
[0100] Step 508: Display a toolbar in the accessibility mode on the user interface of the simulator, where the toolbar includes a first trigger control and / or a second trigger control.
[0101] As shown in FIG. 6, after activating the accessibility mode, add and display a toolbar 50 in the accessibility mode on the user interface of the simulator. The toolbar 50 displays a first trigger control 51 and / or a second trigger control 52.
[0102] The first trigger control 51 is a control for triggering and displaying the accessibility reading information. The second trigger control 52 is a control for triggering and displaying the accessibility operable area information.
[0103] The control types of the first trigger control 51 and the second trigger control 52 may be buttons, check boxes, menu bars, etc. Since the accessibility reading information is usually called screen reading, the first trigger control 51 is the "scanning screen reading" 51, and the second trigger control 52 is the "scanning hot area" button 52.
[0104] In some embodiments, the toolbar further includes a third trigger control. The third trigger control is a control for triggering and displaying the accessibility reading information and the accessibility operable area information.
[0105] Step 510: In response to a trigger operation on the first trigger control, read the ARIA label of each page element in the program page of the target program, where the reading information of the page element is recorded in the ARIA label.
[0106] In some embodiments, in response to a trigger operation on a first trigger control, the ARIA label of each page element in the program page of the target program is read, and the reading information of the page element is recorded in the ARIA label.
[0107] The trigger operation includes, but is not limited to, a single click operation, a double click operation, a slide operation, a gesture operation, a somatosensory operation, a pressure touch operation, a binocular fixation operation, etc.
[0108] The program page of the target program includes a plurality of page elements, and all or some of the page elements read the accessibility reading information after being triggered (for example, clicked).
[0109] An ARIA label is bound to all or some of the page elements, and the reading information of the page elements is recorded in the ARIA label.
[0110] Step 512: Based on the ARIA label of each page element, display a first marking frame for each page element. For the page elements including ARIA labels, based on the ARIA label of each page element, generate a first marking frame for each page element.
[0111] Generally, in response to a trigger operation on the first trigger control, a first marking frame is displayed for each page element in the program page of the target program, and the reading information of the page element is displayed in the first marking frame. For the page elements with reading information, a respective first marking frame is associated with each page element, that is, the page elements with reading information respectively correspond to the first marking frames.
[0112] As shown in FIGS. 7, 8, and 9 (a floating overlay is performed on FIGS. 7 and 8 to obtain FIG. 9), after the "Scanning Screen Reading" control 51 is checked, the program page adds and displays the accessibility reading information 53 of each page element. Generally, a first marking frame is added to each page element, and the reading information of the current page element is displayed in the first marking frame. For example, for the page element 54, the corresponding reading information is "image", and for example, for the page element "Service Platform" 55, the corresponding reading information is "Service Platform", and further, for example, for the page element "Search Box" 56, the corresponding reading information is "Search, Text Box", and details are not elaborated here.
[0113] Optionally, the length and width of the first marking frame are related to the size of the current page element. For example, the length and width of the first marking frame are the same as, slightly smaller than, or slightly larger than the length and width of the current page element. When the first marking frame is displayed, the page element below the first marking frame may be obscured, and the first marking frame is opaque or translucent.
[0114] In one example, the first marking frame is in a translucent form by default. When signals such as touch signals, click signals, and touch hovering signals are detected in the first marking frame, the first marking frame is switched to an opaque form. And / or the first marking frame is in the form of a first length and width by default. When signals such as touch signals, click signals, and touch hovering signals are detected in the first marking frame, the first marking frame is switched to the form of a second length and width, and the second length and width are larger than the first length and width.
[0115] Based on the ARIA label of each page element, by displaying the first marking frame for each page element, the accuracy of the display of the first marking frame is guaranteed.
[0116] Step 514: In response to a trigger operation on the second trigger control, read each page element to which an operation element is bound and the operable area information of each page element in the program page of the target program.
[0117] In some embodiments, in response to a trigger operation on the second trigger control, read each page element to which an operation element is bound and the operable area information of each page element in the program page of the target program.
[0118] The trigger operation includes, but is not limited to, a single click operation, a double click operation, a slide operation, a gesture operation, a somatosensory operation, a pressure touch operation, a binocular fixation operation, etc.
[0119] The program page of the target program includes a plurality of page elements, and all or some of the page elements display operable area information accessible after being triggered (e.g., clicked).
[0120] Step 516: Based on the operable area information of each page element, display a second marking frame on each page element.
[0121] In the accessibility test mode, since the operable area information of accessibility is generally text, the operable area information is displayed on the page element in text form. It is not necessary to click each page element one by one, and the operable area information of multiple page elements can be displayed simultaneously. On the other hand, the display by visualized text is intuitive and can greatly improve the test efficiency.
[0122] Generally, in response to a trigger operation on the second trigger control, a second marking frame is displayed for each page element in the program page of the target program, and the operable area information of the page element is displayed in the second marking frame. For a page element having operable area information, a second marking frame is associated with each page element, that is, a page element having operable area information corresponds to a second marking frame respectively.
[0123] As shown in FIGS. 10, 11, and 12 (a floating overlay is performed on FIGS. 10 and 11 to obtain FIG. 12), after the “scanning hot area” button 52 is checked, the accessible operable area information 57 of all or some of the page elements is added and displayed on the program page. Generally, a second marking frame is added to each page element, and the operable area information of the current page element is displayed in the second marking frame. The operable area information is indicated by “length * width”.
[0124] Optionally, the length and width of the second marking frame are related to the size of the current page element. For example, the length and width of the second marking frame are the same as, slightly smaller than, or slightly larger than the length and width of the current page element. When the second marking frame is displayed, the page element below the second marking frame may be obscured, and the second marking frame is opaque or translucent.
[0125] In one example, the second marking frame is in a semi-transparent form by default. When signals such as touch signals, click signals, and touch hovering signals are detected in the second marking frame, the second marking frame is switched to an opaque form. And / or, the second marking frame is in the form of a first length and width by default. When signals such as touch signals, click signals, and touch hovering signals are detected in the second marking frame, the second marking frame is switched to the form of a second length and width, and the second length and width are larger than the first length and width.
[0126] Based on the operable area information of each page element, by displaying the second marking frame on each page element, the accuracy of the display of the second marking frame is guaranteed.
[0127] Here, in some embodiments, in response to a trigger operation on the first trigger control and the second trigger control, a mixed marking frame is displayed on each page element in the program page of the target program, and the current page element's reading information and operable area information are displayed in the mixed marking frame.
[0128] As shown in FIGS. 13, 14, and 15 (obtaining FIG. 15 by performing a floating overlay on FIGS. 13 and 14), after both the "Scanning Hot Area" button and the "Scanning Screen Reading" button on the toolbar 50 are checked, the accessible operable area information and screen reading information 58 of all or some page elements are added to and displayed on the program page. Generally, a mixed marking frame is added to each page element, and the operable area information and reading information of the current page element are displayed in the mixed marking frame.
[0129] In some embodiments, in response to a trigger operation on a third trigger control, a mixed marking frame is displayed for each page element in the program page of the target program, and the mixed marking frame displays the reading information and operable area information of the current page element.
[0130] As described above, according to the method provided in this embodiment, an accessibility mode is added to the simulator, and in the accessibility mode, accessibility-related design information is displayed on the user interface of the simulator in the form of visualization information, so that the accessibility test of the simulator can be directly realized in a visualization manner, without the need to run the target program on an actual user terminal, saving a large number of test steps and improving the test efficiency.
[0131] In one example, referring to FIG. 18, 1. The user switches to the accessibility mode in the developer tools. 2. The developer tools call the accessibility mode plugin and call the plugin code to execute it. 3. The simulator in the developer tools inserts the plugin script into the render layer of the mini-program. First, the simulator obtains the page structure of the render layer of the mini-program and inserts another script page element into the page structure of the render layer. The script page element displays "scanning hot area" and "scanning screen reading", and binds the event selection logic of the scanning hot area and the scanning screen reading respectively. 4. The user clicks on the "scanning hot area". 5. The script traverses all page elements of the render layer to recognize the hot area, finds the operable page elements (such as input boxes and page elements with click events bound), and obtains the width and height of these page elements. 6. The script generates another blue frame to display the hot area page element. 7. The user clicks on the "scanning screen reading". 8. The script also traverses all page elements of the render layer to recognize the accessibility reading information. 9. The script reads the attributes of the page elements (such as the page element component name, etc.) and the additional information attached to the ARIA label, and finally marks the screen reading content by generating another red frame.
[0132] Taking a simple page with only one button as an example, one click event is bound to the button, and the code is as follows: 〈button bindtap=”clickMe”〉Click Me〈 / button〉 The script obtains the actual rendering information of the button, which is as follows: 〈wx-button exparser:info-class-prefix=”“ exparser:info-component-id=”3” exparser:info-attr-bindtap=”clickMe” role=”button” aria-disabled=”false” wx:nodeid=”9”〉Click Me〈 / wx-button〉
[0133] After the user selects the "scanning hot area", the script traverses the button structure. If "exparser:info-attr-bindtap" is included in the attributes, one event is bound to the button, which means it is an operable page element rather than a simple display content. Therefore, after the script obtains the style (width, height, and position information) of the page element, it generates a blue frame with the same width and height at the same position to surround the page element, and displays the width and height of the page element at the upper left corner.
[0134] After the user selects "scanning screen reading", similarly, the script traverses the page element, which is the button label and its corresponding meaning is "button", and the text of the button is "Click Me", so the reading content is "Click Me, button". The script records the screen reading content of the page element, obtains the width, height, and position information of the page element, and similarly generates a red frame with the same height as the button at the same position to surround the button, and displays "Click Me, button", which is the text content of the screen reading, at the upper left corner of the red frame.
[0135] FIG. 19 is a block diagram of a test apparatus for a target program provided by one exemplary embodiment of the present application. The apparatus includes A display module 1320 that displays a user interface of the simulator, wherein the target program is loaded into the simulator, and a program page of the target program is displayed on the user interface. An activation module 1340 that activates the accessibility mode in the simulator in response to an activation operation of the accessibility mode. An accessibility test module 1360 that displays accessibility design information on page elements in a program page of the target program in the accessibility mode.
[0136] In one exemplary embodiment, the accessibility access information includes accessibility reading information. The display module 1320 displays a toolbar of the accessibility mode on the user interface of the simulator. The toolbar includes a first trigger control. The accessibility test module 1360 displays the accessibility reading information on page elements in a program page of the target program in response to a trigger operation on the first trigger control.
[0137] In one exemplary embodiment, the program page includes at least one page element having reading information. The accessibility test module 1360 displays a first marking frame on all or some of the page elements in a program page of the target program in response to a trigger operation on the first trigger control, and the reading information of the page elements is displayed in the first marking frame.
[0138] In one exemplary embodiment, in response to a trigger operation on the first trigger control, the accessibility test module 1360 reads the ARIA label of each page element in the program page of the target program, the ARIA label records the reading information of the page element, and based on the ARIA label of each page element, the first marking frame is displayed on each page element.
[0139] In one exemplary embodiment, the access information of the accessibility includes accessible operable area information. The display module 1320 displays a toolbar in the accessibility mode on the user interface of the simulator. The toolbar includes a second trigger control. In response to a trigger operation on the second trigger control, the accessibility test module 1360 displays the accessible operable area information on the page elements in the program page of the target program.
[0140] In one exemplary embodiment, the program page includes at least one page element that supports a man-machine interaction operation. In response to a trigger operation on the second trigger control, the accessibility test module 1360 displays a second marking frame on all or some of the page elements in the program page of the target program. The operable area information of the page element is displayed in the second marking frame.
[0141] In one exemplary embodiment, in response to a trigger operation on the second trigger control, the accessibility test module 1360 reads each page element to which an operation element is bound in the program page of the target program, and the operable area information of each page element. Based on the operable area information of each page element, the second marking frame is displayed on each page element.
[0142] In one exemplary embodiment, the display module 1320 displays a toolbar of the accessibility mode on the user interface of the simulator, and the toolbar includes a first trigger control and a second trigger control. In response to trigger operations on the first trigger control and the second trigger control, the accessibility test module 1360 displays a mixed marking frame on a page element in a program page of the target program, and the operable area information and reading information of the accessibility are displayed in the mixed marking frame.
[0143] In one exemplary embodiment, in response to an activation operation of the accessibility mode, the accessibility test module 1360 introduces a script in the simulator plugin into the render layer code of the target program and causes it to execute. The simulator plugin provides the functions of the accessibility mode. After introducing the script, the program page of the target program is rendered again.
[0144] In one exemplary embodiment, the target program includes at least one of a web page program and a mini program, and the mini program is a program that depends on a host program and is executed.
[0145] FIG. 20 is a schematic structural diagram of a computer device provided by an embodiment of the present application. Generally, the computer device 1400 includes a processor 1420 and a memory 1440.
[0146] Processor 1420 includes one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1420 may be implemented in at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1420 further includes a processor that processes data in the wake-up state, a main processor also called a CPU (Central Processing Unit), and a coprocessor that is a low-power consumption processor that processes data in the standby state. In some embodiments, a GPU (Graphics Processing Unit) is integrated into Processor 1420, and the GPU performs rendering and drawing of the content to be displayed on the display. In some embodiments, Processor 1420 further includes an AI (Artificial Intelligence) processor, and the AI processor processes computing operations related to machine learning.
[0147] Memory 1440 includes one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. Memory 1440 further includes a high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory devices. In some embodiments, the non-transitory computer-readable storage media in Memory 1440 stores at least one instruction, and the at least one instruction is executed by Processor 1420 to implement the method provided by the method embodiments of this application.
[0148] The exemplary embodiments further provide a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or an instruction set is stored, and the at least one instruction, the at least one program, the code set, or the instruction set is read and executed by a processor to implement the test method for the target program provided by each of the above embodiments.
[0149] This application further provides a computer-readable storage medium. In the storage medium, at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set, or the instruction set is read and executed by the processor to implement the test method for the target program provided by the method embodiments above.
[0150] Optionally, this application further provides a computer program product including instructions, which, when executed on a computer device, causes the computer device to execute the test method for the target program described in each of the above aspects.
[0151] The numbers of the embodiments of this application above do not represent the superiority or inferiority of the embodiments, but are only for illustration.
[0152] As can be understood by those skilled in the art, all or some of the steps for implementing the above embodiments may be completed by hardware, or may be completed by using a program to instruct related hardware. The program is stored in a computer-readable storage medium, and the storage medium mentioned above may be a read-only memory, a magnetic disk, an optical disk, or the like.
[0153] The above are only preferred embodiments of this application, and do not limit this application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of this application should fall within the protection scope of this application.
Claims
1. A method for testing a target program, the method comprising: being executed by a terminal device, and displaying a user interface of a simulator, wherein the target program is loaded into the simulator, displaying a program page of the target program on the user interface; responding to an activation operation of an accessibility mode to activate the accessibility mode in the simulator; displaying accessibility design information on page elements in the program page of the target program in the accessibility mode; wherein the accessibility design information is accessibility operable area information and accessibility reading information; a method.
2. The accessibility access information includes accessibility reading information, The step of displaying accessibility design information on page elements in the program page of the target program in the accessibility mode comprises: displaying a toolbar of the accessibility mode on the user interface of the simulator; the toolbar including a first trigger control; responding to a trigger operation on the first trigger control to display the accessibility reading information on page elements in the program page of the target program; The method according to claim 1.
3. The program page includes at least one page element having reading information, The step of displaying the accessibility reading information on page elements in the program page of the target program comprises: displaying a first marking frame on all or some of the page elements in the program page of the target program; displaying the reading information of the page element in the first marking frame; The method according to claim 2.
4. The step of displaying a first marking frame on all or some of the page elements in the program page of the target program comprises: A step of reading an accessible Rich Network Application Program (ARIA) label of each page element in the program page of the target program, A step in which the ARIA label records the reading information of the page element, A step of displaying the first marking frame on each page element based on the ARIA label of each page element, The method according to claim 3, comprising:
5. The accessibility design information includes accessible operable area information, In the accessibility mode, the step of displaying the accessibility design information on the page elements in the program page of the target program is A step of displaying a toolbar in the accessibility mode on the user interface of the simulator, The toolbar includes a second trigger control, A step of displaying the accessible operable area information on the page elements in the program page of the target program in response to a trigger operation on the second trigger control, The method according to claim 1, comprising:
6. The program page includes at least one page element that supports man-machine interaction operations, In the step of displaying the accessible operable area information on the page elements in the program page of the target program, A step of displaying a second marking frame on all or some of the page elements in the program page of the target program, A step in which the operable area information of the page element is displayed in the second marking frame, The method according to claim 5.
7. In the step of displaying a second marking frame on all or some of the page elements in the program page of the target program, A step of reading each page element to which an event is bound and the operable area information of each page element in the program page of the target program, A step of displaying the second marking frame on each page element based on the operable area information of each page element, The method according to claim 6, comprising:
8. In the accessibility mode, the step of displaying accessibility design information on page elements in the program page of the target program is as follows: The step of displaying a toolbar for the accessibility mode on the user interface of the simulator; The toolbar includes a first trigger control and a second trigger control; In response to trigger operations on the first trigger control and the second trigger control, the step of displaying a mixed marking frame on page elements in the program page of the target program; The step in which operable area information and reading information for accessibility are displayed in the mixed marking frame; The method according to claim 1, including the above steps.
9. The step of activating the accessibility mode in the simulator is as follows: The step of introducing and executing a script in a simulator plugin into the render layer code of the target program; The simulator plugin is for providing the functions of the accessibility mode; After introducing the script, the step of re-rendering the program page of the target program; The method according to claim 8, including the above steps.
10. The target program includes at least one of a web page program and a mini program; The mini program is a program that is executed depending on a host program. The method according to claim 8.
11. A test device for a target program, comprising: A display module for displaying the user interface of the simulator; The target program is loaded into the simulator, and the program page of the target program is displayed on the user interface; An activation module for activating the accessibility mode in the simulator in response to an activation operation of the accessibility mode; An accessibility test module for displaying accessibility design information on page elements in the program page of the target program in the accessibility mode; The device including the above components.
12. A computer device, wherein the computer device includes a processor and a memory, wherein the memory stores a computer program including a plurality of computer instructions, wherein when the computer program is executed by the processor, the computer device is caused to perform the method according to any one of claims 1 to 10, a computer device.
13. A computer program, wherein the computer program includes a plurality of computer instructions, wherein when the computer program is executed by a processor, the device having the processor is caused to perform the method according to any one of claims 1 to 10, a computer program.
Citation Information
Patent Citations
Method, computer program, and system for evaluating target content
JP2006048636A
Software accessibility testing
US20120324424A1
Segmented accessibility testing in web-based applications
US20180018254A1