Language testing method, electronic device, storage medium, and program product
By alternating the sending of control commands and switching interfaces, the problem of low efficiency in language testing of electronic devices in existing technologies is solved, enabling efficient acquisition and comparison of interface display information and reducing testing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2025-01-23
- Publication Date
- 2026-07-24
AI Technical Summary
Existing language testing methods for electronic devices are inefficient and labor-intensive, especially when dealing with multiple display interfaces and multiple language types. The method of using robotic arms to traverse and take pictures results in low testing efficiency.
By alternately sending control commands from the first device to the second device, the interface is acquired and switched, and the triggering method is determined using the pre-stored interface file, thus achieving interface traversal without the need for a robotic arm and improving testing efficiency.
It eliminates the need for robotic arms, improving the efficiency of acquiring all interface display information of electronic devices, reducing testing costs, and enabling simultaneous testing of multiple devices and multiple languages.
Smart Images

Figure CN122450801A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal devices, and more particularly to a language testing method, electronic device, storage medium, and program product. Background Technology
[0002] Electronic devices are released globally and involve dozens of languages. Therefore, before the release of an electronic device, it is necessary to test whether the language translation of the current display interface of the electronic device is correct.
[0003] The current testing method involves controlling a robotic arm to traverse the display interface of an electronic device while simultaneously controlling a camera to capture images of the interface. Testers then use these images to determine if translation issues exist. However, because electronic devices often have multiple display interfaces and support various languages, this method suffers from low testing efficiency and a large workload. Summary of the Invention
[0004] This application provides a language testing method, electronic device, storage medium, and program product, which improves testing efficiency and reduces testing workload.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, a language testing method is provided. This method, applied to a first device, may include: the first device repeatedly and alternately sending first control commands and second control commands to a second device until it receives all display information corresponding to the interfaces sent by the second device, at which point it stops sending the first control commands to the second device. The first control command is used to obtain display information corresponding to a target interface on the second device, and the second control command is used to instruct the second device to switch the currently displayed interface to display the target interface. If the displayed information differs from standard information, the language displayed in the target interface is abnormal; the standard information includes information corresponding to when the target interface correctly displays the language.
[0007] In this implementation, the first device sends a second control command to the second device. Upon receiving the second control command, the second device switches its currently displayed interface and displays the target interface on the screen. Then, the first device sends a first control command to the second device. Upon receiving the first control command, the second device obtains the display information of the target interface. By repeatedly sending the second and first control commands alternately, the first device can obtain the display information of all interfaces of the second device. This eliminates the need for a robotic arm to control the second device's interfaces; all interfaces can be traversed through control commands, further improving the efficiency of language testing on the second device. The elimination of the need for a robotic arm to traverse the second device's interfaces increases the efficiency of obtaining the corresponding display information, further improving language testing efficiency. Furthermore, the absence of a robotic arm during this testing process reduces testing costs.
[0008] In one possible implementation of the first aspect, the second control command is determined based on a pre-stored interface file.
[0009] In this implementation, the first device pre-stores interface files corresponding to all interfaces of the second device. The first device can accurately determine the second control command to trigger the display of the target interface based on the triggering method included in the interface file.
[0010] In another possible implementation of the first aspect, the interface file of the target interface further includes a triggering method for displaying the target interface, and the method further includes: after the first device obtains the triggering method for displaying the target interface from the interface file of the target interface, it determines a second control instruction based on the triggering method. The second control instruction is used to instruct the second device to display the target interface according to the triggering method.
[0011] In this implementation, the first device pre-stores the interface file of the target interface. The first device determines the second control command based on the triggering method for displaying the target interface in the interface file, thereby achieving the purpose of the first device controlling the second device to display the target interface through the second control command.
[0012] In another possible implementation of the first aspect, when the triggering method is to trigger a target control, the second control instruction further includes first indication information, which is used to indicate the target control. The target control refers to the control in the interface currently displayed by the second device that is triggered to display the target interface. The first indication information includes the identification information of the target control and / or the position information of the target control.
[0013] For example, when the triggering method is clicking the target control, the second control instruction sent by the first device to the second device may also include the identification information of the target control and / or the position information of the target control, so that the second device can accurately click the target control after receiving the second control instruction to display the target interface.
[0014] In another possible implementation of the first aspect, the language testing method may further include: when it is detected that the area of the target interface displayed on the screen is not the top area of the target interface, sending a third control command to the second device; the third control command is used to instruct the second device to display the top area of the target interface on the top of the screen.
[0015] In this implementation, if the top area of the target interface is not displayed on the top of the second device's screen, there may be expected elements not displayed on the second device's screen, causing the test script to fail to execute correctly. Therefore, the first device sends a third control command to the second device to instruct the second device to display the top area of the target interface on the top of its screen, thus avoiding the problem that the first device cannot accurately obtain the display information of the target interface of the second device.
[0016] In another possible implementation of the first aspect, the interface file of the target interface also includes the identification information of the target interface, and the language testing method may further include: obtaining the identification information of the top control displayed on the screen of the target interface; the top control refers to the control displayed in the topmost area of the target interface; if the identification information of the top control is inconsistent with the identification information of the target interface, determining that the area displayed on the screen of the target interface is not the top area of the target interface; if the identification information of the top control is consistent with the identification information of the target interface, determining that the area displayed on the screen of the target interface is the top area of the target interface.
[0017] In this implementation, the identification information of the target interface refers to the identification information of the top controls displayed on the target interface. The first device can determine whether the area displayed on the screen of the second device is the top area of the target interface based on whether the identification information of the top controls displayed on the screen of the second device is consistent with the identification information of the target interface. This achieves the purpose of accurately determining whether the area displayed on the screen of the target interface is the top area of the target interface.
[0018] In another possible implementation of the first aspect, the interface file of the target interface includes second indication information, and the method further includes: in response to the second indication information, detecting whether the area of the target interface displayed on the display screen is the top area of the target interface; the second indication information is used to indicate whether the area of the target interface displayed on the display screen is the top area of the target interface.
[0019] In this implementation, when the interface file of the target interface includes the second instruction information, the first device verifies whether the area of the target interface displayed on the screen is the top area of the target interface. This avoids the situation where the target interface displayed on the screen of the second device is not the top area. For example, even if the display screen can fully display the display information of the target interface, the first device still verifies the target interface displayed on the second device, which further helps to improve the efficiency of language testing.
[0020] In another possible implementation of the first aspect, the above-mentioned display information includes at least one of the following: display image, character to be tested, or size of all target controls in the target interface; standard information includes at least one of standard image, standard character, or standard size; the display information differs from the standard information when at least one of the following conditions exists: the display image differs from the standard image; the character to be tested differs from the standard character; or the size of the target control differs from the standard size.
[0021] For example, if the first device determines that the display image included in the display information corresponding to the target interface is different from the standard image, the first device determines that there is a language translation error in the target interface, or that there is no language translation error in the target interface but there is a display problem (e.g., there is an overlap between characters), or that there is both a language translation error and a display problem in the target interface.
[0022] In this implementation, the first device can compare the content of the displayed information with the standard information to determine whether there are language anomalies in the target interface. This not only reduces the possibility of misjudgment due to manual comparison, but also improves the efficiency of comparing the displayed information with the standard information, thereby further improving the efficiency of language testing.
[0023] In another possible implementation of the first aspect, the interface file of the target interface also includes character identification information of the standard characters corresponding to the target interface and character identification information of each character to be tested; if the character to be tested corresponding to the same character identification information is different from the standard character, the character to be tested and the standard character are different.
[0024] In another possible implementation of the first aspect, the interface file of the target interface also includes the state information of the target interface, which is used to indicate whether to acquire the display image of the target interface.
[0025] In this implementation, during the process of the first device acquiring the display information of the second device's interface through control commands, there may be instances where the same interface is repeatedly displayed on the second device's screen. When the target interface is first displayed on the second device, the target interface's status information can indicate that the display information of that target interface needs to be acquired. When the target interface is repeatedly displayed on the second device, the target interface's status information can indicate that it is not necessary to acquire the display information of that target interface, thus avoiding the situation of repeatedly acquiring the display information of that target interface.
[0026] In another possible implementation of the first aspect, the displayed information also includes the character to be tested in the target control; the standard size is determined based on the size of the target control and the character to be tested in the target control, or the standard size is determined based on the size of the target control and the standard character in the target control included in a pre-stored interface file.
[0027] In this implementation, the first device calculates the standard size of the target control when the target character is accurately displayed based on the size of the target control and the character to be tested in the target control. The calculated standard size is then compared with the size of the target control to determine whether there is any abnormality in the target control.
[0028] In another possible implementation of the first aspect, the language testing method also includes:
[0029] When the second device displays information in the first language type, a fourth control command is sent to the second device. The fourth control command is used to instruct the second device to switch to displaying information in the second language type.
[0030] In this implementation, the first device controls the second device to display different language types on its interface, thereby obtaining display information of all interfaces of the second device displaying all language types, and realizing language testing of the interfaces of the second device displaying different language types.
[0031] In a second aspect, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the language testing method described in any one of the first aspects above.
[0032] Thirdly, this application provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the language testing method described in any one of the first aspects.
[0033] Fourthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the language testing method described in any one of the first aspects.
[0034] It is understood that the electronic device described in the second aspect, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to perform the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here. Attached Figure Description
[0035] Figure 1 This is a schematic diagram illustrating an application scenario of the language testing method provided in the embodiments of this application;
[0036] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0037] Figure 3 Example diagram of a mobile phone acquiring and displaying an image provided in an embodiment of this application;
[0038] Figure 4 This is an example diagram illustrating how a mobile phone obtains display information, provided in an embodiment of this application.
[0039] Figure 5 An example diagram of the display interface for controlling a smartwatch provided in an embodiment of this application;
[0040] Figure 6 Example diagram for controlling the language type switching of a smartwatch provided in this application embodiment;
[0041] Figure 7 A flowchart illustrating the language testing method provided in this application embodiment;
[0042] Figure 8 An example diagram illustrating the acquisition of a character to be tested by a first device provided in an embodiment of this application;
[0043] Figure 9 Example diagrams showing language anomalies in the interface provided in this application embodiment;
[0044] Figure 10 This is a schematic diagram illustrating the process of obtaining display information of all interfaces of the second device according to an embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.
[0046] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this application, unless otherwise stated, "a plurality of" means two or more.
[0047] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0048] Currently, for terminal devices with small display interfaces such as watches and fitness trackers, in addition to testing whether the language translation supported by these devices is correct, it is also necessary to test for other issues such as display problems. For example, smartwatches are prone to display problems such as language truncation and line breaks.
[0049] Existing language testing methods involve using a robotic arm to traverse the terminal device's display interface. During this process, a camera captures images of the interface. Testers then use these images to determine if translation or display issues exist. Because the terminal device has multiple interfaces and supports various languages, this method suffers from low testing efficiency and a large workload.
[0050] Furthermore, when the terminal device's interface is updated, the robotic arm needs to re-adapt the test script when switching to the new interface to ensure that it can correctly interact with the updated interface and complete the predetermined tasks. Interface updates can include: changes in the position of elements (e.g., the position of buttons, icons, or other interactive elements), changes in element attributes (e.g., element color, size, shape, etc.), changes in interface layout (adding new pages, deleting pages, or altering the page structure), changes in interaction logic (e.g., changing a click operation to a swipe operation), and so on.
[0051] However, any changes to the terminal device's interface may affect the accuracy of the test script. Therefore, the test script needs to be adjusted accordingly based on the specific content of the updated display interface to adapt to the updated interface, which has the disadvantage of a large workload.
[0052] Therefore, this application provides a language testing method applied to a first device. The first device repeatedly sends first and second control commands alternately to a second device until it receives display information corresponding to all interfaces from the second device, at which point it stops sending the first and second control commands. It is evident that by sending control commands to the second device, the first device obtains display information for all interfaces of the second device, improving the efficiency of obtaining this information and thus enhancing the testing efficiency of the first device in testing the language displayed on the second device.
[0053] Furthermore, the first device stores interface files corresponding to all interfaces of the second device, and determines the control commands to be sent to the second device based on these interface files. For example, if the target interface file stores the triggering method for displaying the target interface, the first device determines and sends a second control command to the second device to instruct it to display the target interface based on this triggering method. This solves the problem in related technologies where updating or adding interfaces to the second device requires re-adapting the corresponding test scripts, resulting in a large workload.
[0054] For example, Figure 1 This is a schematic diagram illustrating an application scenario of the language testing method provided in this application embodiment. The application scenario includes a first device 101, a second device 102, and a third device 103. Data transmission between the first device 101 and the second device 102, and between the second device 102 and the third device 103, can be performed via a network 104. The network 104 can include various connection types, such as wired or wireless communication links, etc., and this application does not limit its scope.
[0055] For example, the first device used to perform the language testing method described in this application can be Figure 1 The first device is 101. The device to be tested can be a third device 103. The third device 103 has the ability to display content / characters corresponding to different language types. For example, the language types may include, but are not limited to, Chinese, English, French, Korean, etc. In this embodiment of the application, the language type of the content / characters displayed by the third device 103 is not limited.
[0056] A test script runs on the first device 101, and a test application (APP) is set on the second device 102. After the communication channel between the first device 101, the second device 102, and the third device 103 is established, the first device 101 runs the test script, triggering the test APP to send first control commands to the third device 103 multiple times. After receiving the first control commands, the third device 103 sends the display information of the current interface to the first device 101 through the second device 102. After the first device 101 receives all the display information corresponding to the interface sent by the third device 103, it stops running the test script. After the first device 101 stops running the test script, the test APP stops sending first control commands to the third device 103.
[0057] It should be noted that the above Figure 1 The number and type of the third device 103 are merely examples, and the number and type of the second device to be tested are not limited in this embodiment. When there are multiple third devices 103, the type of language displayed on the interfaces of these devices is also not limited. For example, the third devices 103 could be three smartwatches, and the languages displayed on the interfaces of the three smartwatches could be Chinese, English, and Arabic, respectively. The first device 101 can simultaneously test the languages displayed on the interfaces of the three smartwatches to determine whether the languages displayed on the three smartwatches are abnormal.
[0058] The third device 103 can be a smartwatch, smart bracelet, mobile phone, wearable first device, or laptop computer, etc. The third device 103 can also be a personal computer (PC), desktop computer, etc., but this application is not limited to these.
[0059] The first device 101, the second device 102, and the third device 103 can transmit data via Bluetooth, a universal serial bus (USB), or other methods, which are not limited here.
[0060] It should be understood that the first device 101 and the second device 102 can be the same electronic device or two different electronic devices; this embodiment does not limit this. For example, suppose the first device 101 is a personal computer, the second device 102 is a mobile phone, and the third device 103 is a smartwatch. A test script runs on the personal computer, and a test app is installed on the mobile phone. After establishing a communication channel between the personal computer, the mobile phone, and the smartwatch, the personal computer runs the test script. After establishing communication between the test script and the test app, the test app sends multiple first control commands to the smartwatch. Upon receiving the first control commands, the smartwatch sends the interface display information to the personal computer via the mobile phone. Alternatively, suppose the first device 101 and the second device 102 are integrated into the personal computer, and the third device 103 is a smartwatch. A test script runs on the personal computer, and a test app is installed. After establishing a communication channel between the personal computer and the smartwatch, the personal computer runs the test script, controlling the test app to send multiple first control commands to the smartwatch. Upon receiving the first control commands, the smartwatch directly sends the interface display information to the personal computer.
[0061] The first device 101 and the second device 102 mentioned above can be mobile phones, tablets, personal computers, personal digital assistants (PDAs), smartwatches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, smart cars, and other electronic devices. This application embodiment does not impose any restrictions on them.
[0062] For example, such as Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0063] like Figure 2 As shown, the electronic device may include a processor 210, a memory 220, and a communication module 230. The processor 210 can be used to read and execute computer-readable instructions. Specifically, the processor 210 may include a controller, an arithmetic logic unit (ALU), and registers. The controller is primarily responsible for instruction decoding and issuing control signals for the operations corresponding to the instructions. The ALU is primarily responsible for storing register operands and intermediate operation results temporarily stored during instruction execution. Registers are high-speed storage components with limited storage capacity, which can be used to temporarily store instructions, data, and addresses.
[0064] The processor 210 may further include a transceiver module 211 and a processing module 212. The transceiver module 211 can send control commands to the terminal device to instruct it to perform corresponding operations. For example, the transceiver module 211 sends a first control command to a second device to obtain display information of the interface. After receiving the first control command, the second device sends the display information of the interface to the electronic device. The processing module 212 is also used to determine whether there is any abnormality in the language displayed on the interface based on the display information.
[0065] In specific implementations, the hardware architecture of processor 210 can be an application-specific integrated circuit (ASIC) architecture, a microprocessor without interlocked piped stages (MIPS) architecture, an ARM (advanced RISC machines) architecture, or a net processor (NP) architecture, etc.
[0066] The memory 220 is coupled to the processor 210 and is used to store various software programs and / or multiple sets of instructions. In this embodiment, the data storage method of the electronic device can be implemented either by integrating it into a processor of the electronic device or by storing it as program code in the memory of the electronic device. A processor of the electronic device can then call the code stored in the memory of the electronic device to execute the above method. Specifically, the memory 220 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The memory 220 may store an operating system, such as uCOS, VxWorks, RTLinux, or other embedded operating systems.
[0067] The communication module 230 can be used to establish communication connections between electronic devices and other communication terminals via a network, and to send and receive data via the network. For example, when the second device is powered on and connected to the network, the electronic device establishes a connection with the second device through the communication module 230, so that the subsequent electronic device can send control commands to the second device.
[0068] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0069] In this embodiment of the application, the electronic device used to perform the method described in this application may also be a server. The server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0070] A server can be a server that provides various services.
[0071] The server can be a big data platform or a data processing server, or it can be a device that integrates a big data platform or a data processing server. The server will be described in detail below. It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the server. In other embodiments, the server may include... Figure 2 It may contain more or fewer components, or combine some components, or separate some components, or arrange the components differently. The components shown in the diagram may be implemented in hardware, software, or a combination of software and hardware.
[0072] For ease of understanding, the following embodiments of this application will use a mobile phone as the first device and a smartwatch as the second device, with the mobile phone testing the language displayed on the smartwatch as an example to describe the language testing method of this application. In actual testing scenarios, the number of second devices is not limited, nor is the language type displayed on the second devices limited. The first and second devices can be of the same type or different types. For example, both the first and second devices can be mobile phones, or the first device can be a mobile phone and the second device can be a smartwatch, etc.
[0073] For example, after the smartwatch is powered on, a communication connection is established between the phone and the smartwatch, such as via Bluetooth. The phone runs a test script and sends a first control command to the smartwatch. After receiving the first control command, the smartwatch obtains the display information of the current interface. For example, ... Figure 3 As shown, after receiving the first control command from the mobile phone, the smartwatch can take a screenshot of the current interface 301 and obtain the display image 302. Then, the smartwatch sends the display image to the mobile phone.
[0074] Because the phone needs to test the languages displayed on all interfaces of the smartwatch (i.e., all possible interfaces displayed on the smartwatch's screen), after obtaining the display information of the smartwatch's currently displayed interface by sending a first control command to the smartwatch, the phone can send a second control command to instruct the smartwatch to switch the currently displayed interface. Upon receiving the second control command, the smartwatch switches the currently displayed interface to show the target interface.
[0075] The first device sends the first control command to the second device again, so that the second device can obtain the display information of the target interface and send the obtained display information of the target interface back to the first device. The first control command and the second control command are sent alternately and repeatedly until the first device receives the display information of all interfaces of the second device, and then the first device stops sending the first control command and the second control command to the second device.
[0076] For example, such as Figure 4 As shown, the mobile phone can send a second control command to the smartwatch to switch the interface displayed on the smartwatch. Here, the second control command instructs the smartwatch to trigger the display interface 403 by clicking, specifically clicking the control 402 on interface 401. After receiving the second control command, the smartwatch clicks the control 402 and displays interface 403. The mobile phone then sends a first control command to the smartwatch. After receiving the first control command, the smartwatch obtains the display information 404 corresponding to interface 403 and sends the display information 404 to the mobile phone.
[0077] In the embodiments of this application, the above Figure 4 The example shown is that smartwatches can trigger the display of a target interface by clicking on controls. Other triggering methods, such as swiping, can also be used to display the target interface. This is not a limitation.
[0078] like Figure 5 As shown, during the display of interface 501 on the smartwatch screen, if the phone determines that the area of interface 501 displayed on the screen is not the top area of interface 501, the phone can send a third control command to the smartwatch. After receiving the third control command, the smartwatch slides down interface 501 to display interface 502. Here, the area of interface 502 displayed on the screen is the top area of interface 502.
[0079] In this embodiment, after the mobile phone obtains the display information of all interfaces displayed on the smartwatch in the first language type, the mobile phone can send a fourth control command to the smartwatch. Upon receiving the fourth control command, the smartwatch can switch the language type to the second language type. Subsequently, the mobile phone can continue to send control commands to the smartwatch to obtain the display information of all interfaces displayed on the smartwatch in the second language type. Thus, the mobile phone can obtain the display information of all interfaces displayed on the smartwatch in all language types, thereby enabling testing of the languages displayed on the smartwatch's interface.
[0080] For example, suppose the smartwatch displays all interface characters in Chinese, such as... Figure 6 Interface 601. The mobile phone sends a fourth control command to the smartwatch to instruct the smartwatch to switch the displayed language from Chinese to English. After receiving the fourth control command, the smartwatch sets the characters of all interfaces to be displayed in English in the settings application, and then the characters of the interface are displayed in English on the smartwatch's interface 602.
[0081] The language testing method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings. Figure 7 This is a flowchart illustrating the language testing method provided in an embodiment of this application, as shown below. Figure 7 As shown, the method may include steps S701-S704.
[0082] S701, the first device repeatedly sends the first control command and the second control command alternately to the second device until it receives all the display information corresponding to the interface sent by the second device, and then stops sending the first control command and the second control command to the second device.
[0083] The first control instruction is used to obtain display information corresponding to the target interface of the second device, including the content displayed on the interface. The second control instruction is used to instruct the second device to switch the currently displayed interface to display the target interface.
[0084] For example, assuming that the first device and the second device transmit data via Bluetooth technology, the first device can alternately send a first control command and a second control command to the second device via Bluetooth technology.
[0085] In this embodiment, the first device sends a first control command to the second device. Upon receiving the first control command, the second device obtains the display information corresponding to the target interface (i.e., the currently displayed interface). Then, the second device sends the display information corresponding to the target interface back to the first device, enabling the first device to obtain the display information corresponding to the target interface of the second device. The first device sends a second control command to the second device to instruct the second device to switch the displayed interface to another interface. The first device sends the first control command to the second device again, so that the second device obtains the display information of the target interface and sends the obtained display information of the target interface back to the first device. This process of sending the first and second control commands is repeated until the first device receives the display information of all interfaces of the second device, at which point it stops sending the first and second control commands to the second device.
[0086] In one implementation, the first control instruction is further used to instruct the acquisition of a display image corresponding to the display information of the target interface. In this implementation, the first device sends the first control instruction to the second device. After receiving the first control instruction, the second device can take a screenshot of the target interface to obtain a display image corresponding to the target interface. Then, the second device sends the display image to the first device, enabling the first device to acquire the display image corresponding to the target interface.
[0087] For example, still using Figure 3 For example, the mobile phone sends a first control command to the smartwatch, which instructs the smartwatch to obtain the display image 302 corresponding to the target interface 301. After receiving the first control command, the smartwatch takes a screenshot of the target interface 301 to obtain the display image 302. The smartwatch then sends the display image 302 to the mobile phone, enabling the mobile phone to obtain the display image 302 corresponding to the target interface.
[0088] In another implementation, the first control instruction is further used to instruct the acquisition of the test character corresponding to the display information of the target interface. In this implementation, the first device sends the first control instruction to the second device. After receiving the first control instruction, the second device can extract characters from the characters displayed on the target interface to obtain the test character corresponding to the target interface. The test character includes all characters displayed on the target interface. Then, the second device sends the test character to the first device, enabling the first device to acquire the test character of the target interface.
[0089] Optionally, after receiving the first control command, the second device can take a screenshot of the target interface to obtain a display image. Then, the second device extracts characters from the displayed image to obtain the test character corresponding to the target interface. Character extraction from the display image typically refers to the process of recognizing and extracting text information from the image. In one implementation, the second device can use optical character recognition (OCR) technology to extract the test character from the display image. In another implementation, the second device can also extract the test character from the display image using a deep learning model. For example, the second device can input the display image into a trained deep learning model, and the model outputs the test character from the display image.
[0090] It should be noted that the second device may also use other methods to extract the characters to be tested from the displayed image, and this application embodiment does not limit this.
[0091] For example, such as Figure 8 As shown, the mobile phone sends a first control command to the smartwatch, which instructs the smartwatch to acquire the character to be tested corresponding to the target interface. Upon receiving the first control command, the smartwatch takes a screenshot of the target interface, obtains the displayed image, and then extracts characters from the image to obtain the character to be tested from the target interface. The smartwatch then sends the character to be tested back to the mobile phone, enabling the mobile phone to acquire the character to be tested corresponding to the target interface.
[0092] In another implementation, the first control command is further used to instruct the acquisition of the display information corresponding to the target interface, including the display image. The first device sends the first control command to the second device. After receiving the first control command, the second device can take a screenshot of the target interface to obtain the display image corresponding to the target interface. Then, the second device sends the display image to the first device, enabling the first device to obtain the display image corresponding to the target interface. The first device can also extract characters from the display image to obtain the test characters of the target interface.
[0093] For details on the specific implementation of character extraction from the displayed image by the first device, please refer to the above description of character extraction from the displayed image by the second device; it will not be repeated here.
[0094] For example, assuming the second device is currently displaying the first interface, the first device sends a first control command to the second device, which the second device receives. After obtaining the display information corresponding to the first interface, the second device sends that information back to the first device. If the first device has not yet fully obtained the display information corresponding to all interfaces of the second device, it sends a second control command to the second device, instructing the second device to switch the displayed interface. Upon receiving the second control command, the second device switches the displayed interface from the first to the second interface. The first device continues to send first control commands to the second device to obtain the display information corresponding to the second interface. In this way, by alternately sending first and second control commands, the first device can obtain the display information corresponding to all interfaces of the second device.
[0095] Therefore, the first device obtains all the display information of the second device's interface by sending control commands to the second device, eliminating the need for a robotic arm to operate the second device. This improves the efficiency of the first device in obtaining the display information of the second device's interface, thereby improving the efficiency of language testing. Furthermore, when there are multiple second devices, the first device can send control commands to multiple second devices simultaneously, performing language tests on multiple devices concurrently, thus improving the testing efficiency for multiple second devices.
[0096] In this embodiment, the process by which the first device obtains display information corresponding to all interfaces of the second device will be described later. Figure 10 The introduction process will not be detailed here.
[0097] In this embodiment, after the first device determines that it has obtained the display information of all interfaces of the second device, and after the first device stops sending the first and second control commands to the second device, the first device can send a fourth control command to the second device to instruct the second device to switch the displayed language type. For example, if the target interface displayed on the second device's screen is displayed in the first language type, after receiving the fourth control command, the second device can switch the target interface to display the target interface information in the second language type. Thus, the first device achieves the switching of the language type displayed on the second device by sending control commands. Compared to related technologies where a robotic arm controls the second device to switch the language type, requiring a test script to adapt to the switched language type, this improves the efficiency of language testing on the second device.
[0098] S702, the first device determines whether there is a difference between the displayed information and the standard information in the interface based on the display information and standard information corresponding to all interfaces.
[0099] The standard information includes information corresponding to the accurate display of the language in the interface. The first device pre-stores the standard information corresponding to each interface of the second device. Optionally, the first device stores the interface file corresponding to each interface of the second device. The interface file includes the standard information corresponding to that interface. For example, the interface file of the target interface stores the standard image corresponding to the interface, the standard characters corresponding to all characters to be tested, the size of the controls included in the target interface, and the characters to be tested included in the controls, etc.
[0100] After the first device obtains the display information corresponding to all interfaces, it can compare the display information of each interface with the standard information. Based on whether there are differences between the display information and the standard information, it can determine whether there is any abnormality in the language displayed in the interface of the second device.
[0101] The language displayed in the above interface is abnormal, including: translation errors in the displayed language (for example, when the language in the interface is English, there are errors in character translation) and / or display problems in the displayed language (for example, there are overlapping characters).
[0102] In this embodiment, the display information corresponding to the target interface obtained by the first device may include at least one of the following: a display image, a character to be tested, or the dimensions of all target controls in the target interface. The standard information pre-stored in the first device includes at least one of the following: a standard image, a standard character, or a standard size.
[0103] The images shown above refer to screenshots taken from the target interface. The characters to be tested refer to all characters displayed on the target interface. The standard images mentioned above refer to screenshots taken from the interface of the second device when the language is accurately displayed. Standard characters refer to the characters displayed on the interface of the second device when the language is accurately displayed. Standard sizes refer to the sizes of the controls that are normally displayed on the interface of the second device when the language is accurately displayed.
[0104] In this embodiment of the application, the first device determines that the display information of the target interface is abnormal compared with the standard information, and there are at least one of the following situations: the displayed image is different from the standard image; the character to be tested is different from the standard character; or the size of the target control is different from the standard size.
[0105] It should be understood that the difference between the target interface display image and the standard image determined by the first device may be due to a translation error in the language displayed in the target interface, or it may be that the language displayed in the target interface does not have a translation error but has a display problem, or it may have both a translation error and a display problem in the language displayed in the target interface.
[0106] For example, such as Figure 9The image shown in (a) is the standard image of the target interface. Figure 9 The image shown in (b) is the target interface display image 1. The characters “background cut” in control 902 in the display image 1 are different from the characters “background switch” in control 901 in the standard image, that is, there is a translation error in the display image 1. Figure 9 The image shown in (c) is the target interface display image 2. The text "background switch" in control 903 is displayed beyond the area where control 903 is located, that is, there is a display problem with image 2. Figure 9 The image shown in (d) is the target interface display image 3. The text "background cut" in control 904 has translation errors and display problems.
[0107] The first device determines that the characters to be tested on the target interface differ from the standard characters, which may be due to translation errors in the characters to be tested displayed on the target interface.
[0108] The first device determines that the size of the target control in the target interface differs from the standard size. This could be due to a translation error in the character to be tested in the target control, a display problem rather than a translation error in the character to be tested, or both translation errors and display problems in the character to be tested.
[0109] For example, as Figure 9 The target control 903 shown in (c) has a display problem, which causes a difference in size between the target control 903 and the control 901. Figure 9 The target control 903 shown in (d) has a storage character error and display problem, which causes a size difference between the target control 903 and the control 901.
[0110] Optionally, the display information corresponding to the target interface obtained by the first device may include a display image. The first device may compare the display image corresponding to the target interface with the standard image corresponding to the target interface to determine whether there is a difference between the display image of the target interface and the standard image.
[0111] In one implementation, the first device can compare the displayed image of the target interface with a standard image by running a script to determine if there are any differences. In another implementation, the first device can also input the displayed image of the target interface and the standard image into a pre-trained image recognition model, and determine whether there are differences between the displayed image of the target interface and the standard image based on the output of the image recognition model. For example, when the output of the image recognition model is a first value, the displayed image of the target interface is exactly the same as the standard image. When the output of the image recognition model is a second value, there are differences between the displayed image of the target interface and the standard image.
[0112] Of course, the first device can also use other feasible methods to compare whether there is a difference between the displayed image of the target interface and the standard image, and this application embodiment does not limit this.
[0113] Optionally, the display information corresponding to the target interface obtained by the first device may also include the character to be tested. The first device can compare the character to be tested in the target interface with the standard character to determine whether there is a difference between the character to be tested and the standard character in the target interface.
[0114] In one implementation, the first device pre-stores character identifier information for standard characters corresponding to the target interface and character identifier information for each character to be tested. The character identifier information is used to uniquely identify the character. Optionally, if the character to be tested corresponding to the same character identifier information is different from the standard character, the first device determines that the character to be tested and the standard character are different. If the character to be tested corresponding to the same character identifier information is the same as the standard character, the first device determines that the character to be tested and the standard character are the same.
[0115] For example, suppose the first device pre-stores character identifier information A corresponding to the character to be tested A, and the standard character A corresponding to the character identifier information A. After the first device obtains the character to be tested A corresponding to the character identifier information A, if the character to be tested A is different from the standard character A, the first device determines that the character to be tested A and the standard character A are different. If the character to be tested A is the same as the standard character A, the first device determines that the character to be tested A and the standard character A are the same.
[0116] Optionally, the display information corresponding to the target interface acquired by the first device may further include the dimensions of all target controls in the target interface. The first device can compare the dimensions of the target controls in the target interface with standard dimensions to determine whether there is a difference between the dimensions of the target controls in the target interface and the standard dimensions. If the first device determines that the dimensions of the target controls are the same as the standard dimensions, the first device determines that there is no display problem with the target interface. If the first device determines that the dimensions of the target controls are different from the standard dimensions, the first device determines that there is a display problem with the target interface.
[0117] Optionally, the display information obtained by the first device corresponding to the target interface may also include the characters to be tested and the dimensions of all target controls in the target interface. If the first device compares the characters to be tested in the target interface with standard characters and determines that the characters to be tested are the same as the standard characters, the first device can determine whether there are display problems in the target interface based on the dimensions of the target controls in the target interface and the standard dimensions. That is, if the first device determines that there are no character translation anomalies in the language displayed in the target interface of the second device, the first device can further determine whether there are any display anomalies in the characters in the target interface. The first device can compare the dimensions of the target controls in the target interface with the standard dimensions to determine whether there are display problems in the target interface. For example, the first device can determine whether the characters to be tested in the target controls are not fully displayed in the target controls, or whether they are displayed outside the corresponding area of the target controls.
[0118] Here, the standard size can be determined by the first device based on the size of the target control and the character to be tested in the target control. Alternatively, the standard size can also be determined by the first device based on the size of the target control and the standard characters in the target control included in a pre-stored interface file.
[0119] In one scenario, if a standard size is stored in a pre-stored interface file in the first device, the standard size can be determined by the first device based on the size of the target control included in the pre-stored interface file and the standard characters in the target control.
[0120] In another scenario, if the interface file pre-stored in the first device does not contain a standard size, then after obtaining the size of the target control and the character to be tested within the target control, and determining that the character to be tested in the target control is not abnormal, the first device can calculate the standard size based on the size of the target control and the character to be tested within it. Optionally, after obtaining the character to be tested in the target control, the first device can calculate the standard size of the target control that can fully display the character to be tested based on the content, font, font size, etc. of the character to be tested. The first device compares the calculated standard size of the target control with the size of the target control to determine whether there is a display problem with the character to be tested in the target control.
[0121] S703, if the first device determines that there is an anomaly between the displayed information and the standard information of the target interface, the language displayed in the target interface is abnormal.
[0122] Alternatively, in S704, if the first device determines that the display information of the target interface is exactly the same as the standard information, then the language displayed in the target interface is not abnormal. That is, the language displayed in the target interface is completely correct.
[0123] In summary, the first device obtains display information from all interfaces of the second device by sending a first control command to the second device. Compared to controlling the second device's interface with a robotic arm and then capturing images with a camera, this method significantly improves the efficiency of acquiring display information. Then, the first device compares the display information from all interfaces of the second device with standard information to determine if there are any anomalies in the language displayed on the second device's interface. Compared to manual judgment, this greatly improves the efficiency of language testing and reduces the possibility of misjudgments.
[0124] In this embodiment of the application, the first device can obtain the display information of all interfaces of the second device by sending control commands to the second device. For example, Figure 10 This is a flowchart illustrating the process of obtaining display information of all interfaces of the second device according to an embodiment of this application, such as... Figure 10 As shown, the method may include:
[0125] S1001, the first device sends a second control command to the second device. Correspondingly, the second device receives the second control command.
[0126] The second control command instructs the second device to switch the currently displayed interface to show the target interface. The second control command is determined based on a pre-stored interface file, which includes the relationships between different interfaces.
[0127] In this embodiment of the application, after the first device obtains the display information of the interface currently displayed by the second device, the first device can send a second control command to the second device to instruct the second device to switch the currently displayed interface to display the target interface, thereby realizing the traversal of all interfaces of the second device by sending control commands to the second device.
[0128] Optionally, the first device pre-stores an interface file of the target interface, and the interface file of the target interface includes a trigger method for displaying the target interface. The first device can obtain the trigger method for displaying the target interface from the interface file of the target interface, and determine the second control command based on the trigger method for displaying the target interface. The trigger method for displaying the target interface may include a click operation, a swipe operation (e.g., an up swipe, a down swipe, a left swipe, or a right swipe), a long press operation, etc.
[0129] In one implementation, if the interface file of the target interface stored in the first device includes a triggering method for displaying the target interface, and this triggering method is a method for triggering a target control, the second control instruction may further include first indication information. The first indication information is used to indicate the target control, and includes the identification information and / or the position information of the target control. The target control refers to the control in the currently displayed interface of the second device that is triggered to display the target interface.
[0130] For example, the above... Figure 4 For example, suppose the phone has a pre-stored interface file for interface 401. This interface file includes a trigger method for displaying interface 403, which is a click operation. This click operation is clicking control 402. The interface file may include the identification information of control 402 and / or the position information of control 402 (e.g., coordinate values). The phone can determine the second control command as instructing the smartwatch to click control 402 based on the trigger method for displaying interface 403 included in the interface file of interface 401.
[0131] It should be understood that the first device pre-stores interface files corresponding to all interfaces of the second device, and each interface has one or more interface files to describe its appearance and behavior. The interface files include information corresponding to at least one field of the pre-built interface model.
[0132] Optionally, the first device first establishes a unified interface model that can describe all possible interface characteristics of the second device, and different interfaces of the second device correspond to interface files. Interface characteristics refer to the specific manifestations of various elements and functions in the user interface, which together constitute the interface through which the user interacts with the second device. For example, interface characteristics may include visual elements (such as controls, icons, text, layouts, or images), interactive elements (such as click controls, scrolling, drag and drop, input, or navigation), dynamic characteristics (such as animations), functional characteristics (such as data display, search functions, or personalized settings), and so on.
[0133] Optionally, the interface model may include the following fields:
[0134] Table 1
[0135] Serial Number Field Name Field meaning 1 name Identification information of the controls at the top of this interface 2 resPath Test results saved file name 3 text The characters to be tested are contained in this interface. 4 contents Character identification information 5 locator Information about controls in the interface 6 enterWay Methods to trigger the display of the current interface 7 isCheckTop Check if it's at the top; if not, scroll down to the very top. 8 enterInfo Supplement the information required to enter the interface. 9 screencapStatus Do we need to obtain the interface display information?
[0136] The "name" field contains the interface's identifier information, indicating the identifier of the top controls. The "respath" field specifies the name of the test result file. The "text" field contains all the characters to be tested within the interface. The "contents" field stores the character identifiers for all the characters to be tested. The "locator" field contains information about the controls displayed on the interface, including their name, coordinates, width, and the character to be tested within them. The "enterWay" field indicates the method used to enter the current interface, such as clicking, long-pressing, or swiping. The "isCheckTop" field indicates whether the area displayed on the second device's screen is the top area of the interface. The "enterInfo" field works in conjunction with the "enterWay" field; for example, if entering the current interface is triggered by a click, "enterInfo" contains the identifier or coordinates of the clicked control. The "screencapStatus" field indicates whether to retrieve the interface's display information. For example, if an interface A contains multiple controls, clicking one of the controls leads to the next interface B, and after obtaining the display information of interface B, it is necessary to return to interface A to enter another interface C. In this case, the second device does not need to repeatedly obtain the display information of interface A when returning to interface A. Therefore, the return operation needs to be marked as not requiring repeated acquisition of the display information of interface A.
[0137] In this embodiment of the application, the interface file of the target interface stored in the first device also includes the status information of the target interface. The status information is used to indicate whether to obtain the display information of the target interface, thereby avoiding the situation of repeatedly obtaining the display information of the target interface.
[0138] It should be understood that during the process of the first device obtaining the display information of the second device's interface through control commands, there may be instances where the same interface is repeatedly displayed on the second device's screen. For example, when the target interface is displayed for the first time on the second device, the target interface's status information can indicate that the display information of that target interface should be obtained. When the target interface is repeatedly displayed on the second device, the target interface's status information can indicate that it is not necessary to obtain the display information of that target interface, thus avoiding the situation of repeatedly obtaining the display information of that target interface.
[0139] In this embodiment, the test script running on the first device is universal. If the second device has an updated or added interface, there is no need to adjust the test script. It is only necessary to ensure that the format of the updated or added interface file is compatible with the original interface file, thereby improving the efficiency and maintainability of language testing on the second device and reducing the workload.
[0140] S1002, the second device switches the current interface and displays the target interface.
[0141] After receiving the second control command sent by the first device, the second device can trigger the display of the target interface according to the triggering method indicated in the second control command.
[0142] Still with Figure 4 For example, when the smartwatch receives the second control command sent by the mobile phone, which is to click on the control 402, the smartwatch executes the click operation on the control 402 to display the interface 403.
[0143] Optionally, in S1003, the first device determines whether the area of the target interface displayed on the screen is the top area of the target interface.
[0144] It should be understood that when the first device starts running a test script corresponding to an interface model, the interface displayed on the second device's screen may be in an arbitrary state. For example, the top of the second device's screen may not be the top area of the target interface; expected elements may not be displayed on the second device's screen, causing the test script to fail to execute correctly. Therefore, the first device can verify whether the area displayed on the screen is the top area of the interface based on the identifier information corresponding to the name. The first device can use the "name" field in conjunction with the "isCheckTop" field; it is only necessary to check whether the area displayed on the screen is the top area of the interface when the interface model contains the "isCheckTop" field.
[0145] In some embodiments, when the first device determines that the interface file of the target interface includes the second instruction information, the first device, in response to the second instruction information, detects whether the area of the target interface displayed on the screen is the top area of the target interface.
[0146] In other words, the first device pre-stores the interface file of the target interface, and the interface file includes a "name" field and an "isCheckTop" field. The information corresponding to the "isCheckTop" field is the second indication information, which is used to indicate whether the area displayed on the screen is the top area of the target interface. The information corresponding to the "name" field is the identification information of the target interface. The identification information of the target interface is used to indicate the identification information of the top controls of the target interface.
[0147] Optionally, the first device may acquire the identification information of the top controls displayed on the screen of the target interface. Here, the top controls refer to the controls displayed in the topmost area of the target interface. In one scenario, if the identification information of the top controls does not match the identification information of the target interface, the first device determines that the area displayed on the screen of the target interface is not the top area of the target interface. In another scenario, if the identification information of the top controls matches the identification information of the target interface, the first device determines that the area displayed on the screen of the target interface is the top area of the target interface.
[0148] If the first device determines that the area of the target interface displayed on the screen is not the top area of the target interface, the first device executes S1004; otherwise, it executes S1006.
[0149] S1004, the first device sends a third control command to the second device. Correspondingly, the second device receives the third control command.
[0150] The third control command is used to instruct the second device to display the top area of the target interface on the top of the display screen.
[0151] For example, after receiving a third control command, the second device can perform a swipe-down operation to display the top area of the target interface on the top of the display screen.
[0152] S1005, the second device displays the top area of the target interface on the top of the display screen.
[0153] In other words, the top area of the second device's display screen does not show the top area of the target interface. The second device can slide its interface so that the top controls of the target interface are displayed in the top area of the display screen. In this way, the test script running on the first device can accurately obtain the display information of the target interface on the second device.
[0154] S1006, the first device sends a first control command to the second device. Correspondingly, the second device receives the first control command.
[0155] S1007, the second device obtains the display information corresponding to the target interface.
[0156] In this embodiment of the application, the specific implementation of the second device obtaining the display information corresponding to the target interface can be referred to the implementation process of S701 above, and will not be repeated here.
[0157] S1008, the second device sends the display information corresponding to the target interface to the first device.
[0158] S1009, the first device determines whether it has obtained all the display information of the second device's interfaces.
[0159] In this embodiment, after the first device obtains the display information corresponding to the target interface, the first device determines whether it has obtained the display information of all interfaces of the second device. If the first device determines that it has obtained the display information of all interfaces of the second device, the first device stops sending the first control command to the second device. Otherwise, the first device executes the above-described S1001.
[0160] In summary, by sending control commands to the second device, the first device obtains the display information of all interfaces of the second device, thus realizing the ability to traverse all interfaces of the second device without using a robotic arm. This further improves the efficiency of language testing on the second device.
[0161] It is understood that the aforementioned electronic devices, etc., include hardware structures and / or software modules corresponding to the execution of each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this invention.
[0162] This application embodiment can divide the above-mentioned electronic device into functional modules according to the method example described above. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0163] When each functional module is divided according to its corresponding function, the above embodiments illustrate a possible composition of the electronic device, which may include a display unit, a transmission unit, and a processing unit. It should be noted that all relevant content regarding the steps in the above method embodiments can be referenced from the functional descriptions of the corresponding functional modules, and will not be repeated here.
[0164] This application also provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, including computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the aforementioned method steps to implement the language testing method described in the above embodiments.
[0165] Embodiments of this application also provide a computer-readable storage medium storing computer instructions that, when executed on an electronic device, cause the electronic device to perform the aforementioned method steps to implement the language testing method described above.
[0166] Embodiments of this application also provide a computer program product, which includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the aforementioned method steps to implement the language testing method described above.
[0167] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the apparatus to perform the language testing methods executed by the electronic devices in the above method embodiments.
[0168] In this embodiment, the electronic device, computer-readable storage medium, computer program product or device are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0169] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0170] In the embodiments of this application, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0171] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.
[0172] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A language testing method, characterized in that, Applied to a first device, the method includes: The system repeatedly sends a first control command and a second control command alternately to the second device until it receives all the display information corresponding to the interfaces sent by the second device, at which point it stops sending the first control command and the second control command to the second device; wherein, the first control command is used to obtain the display information corresponding to the target interface of the second device, and the display information includes the content displayed in the interface; the second control command is used to instruct the second device to switch the currently displayed interface to display the target interface; If there is a discrepancy between the displayed information and the standard information, the language displayed in the target interface is abnormal; the standard information includes the information corresponding to the correct language displayed on the target interface.
2. The method according to claim 1, characterized in that, The second control command is determined based on a pre-stored interface file.
3. The method according to claim 2, characterized in that, The interface file of the target interface also includes a triggering method for displaying the target interface, and the method further includes: Obtain the trigger method for displaying the target interface from the interface file of the target interface; The second control instruction is determined based on the triggering method for displaying the target interface; the second control instruction is used to instruct the second device to display the target interface according to the triggering method.
4. The method according to claim 3, characterized in that, When the triggering method is to trigger a target control, the second control instruction further includes first indication information, which is used to indicate the target control. The target control refers to the control in the interface currently displayed by the second device that is triggered to display the target interface. The first indication information includes the identification information of the target control and / or the position information of the target control.
5. The method according to any one of claims 2-4, characterized in that, The method further includes: When it is detected that the area of the target interface displayed on the screen is not the top area of the target interface, a third control command is sent to the second device; the third control command is used to instruct the second device to display the top area of the target interface on the top of the screen.
6. The method according to claim 5, characterized in that, The interface file of the target interface also includes the identification information of the target interface, and the method further includes: Obtain the identification information of the top control displayed on the screen of the target interface; the top control refers to the control displayed in the topmost area of the target interface; If the identification information of the top control is inconsistent with the identification information of the target interface, it is determined that the area of the target interface displayed on the screen is not the top area of the target interface; If the identification information of the top control is consistent with the identification information of the target interface, it is determined that the area of the target interface displayed on the screen is the top area of the target interface.
7. The method according to claim 5 or 6, characterized in that, The interface file of the target interface includes second instruction information, and the method further includes: In response to the second indication information, it is detected whether the area of the target interface displayed on the screen is the top area of the target interface; the second indication information is used to indicate whether the area of the target interface displayed on the screen is the top area of the target interface.
8. The method according to any one of claims 1-7, characterized in that, The display information includes at least one of the following: the display image, the character to be tested, or the size of all target controls in the target interface; the standard information includes at least one of the following: a standard image, a standard character, or a standard size. The displayed information differs from the standard information when at least one of the following conditions exists: The displayed image differs from the standard image; The character to be tested differs from the standard character; or... The size of the target control differs from the standard size.
9. The method according to claim 8, characterized in that, The interface file of the target interface also includes character identification information of the standard characters corresponding to the target interface and character identification information of each character to be tested; If the character to be tested is different from the standard character corresponding to the same character identifier information, then the character to be tested is different from the standard character.
10. The method according to any one of claims 2-9, characterized in that, The interface file of the target interface also includes the status information of the target interface, which is used to indicate whether to obtain the display information of the target interface.
11. The method according to any one of claims 8-10, characterized in that, The display information also includes the character to be tested in the target control; the standard size is determined based on the size of the target control and the character to be tested in the target control, or the standard size is determined based on the size of the target control and the standard character in the target control included in a pre-stored interface file.
12. The method according to any one of claims 1-11, characterized in that, The method further includes: When the second device displays the display information in the first language type, a fourth control command is sent to the second device, the fourth control command being used to instruct the second device to switch to displaying the display information in the second language type.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method according to any one of claims 1-12.
14. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the method of any one of claims 1-12.
15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method of any one of claims 1-12.