CN112416777B - Text display test method and device, computer equipment and storage medium - Google Patents

Text display test method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112416777B
CN112416777B CN202011330240.XA CN202011330240A CN112416777B CN 112416777 B CN112416777 B CN 112416777B CN 202011330240 A CN202011330240 A CN 202011330240A CN 112416777 B CN112416777 B CN 112416777B
Authority
CN
China
Prior art keywords
text
tested
parameter value
control
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011330240.XA
Other languages
Chinese (zh)
Other versions
CN112416777A (en
Inventor
张光旭
杨都
叶铁英
颜辉
刘鹏
李少章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202011330240.XA priority Critical patent/CN112416777B/en
Publication of CN112416777A publication Critical patent/CN112416777A/en
Application granted granted Critical
Publication of CN112416777B publication Critical patent/CN112416777B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to a text display test method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes; determining a target text parameter value according to a text parameter value range corresponding to the text attribute, assigning the target text parameter value to a text control to be tested, displaying a page, and obtaining an assigned page; and obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page. The method can improve the testing efficiency.

Description

Text display test method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a text display testing method and apparatus, a computer device, and a storage medium.
Background
With the gradual popularization of intelligent interaction equipment, the display screen is used as an important entrance of interaction and is applied more and more widely. Because the languages used by global users are various and the display differences of the languages are large, for example, under the condition of expressing the same meaning, the text length required by other languages is usually longer than that of a Chinese text, so that in the product development process, the real length required by a text display box with the text changed in a page is difficult to evaluate, and the length of the text display box is generally not too long due to the size of a display screen and the design requirement of a User Interface (UI), which brings serious examination to product testing, and difficult simulation of all possible text changes in the testing process can cause the problem of incomplete text display after the product is actually used, thereby affecting the user experience.
At present, the maximum possible text length is usually evaluated in the design stage, so that the length of the text display box is greater than or equal to the length, then in the test stage, manual operation is performed to simulate the actual maximum possible length, whether a text super-box phenomenon occurs is confirmed, and if the text super-box occurs, the product design needs to be modified, and the test and verification are performed again. However, the current testing method has the problem of low efficiency.
Disclosure of Invention
In view of the above, it is necessary to provide a text display testing method, apparatus, computer device and storage medium capable of improving testing efficiency.
A text display testing method, the method comprising:
acquiring control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes;
determining a target text parameter value according to the text parameter value range corresponding to the text attribute, assigning the target text parameter value to the text control to be tested, displaying a page, and obtaining an assigned page;
and obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page.
A text display testing apparatus, the apparatus comprising:
the acquisition module is used for acquiring control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes;
the assignment module is used for determining a target text parameter value according to the text parameter value range corresponding to the text attribute, assigning the target text parameter value to the text control to be tested, displaying a page and obtaining an assigned page;
and the test module is used for obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes;
determining a target text parameter value according to the text parameter value range corresponding to the text attribute, assigning the target text parameter value to the text control to be tested, displaying a page, and obtaining an assigned page;
and obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes;
determining a target text parameter value according to the text parameter value range corresponding to the text attribute, assigning the target text parameter value to the text control to be tested, displaying a page, and obtaining an assigned page;
and obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page.
The text display testing method, the text display testing device, the computer equipment and the storage medium acquire control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes; determining a target text parameter value according to a text parameter value range corresponding to the text attribute, assigning the target text parameter value to a text control to be tested, displaying a page, and obtaining an assigned page; and obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page. Therefore, the text control can be automatically assigned through the target text parameter value in the text parameter value range, and whether the text display of the page is normal after each assignment is judged, so that the page related to dynamic text display can be quickly tested, and the testing efficiency is improved.
Drawings
FIG. 1 is a flow diagram illustrating a text display testing method in one embodiment;
FIG. 2 is a flow diagram that illustrates a method for testing text display in one embodiment;
FIG. 3 is a block diagram of a text display testing apparatus according to an embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a text display testing method is provided, and the embodiment is exemplified by applying the method to a terminal, and includes the following steps S102 to S106.
S102, acquiring control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes.
During the software development process, many User Interface (UI) designs may be involved, and a user may perform corresponding operations through the UI to realize interaction. The page to be tested can represent a user interface needing to be tested, and for one page, the page can contain fixedly displayed content and can also comprise dynamically displayed content, wherein the dynamically displayed content can be understood as that the displayed content changes along with the change of the content input by a user. For example, the page includes a text box for inputting a temperature value, the user inputs the temperature value in the text box, the temperature value input by the user is displayed in the text box, and the temperature value displayed in the text box dynamically changes correspondingly as the temperature value input by the user changes. In this embodiment, the page to be tested may specifically be a page related to dynamic text display.
The text control to be tested represents a text control to be tested, one page may contain contents in different forms such as text, pictures, videos and the like, each form of content has a corresponding identifier, the text control represents a control for displaying the content in the text form and corresponds to the text identifier, the text identifier can identify that the control corresponds to the content in the text form, for example, in a script language (QML) of a UI page, text represents the text identifier. In this embodiment, the text controls to be tested may include all text controls of the page, and the test is performed on all text controls one by one during the test, and when the test of one text control is finished, the test of the next text control is performed.
The control information of the text control to be tested can include information related to display text, and the text attribute can be used to indicate what content is displayed, for example, the text attribute of the text control to be tested is temperature, that is, the text control to be tested is used to display a temperature value. The control information may further include a control identifier (e.g., id), display related information, and the like, where the control identifier corresponds to the control one to one for distinguishing different controls, and the display related information is used for determining a display position and a display manner of the text in the page, for example, the display related information may include, but is not limited to, a display position coordinate (x, y), a width direction pixel size, a height direction pixel size, a font type, a font size, an alignment manner, a language type, and the like.
And S104, determining a target text parameter value according to the text parameter value range corresponding to the text attribute, assigning the target text parameter value to the text control to be tested, displaying a page, and obtaining the assigned page.
The text parameter value range corresponding to the text attribute may be understood as a parameter range that may be displayed by the text corresponding to the text attribute, and specifically may include all text values that may be displayed by the text corresponding to the text attribute. For example, the text attribute is temperature, and the corresponding text parameter value may range from-30 ℃ to 139 ℃; the text attribute is a unit mode, and the corresponding text parameter value range can comprise modes such as refrigeration, heating, dehumidification and the like. The target text parameter value represents a text parameter value within a text parameter value range, and may specifically include all text parameter values within the text parameter value range, or may include a text parameter value partially specified within the text parameter value range.
The assignment is to make the text control to be tested display the text in the allowed display range, the allowed display range is consistent with the text parameter value range, and here, the variable corresponding to the text attribute can be directly assigned, or the text parameter value can be changed through simulating communication or other logics, so that the page text dynamically changes, and all possible displays of the text control to be tested are traversed. And the page after assignment represents the page corresponding to the page with the assigned target text parameter value displayed at the corresponding position in the page to be tested, and the page after one assignment is displayed every time the target text parameter value assignment is performed, and subsequent judgment processing is performed to test whether the assignment display is normal or not.
And S106, obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page.
It can be understood that the text information displayed in the page after assignment includes the corresponding display information after the value of the target text parameter is assigned. For a certain text control to be tested, if the text information displayed in the corresponding assigned page is normally displayed, the text display test result of the text control to be tested can be considered as normal, and if the text information displayed in the corresponding assigned page is abnormally displayed (for example, messy codes are caused by a text hyper-box), the text display test result of the text control to be tested can be considered as abnormal.
In the text display testing method, control information of a text control to be tested in a page to be tested is obtained, wherein the control information comprises text attributes; determining a target text parameter value according to a text parameter value range corresponding to the text attribute, assigning the target text parameter value to a text control to be tested, displaying a page, and obtaining an assigned page; and obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page. Therefore, the text control can be automatically assigned through the target text parameter value in the text parameter value range, and whether the text display of the page is normal after each assignment is judged, so that the page related to dynamic text display can be quickly tested, and the testing efficiency is improved.
In an embodiment, the step of obtaining control information of a text control to be tested in a page to be tested may specifically include the following steps: acquiring a page source code of a page to be tested; and acquiring control information of the text control to be tested in the page to be tested according to the page source code.
The page source code represents a page program source code, which is a source for acquiring page control information, all the text controls can be acquired through the page source code, and corresponding control information is acquired according to the information associated with each text control. The page source code may further include page identifiers, and the page identifiers correspond to the pages one to one and are used for distinguishing different pages.
In an embodiment, the step of determining the target text parameter value according to the text parameter value range corresponding to the text attribute may specifically include: acquiring the length of each text parameter value in a text parameter value range corresponding to the text attribute; and determining the text parameter value with the length greater than or equal to the preset length in the text parameter value range as a target text parameter value.
Through the actual text display abnormal case, it is known that one of the main reasons causing the text display abnormal is that the text display is not complete, and therefore the length of the text is closely related to the text display result. If the text parameter value range is too large, if each possibly displayed parameter value is assigned one by one, the assignment display and judgment processing cycle is too large, the resources and the performance are influenced, the test speed is reduced, if a certain assignment in the text parameter value range can be completely displayed, and other assignments with the length shorter than the assignment are considered to be normally displayed.
Based on the method, a preset length can be set, and the text parameter value with the length greater than or equal to the preset length in the text parameter value range is determined as the target text parameter value, so that the text parameter value with the length less than the preset length is filtered, assignment of the text parameter value with the length less than the preset length is not needed, the assignment display times and the judgment processing times are reduced, processing resources can be saved, and the test efficiency is improved. In addition, text parameter values with the same length can be deduplicated to further reduce the number of assignment display times and the number of judgment processing times. The preset length can be set based on actual conditions, and different preset lengths can be set according to different text attributes.
In one embodiment, after obtaining the assigned page, the following steps may be further included: screenshot is carried out on the assigned page to obtain a page image; and performing text recognition on the page image to obtain text information to be tested. The step of obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page may specifically be: and obtaining a text display test result of the text control to be tested according to the text information to be tested.
For the assigned page, a screenshot can be adopted to obtain a page image, image data come from a real data buffer area of a display screen, and an uncompressed bmp format can be adopted as an image format. In addition, a camera can be used for shooting the page to obtain the page image.
For the obtained page image, any possible image text recognition mode can be utilized to perform text recognition on the page image, text information in the page is recognized and used as text information to be tested, and a text display test result of a text control to be tested is obtained according to the text information to be tested.
In an embodiment, the step of obtaining a text display test result of the text control to be tested according to the text information to be tested may specifically include: and when the text information to be tested contains illegal characters or messy codes, judging that the text display test result of the text control to be tested is abnormal.
If the assigned text parameter values are not completely displayed in the page to be tested, for example, due to the fact that the length of the text control to be tested is insufficient, the assigned text parameter values are only partially displayed, and illegal characters or messy codes can be displayed. Therefore, when the text information to be tested contains illegal characters or messy codes, the text display test result of the corresponding text control to be tested can be considered to be abnormal, and the design of the text control to be tested needs to be checked or modified subsequently.
In one embodiment, the control information further includes a text language type; the step of obtaining a text display test result of the text control to be tested according to the text information to be tested may specifically include: and when the text information to be tested contains a text which does not belong to the text range corresponding to the text language type, judging that the text display test result of the text control to be tested is abnormal.
The text language type represents the language type selected currently by the page to be tested, such as Chinese simplified, chinese traditional, english, german, arabic, and the legal character range of different languages is different. According to the Unicode code specification table, different languages are different in range in the specification table, and if the text information to be tested exceeds the legal character range of the selected text language type, the text display test result of the corresponding text control to be tested can be considered to be abnormal. For example, in the case of an english display page, arabic appears, and it can be determined that the display is abnormal.
In one embodiment, the control information further includes text display position information; the step of performing text recognition on the page image to obtain text information to be tested may specifically include: and performing text recognition on an image area corresponding to the text display position information in the page image to obtain text information to be tested.
The text display position information of the text control to be tested is used for indicating the display position of the text to be displayed by the text control to be tested in the page, and when the text control to be tested is a text box, the text display position information may include: the upper left corner position coordinates (x, y) of the text box, the width of the text box, and the height of the text box. After the page image of the page after assignment is obtained, text recognition is carried out in an image area corresponding to the text display position information, the obtained text information to be tested can be regarded as an actual display value of the assigned text parameter value, the actual display value is compared with the original assignment, and the accuracy of the test result is improved.
In an embodiment, the step of obtaining a text display test result of the text control to be tested according to the text information to be tested may specifically include: and when the text information to be tested is not matched with the target text parameter value, judging that the text display test result of the text control to be tested is abnormal.
In this embodiment, the text information to be tested represents an actual display value of the assigned text parameter value, the target text parameter value represents an original value of the assigned text parameter value, and when the actual display value is not matched with the original value, it can be considered that the text display test result of the corresponding text control to be tested is abnormal. The matching result between the actual displayed value and the original value can be obtained by comparing characters one by one, and the fact that the actual displayed value is not matched with the original value can be understood as that the actual displayed value is not completely consistent with the original value, for example, the actual displayed value has more characters or less characters than the original value, or the actual displayed value and the original value contain different characters, which are considered as that the actual displayed value is not matched with the original value.
In addition, in order to improve the automatic detection efficiency, a certain logic may be run in the test in the page, for example, the text display sequence may be determined according to the language type, most of the language displays are from left to right except for individual languages, and according to the horizontal alignment mode, for the left aligned text display, the right side is easy to appear a super box, and similarly, right alignment, center alignment, and the like may be processed.
In an embodiment, after obtaining the text display test result of the text control to be tested according to the text information displayed in the assigned page, the method may further include the following steps: and when the text display test result of the text control to be tested shows that the text control to be tested is abnormal, recording abnormal information, wherein the abnormal information comprises control information and a target text parameter value.
When the text display test result of the text control to be tested is abnormal, recording abnormal information, wherein the abnormal information can comprise a target text parameter value which is abnormally displayed and control information of the text control corresponding to the target text parameter value, the control information can comprise control identification, language type, font information and the like, and the abnormal information can also comprise corresponding page identification of a page which is abnormally displayed. In implementation, after the text display test of all pages is finished, the page position and the text control position which need to be modified can be quickly found according to all recorded abnormal information.
In one embodiment, as shown in fig. 2, a text display testing method is provided, which includes the following steps S202 to S214.
S202, acquiring a page source code of the page to be tested.
S204, obtaining control information of the text control to be tested in the page to be tested according to the page source code, wherein the control information comprises text attributes.
S206, obtaining the length of each text parameter value in the text parameter value range corresponding to the text attribute, and determining the text parameter value with the length larger than or equal to the preset length in the text parameter value range as the target text parameter value.
And S208, assigning the target text parameter value to the text control to be tested, displaying a page, and obtaining the assigned page.
And S210, performing screenshot on the assigned page to obtain a page image.
S212, text recognition is carried out on the page image, and text information to be tested is obtained.
S214, when the text information to be tested is detected to have abnormal display, recording abnormal information, wherein the abnormal information comprises control information and a target text parameter value.
For a detailed description of steps S202 to S214, reference may be made to the foregoing embodiments, which are not described herein again. In the embodiment, in the development and test process of the UI page related to dynamic text display, the text control information obtained from the page source code is utilized, the text parameter value corresponding to the text attribute is assigned to the text control for display, meanwhile, the screenshot is carried out on the page, the text information in the screenshot is identified, if the text information is displayed abnormally, the current dynamic text display is considered to have a super-frame phenomenon possibly, and the abnormal information is recorded for marking and confirming the abnormal information, so that the UI page related to the dynamic text display can be automatically and quickly tested, the design verification efficiency is improved, the text super-frame phenomenon is prevented, and the product is ensured to meet the requirements.
It should be understood that, although the steps in the flowcharts related to the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in each flowchart related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In one embodiment, as shown in FIG. 3, there is provided a text display testing apparatus 300 comprising: an obtaining module 310, an assigning module 320, and a testing module 330, wherein:
the obtaining module 310 is configured to obtain control information of a text control to be tested in a page to be tested, where the control information includes text attributes.
And the assignment module 320 is configured to determine a target text parameter value according to the text parameter value range corresponding to the text attribute, assign the target text parameter value to the text control to be tested, perform page display, and obtain an assigned page.
And the test module 330 is configured to obtain a text display test result of the text control to be tested according to the text information displayed in the assigned page.
In an embodiment, when acquiring the control information of the text control to be tested in the page to be tested, the acquiring module 310 is specifically configured to: acquiring a page source code of a page to be tested; and obtaining control information of the text control to be tested in the page to be tested according to the page source code.
In an embodiment, when determining the target text parameter value according to the text parameter value range corresponding to the text attribute, the assigning module 320 is specifically configured to: acquiring the length of each text parameter value in a text parameter value range corresponding to the text attribute; and determining the text parameter value with the length greater than or equal to the preset length in the text parameter value range as a target text parameter value.
In one embodiment, the device further comprises a screenshot module and an identification module, wherein the screenshot module is used for screenshot the assigned page to obtain a page image; the identification module is used for performing text identification on the page image to obtain text information to be tested.
In an embodiment, when the test module 330 obtains the text display test result of the text control to be tested according to the text information displayed in the assigned page, the test module is specifically configured to: and obtaining a text display test result of the text control to be tested according to the text information to be tested.
In an embodiment, the testing module 330 obtains a text display testing result of the text control to be tested according to the text information to be tested, and is specifically configured to: and when the text information to be tested contains illegal characters or messy codes, judging that the text display test result of the text control to be tested is abnormal.
In one embodiment, the control information further includes a text language type; the test module 330 obtains a text display test result of the text control to be tested according to the text information to be tested, and is specifically configured to: and when the text information to be tested contains a text which does not belong to the text range corresponding to the text language type, judging that the text display test result of the text control to be tested is abnormal.
In one embodiment, the control information further includes text display position information; the identification module is used for performing text identification on the page image to obtain text information to be tested, and is specifically used for: and performing text recognition on an image area corresponding to the text display position information in the page image to obtain text information to be tested.
In an embodiment, the testing module 330 obtains a text display testing result of the text control to be tested according to the text information to be tested, and is specifically configured to: and when the text information to be tested is not matched with the target text parameter value, judging that the text display test result of the text control to be tested is abnormal.
In one embodiment, the device further comprises a recording module, configured to record exception information when a text display test result of the text control to be tested is that there is an exception, where the exception information includes control information and a target text parameter value.
For the specific definition of the text display testing device, reference may be made to the above definition of the text display testing method, which is not described herein again. The modules in the text display testing device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 4. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for communicating with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a text display testing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the above-described method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the respective method embodiment as described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It should be understood that the terms "first", "second", etc. in the above-described embodiments are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. For the description of numerical ranges, the term "plurality" means more than one, i.e. equal to or greater than two.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (12)

1. A text display testing method, the method comprising:
acquiring control information of a text control to be tested in a page to be tested, wherein the control information comprises text attributes;
determining a target text parameter value according to the text parameter value range corresponding to the text attribute, assigning the target text parameter value to the text control to be tested, displaying a page, and obtaining an assigned page; the text parameter value range is a parameter range which is possibly displayed by the text corresponding to the text attribute;
obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page;
determining a target text parameter value according to the text parameter value range corresponding to the text attribute, wherein the determining of the target text parameter value according to the text parameter value range corresponding to the text attribute comprises the following steps:
acquiring the length of each text parameter value in a text parameter value range corresponding to the text attribute;
and determining the text parameter value with the length greater than or equal to the preset length in the text parameter value range as a target text parameter value.
2. The method of claim 1, wherein obtaining control information of a text control to be tested in a page to be tested comprises:
acquiring a page source code of a page to be tested;
and acquiring control information of the text control to be tested in the page to be tested according to the page source code.
3. The method of claim 1, wherein determining a target text parameter value according to a text parameter value range corresponding to the text attribute further comprises:
and carrying out duplicate removal on the text parameter values with the same length in the target text parameter values.
4. The method of claim 1, after obtaining the assigned page, further comprising:
screenshot is carried out on the assigned page to obtain a page image;
performing text recognition on the page image to obtain text information to be tested;
obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page, wherein the text display test result comprises the following steps:
and obtaining a text display test result of the text control to be tested according to the text information to be tested.
5. The method of claim 4, wherein obtaining the text display test result of the text control to be tested according to the text information to be tested comprises:
and when the text information to be tested contains illegal characters or messy codes, judging that the text display test result of the text control to be tested is abnormal.
6. The method of claim 4, wherein the control information further comprises a text language type; according to the text information to be tested, obtaining a text display test result of the text control to be tested, comprising the following steps:
and when the text information to be tested contains texts which do not belong to the text range corresponding to the text language type, judging that the text display test result of the text control to be tested is abnormal.
7. The method of claim 4, wherein the control information further comprises text display position information; performing text recognition on the page image to obtain text information to be tested, including:
and performing text recognition on an image area corresponding to the text display position information in the page image to obtain text information to be tested.
8. The method of claim 7, wherein obtaining a text display test result of the text control to be tested according to the text information to be tested comprises:
and when the text information to be tested is not matched with the target text parameter value, judging that the text display test result of the text control to be tested is abnormal.
9. The method of claim 1, after obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page, further comprising:
and when the text display test result of the text control to be tested is abnormal, recording abnormal information, wherein the abnormal information comprises the control information and the target text parameter value.
10. A text display testing apparatus, the apparatus comprising:
the system comprises an acquisition module, a display module and a control module, wherein the acquisition module is used for acquiring control information of a text control to be tested in a page to be tested, and the control information comprises text attributes;
the assignment module is used for determining a target text parameter value according to the text parameter value range corresponding to the text attribute, assigning the target text parameter value to the text control to be tested, displaying a page and obtaining an assigned page; the text parameter value range is a parameter range which is possibly displayed by the text corresponding to the text attribute; the assignment module acquires the length of each text parameter value in a text parameter value range corresponding to the text attribute, and determines the text parameter value with the length greater than or equal to a preset length in the text parameter value range as a target text parameter value;
and the test module is used for obtaining a text display test result of the text control to be tested according to the text information displayed in the assigned page.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.
CN202011330240.XA 2020-11-23 2020-11-23 Text display test method and device, computer equipment and storage medium Active CN112416777B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011330240.XA CN112416777B (en) 2020-11-23 2020-11-23 Text display test method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011330240.XA CN112416777B (en) 2020-11-23 2020-11-23 Text display test method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112416777A CN112416777A (en) 2021-02-26
CN112416777B true CN112416777B (en) 2022-11-18

Family

ID=74777050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011330240.XA Active CN112416777B (en) 2020-11-23 2020-11-23 Text display test method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112416777B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113111713B (en) * 2021-03-12 2024-02-27 北京达佳互联信息技术有限公司 Image detection method and device, electronic equipment and storage medium
CN113268416A (en) * 2021-05-17 2021-08-17 深圳Tcl新技术有限公司 Application program testing method and device, storage medium and terminal
CN116089256B (en) * 2022-05-13 2024-03-12 荣耀终端有限公司 Terminal testing method, device and storage medium
TWI847587B (en) * 2023-03-10 2024-07-01 天鈺科技股份有限公司 Test program development methods, systems and electronic equipment

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7712074B2 (en) * 2002-11-21 2010-05-04 Bing Ren Automating interactions with software user interfaces
JP6259779B2 (en) * 2015-01-26 2018-01-10 日本電信電話株式会社 Web browsing quality management apparatus, method and program thereof
CN107783898B (en) * 2017-07-24 2020-03-27 平安科技(深圳)有限公司 Test method and test equipment for mobile application
CN108647141B (en) * 2018-04-26 2022-09-09 腾讯科技(深圳)有限公司 Automatic test method, device, computer readable medium and electronic equipment
CN109597755B (en) * 2018-10-25 2022-04-12 东软集团股份有限公司 Text display detection method and device, storage medium and electronic equipment
CN110321284B (en) * 2019-06-03 2024-05-03 平安科技(深圳)有限公司 Test data entry method, device, computer equipment and storage medium
CN111142988B (en) * 2019-12-03 2023-08-29 东软集团股份有限公司 Page test method and device, storage medium and electronic equipment
CN111026496A (en) * 2019-12-20 2020-04-17 珠海格力电器股份有限公司 Display method and system for switching languages of interactive interface
CN111240962B (en) * 2019-12-31 2023-09-05 中移(杭州)信息技术有限公司 Test method, test device, computer equipment and computer storage medium
CN111273903B (en) * 2020-01-10 2023-08-04 深圳市大富网络技术有限公司 Webpage making method and device, computer equipment and computer storage medium
CN111324535B (en) * 2020-02-18 2022-02-25 腾讯科技(深圳)有限公司 Control abnormity detection method and device and computer equipment
CN111857719B (en) * 2020-07-31 2023-05-30 抖音视界有限公司 Data processing method, device, electronic equipment and medium

Also Published As

Publication number Publication date
CN112416777A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
CN112416777B (en) Text display test method and device, computer equipment and storage medium
CN109947967B (en) Image recognition method, image recognition device, storage medium and computer equipment
CN108427731B (en) Page code processing method and device, terminal equipment and medium
CN107622008B (en) Traversal method and device for application page
CN109658485B (en) Webpage animation drawing method, device, computer equipment and storage medium
CN109978044B (en) Training data generation method and device, and model training method and device
CN110321284B (en) Test data entry method, device, computer equipment and storage medium
CN110554962A (en) Regression testing process covering method, server and computer readable storage medium
CN109814868B (en) Network transmission simulation method and device, computer equipment and storage medium
CN110287104A (en) Method for generating test case, device, terminal and computer readable storage medium
CN112199268B (en) Software compatibility testing method and electronic equipment
CN112633341A (en) Interface testing method and device, computer equipment and storage medium
CN111783812A (en) Method and device for identifying forbidden images and computer readable storage medium
CN112153375A (en) Front-end performance testing method, device, equipment and medium based on video information
CN112905451A (en) Automatic testing method and device for application program
CN112381092A (en) Tracking method, device and computer readable storage medium
CN111488574A (en) Malicious software classification method, system, computer equipment and storage medium
CN104809053A (en) Control style testing method and device
CN111832657B (en) Text recognition method, apparatus, computer device and storage medium
CN114549849A (en) Image recognition method and device, computer equipment and storage medium
CN112596803A (en) Control string truncation checking method and device, computer equipment and storage medium
CN111401465A (en) Training sample optimization method, device, equipment and storage medium
CN113190437B (en) Time sequence analysis method and device for wireless module, computer equipment and storage medium
CN115797267A (en) Image quality evaluation method, system, electronic device, and storage medium
CN110134664B (en) Method and device for acquiring data migration path and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant