A page element problem identification method and device, electronic equipment and storage medium
By obtaining the view structure information and layout code of Android applications, calculating the displayed text information, and combining it with an automated testing framework, the problem of automated problem identification on Android pages is solved, and the identification efficiency of multilingual applications is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA AUTOMOTIVE INNOVATION CORP
- Filing Date
- 2024-12-16
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, automated problem identification of Android pages is difficult to achieve, especially in multilingual applications where there is a lack of prototype references, requiring manual verification, which leads to low identification efficiency.
By obtaining the view structure information of the target application, the layout information and layout code of page elements are determined, the currently displayed text information and the target displayed text information are calculated, display text issues are identified, and click operations are performed through an automated testing framework to identify position overlap and text issues.
It enables automated problem identification on Android pages, improving identification efficiency, especially in multilingual applications where it can automatically identify issues such as incomplete text display, incorrect line breaks, and overlapping text.
Smart Images

Figure CN119782164B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated testing of mobile devices, and in particular to a method, apparatus, electronic device, and storage medium for identifying page element problems. Background Technology
[0002] Currently, Android page issue identification typically involves matching the page with an Android page prototype to determine if a problem exists. However, for multilingual applications, manual verification is still required when there is no Android page prototype for reference. Summary of the Invention
[0003] To address the problems of the prior art, this application provides a method, apparatus, electronic device, and storage medium for identifying page element problems, thereby at least solving the problem that the prior art cannot perform automated problem identification of Android pages. The technical solution is as follows:
[0004] According to a first aspect of the embodiments of this application, a method for identifying page element problems is provided, the method comprising:
[0005] Obtain the view structure information of the page to be identified in the target application; the view structure information includes the layout information of each page element in the page to be identified;
[0006] For each page element in the page to be identified, based on the layout information of the page element, the page layout code file of the page to be identified is searched to obtain the layout code information of the page element; the layout code information is used to define the layout of the page element.
[0007] When the layout information includes display text information, calculations are performed based on the layout code information and the layout information to obtain the current display text information and the target display text information of the page element;
[0008] Based on the currently displayed text information and the target displayed text information of the page element, display text problem identification is performed to obtain the text problem identification result of the page element.
[0009] In one exemplary implementation, the layout information includes the boundary coordinate information of the page element on the page to be identified;
[0010] After obtaining the view structure information of the target application's page to be identified, the method further includes:
[0011] Based on the view structure information, determine the structural hierarchy corresponding to each page element in the page to be identified;
[0012] For the page to be identified, the position overlap problem between page elements of the same structural level in the page to be identified is identified based on the boundary coordinate information of each page element in the page to be identified, so as to obtain the position overlap problem identification result of each page element in the page to be identified.
[0013] In one exemplary implementation, when the page to be identified includes multiple different pages to be identified in the target application, the method further includes:
[0014] The target problem identification results in the problem identification result set are deduplicated to obtain the deduplicated problem identification results; the target problem identification results represent multiple identical problem identification results of the same page element in the multiple different pages to be identified; the problem identification result set includes positional overlap problem identification results and text problem identification results.
[0015] In one exemplary embodiment, the method further includes:
[0016] Obtain screenshots of the multiple different pages to be identified;
[0017] After obtaining the deduplication problem identification result, the method further includes:
[0018] The deduplication problem identification results are marked on the screenshots of the multiple different pages to be identified, and the positions of the deduplication problem identification results and the positions of the page elements corresponding to the deduplication problem identification results on the screenshots of the multiple different pages to be identified are marked one-to-one.
[0019] In one exemplary implementation, the step of searching the page layout code file based on the layout information to obtain the layout code information of the page elements includes:
[0020] When the layout information contains target information, the page layout code file is searched based on the target information to obtain the layout code information of the page element;
[0021] When the layout information does not contain target information, the layout information of the target page element is obtained by searching the view structure text generated based on the view structure information of the page to be identified. The layout information of the target page element includes the target identifier of the target page element. Based on the target identifier, the view structure text is searched to obtain the layout code information corresponding to the target identifier. The layout code information corresponding to the target identifier is determined as the layout code information of the target page element. Based on the position and relative position information of the layout code information of the target page element in the view structure text, the page layout code file is searched to obtain the layout code information of the page element. The relative position information represents the relative position of the layout information of the target page element and the layout information of the page element in the view structure text.
[0022] In one exemplary implementation, the target information includes display text information; the step of searching the page layout code file based on the target information to obtain the layout code information of the page elements includes:
[0023] When the target information contains the identifier of the page element, the page layout code file is searched based on the identifier to obtain the layout code information corresponding to the identifier, and the layout code information corresponding to the identifier is determined as the layout code information of the page element.
[0024] When the target information does not contain the identifier, the page layout code file is searched based on the display text information to obtain layout code information containing the display text information, and the layout code information containing the display text information is determined as the layout code information of the page element.
[0025] In one exemplary embodiment, the method further includes:
[0026] The target application is clicked using an automated testing framework;
[0027] Obtain the view structure information of the page before the click and the view structure information of the page after the click in the target application;
[0028] A similarity comparison is performed based on the view structure information of the page before the click and the view structure information of the page after the click.
[0029] Determine whether the result of the similarity comparison is less than a first preset similarity threshold;
[0030] If so, confirm that the page after clicking is the page to be identified.
[0031] According to a second aspect of the embodiments of this application, a page element problem identification device is provided, the device comprising:
[0032] The view structure information acquisition module is used to acquire the view structure information of the page to be identified in the target application; the view structure information includes the layout information of each page element in the page to be identified;
[0033] The layout code information lookup module is used to search for the page layout code file of the page to be identified for each page element in the page to be identified, based on the layout information of the page element, to obtain the layout code information of the page element; the layout code information is used to define the layout of the page element.
[0034] The calculation module is used to calculate, based on the layout code information and the layout information, the current display text information and the target display text information of the page element when the layout information contains display text information;
[0035] The text problem recognition module is used to perform text problem recognition based on the currently displayed text information and the target displayed text information of the page element, and obtain the text problem recognition result of the page element.
[0036] In one exemplary embodiment, the layout information includes the boundary coordinate information of the page element on the page to be identified; the apparatus further includes:
[0037] The structure hierarchy determination module is used to determine the structure hierarchy corresponding to each page element in the page to be identified based on the view structure information.
[0038] The position overlap problem identification module is used to identify position overlap problems between page elements of the same structural level on the page to be identified based on the boundary coordinate information of each page element on the page to be identified, and to obtain the position overlap problem identification result of each page element on the page to be identified.
[0039] In one exemplary embodiment, when the page to be identified includes multiple different pages to be identified in the target application, the apparatus further includes:
[0040] The deduplication module is used to deduplicatize the target problem identification results in the problem identification result set to obtain the deduplicated problem identification results; the target problem identification results represent multiple identical problem identification results of the same page element in the multiple different pages to be identified; the problem identification result set includes positional overlap problem identification results and text problem identification results.
[0041] In one exemplary embodiment, the apparatus further includes:
[0042] The screenshot acquisition module is used to acquire screenshots of the multiple different pages to be identified;
[0043] The marking module is used to mark the deduplication problem identification results on the screenshots of the multiple different pages to be identified, and the position of the deduplication problem identification results and the position of the page elements corresponding to the deduplication problem identification results on the screenshots of the multiple different pages to be identified correspond one-to-one.
[0044] In one exemplary implementation, the layout code information lookup module includes:
[0045] The first search module is used to search the page layout code file based on the target information when the layout information contains target information, so as to obtain the layout code information of the page element;
[0046] The second search module is used to search for the layout information of the target page element by generating a view structure text based on the view structure information of the page to be identified when the layout information does not contain target information. The layout information of the target page element includes the target identifier of the target page element. Based on the target identifier, the view structure text is searched to obtain the layout code information corresponding to the target identifier, and the layout code information corresponding to the target identifier is determined as the layout code information of the target page element. Based on the position and relative position information of the layout code information of the target page element in the view structure text, the page layout code file is searched to obtain the layout code information of the page element. The relative position information represents the relative position of the layout information of the target page element and the layout information of the page element in the view structure text.
[0047] In one exemplary implementation, the first lookup module includes:
[0048] The identifier lookup module is used to, when the target information contains the identifier of the page element, search the page layout code file based on the identifier, obtain the layout code information corresponding to the identifier, and determine the layout code information corresponding to the identifier as the layout code information of the page element;
[0049] The display text information search module, when the target information does not contain the identifier, searches the page layout code file based on the display text information to obtain layout code information containing the display text information, and determines the layout code information containing the display text information as the layout code information of the page element.
[0050] In one exemplary embodiment, the apparatus further includes:
[0051] An automated testing framework is used to perform clicks on the target application.
[0052] The module for obtaining click view structure information is used to obtain the view structure information of the page before the click and the view structure information of the page after the click in the target application.
[0053] The similarity comparison module is used to perform a similarity comparison based on the view structure information of the page before the click and the view structure information of the page after the click.
[0054] The similarity determination module is used to determine whether the result of the similarity comparison is less than a first preset similarity threshold;
[0055] The module for determining the page to be identified determines that the page after clicking is the page to be identified when the result of the similarity comparison is less than a first preset similarity threshold.
[0056] According to a third aspect of the present disclosure, an electronic device is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the page element problem identification method of any of the above aspects.
[0057] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the page element problem identification method as described in any of the above aspects.
[0058] According to a fifth aspect of the present disclosure, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the electronic device to perform the task scheduling detection method of any of the above aspects.
[0059] This application embodiment obtains the view structure information of the page to be identified in the target application; the view structure information includes the layout information of each page element in the page to be identified; for each page element in the page to be identified, based on the layout information of the page element, the page layout code file of the page to be identified is searched to obtain the layout code information of the page element used to define the layout of the page element; when the layout information includes display text information, the current display text information and the target display text information of the page element are calculated based on the layout code information and the layout information; display text problem identification is performed based on the current display text information and the target display text information to obtain the problem identification result of the page element, thereby realizing the automated display text problem identification of each page element in the page to be identified. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a flowchart illustrating a method for identifying page element problems provided in an embodiment of this application;
[0062] Figure 2 This is a schematic diagram of the automatic click process of a page element problem identification method provided in an embodiment of this application;
[0063] Figure 3 This is a structural block diagram of a page element problem identification device provided in an embodiment of this application;
[0064] Figure 4 This is a hardware structure block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0065] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0066] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0067] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0068] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0069] This application relates to a page element problem identification technology for Android system application pages in the field of automated testing for mobile devices. With the increasing complexity of mobile applications, the importance of automated testing in software development is becoming increasingly prominent. Identifying page display problems, especially common issues in multilingual applications such as incomplete text display, incorrect line breaks, and text overlap, often requires testers or user page designers to manually check each page element and displayed text. User page problem identification is a tedious and laborious process. Currently, user page problem identification typically involves matching the page with a user page prototype to determine if a problem exists. For multilingual applications, manual verification is still necessary when there is no user page prototype for reference. Therefore, developing an automated method for identifying problems on Android user pages is essential.
[0070] This application addresses the problem of the inability of existing technologies to automatically identify problems on Android pages by providing a method for identifying page element problems. This method obtains the view structure information of the page to be identified in the target application, and obtains the layout code information of each page element based on the layout information of each page element contained in the view structure information. When the layout information includes display text information, calculations are performed based on the layout code information and the layout information. Based on the calculated current display text information and target display text information of the page element, display text problem identification is performed, thereby obtaining the text problem identification result of the page element.
[0071] The following describes a specific embodiment of a page element problem identification method provided in this application. Please refer to [link / reference]. Figure 1 The diagram illustrates a flowchart of a page element problem identification method provided in this application. It should be noted that while this specification provides the operational steps of the method as described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive methods. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or product execution, the method can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or accompanying drawings. Specifically, the method may include the following steps:
[0072] Step S1: Obtain the view structure information of the page to be identified in the target application; the view structure information includes the layout information of each page element in the page to be identified.
[0073] Specifically, page layouts displayed in mobile applications typically use a tree structure. The page view structure information obtained through AndroidUIAutomator (Android automated testing framework) can be considered as a snapshot containing the layout information of each page element in the user's page tree structure. All page element information on the current page is exported to an Extensible Markup Language (XML) file, i.e., the page view structure text. This page view structure text includes view structure information containing the layout information of each page element on the current page.
[0074] In some exemplary implementations, the layout information includes the boundary coordinates of page elements on the page to be identified;
[0075] After obtaining the view structure information of the target application's page to be identified, the method also includes:
[0076] Based on the view structure information, determine the structural hierarchy corresponding to each page element in the page to be identified;
[0077] For the page to be identified, the position overlap problem is identified between page elements of the same structural level on the page to be identified based on the boundary coordinate information of each page element in the page to be identified, and the position overlap problem identification result of each page element in the page to be identified is obtained.
[0078] Specifically, the hierarchy of page elements is determined by the correspondence between parent and child nodes in the tree-like layout of the view structure information. For example, the root node has a hierarchy of 0, which is a page element at level 0. The hierarchy of page elements increases by 1 for each deeper level. The hierarchy of each page element in the current view structure is obtained recursively, thus determining the hierarchy of each page element in the page to be identified. By identifying the positional overlap between multiple page elements at the same level based on the boundary coordinate information, the positional overlap identification result of each page element in the page to be identified can be obtained.
[0079] Step S2: For each page element in the page to be identified, based on the layout information of the page element, search for the page layout code file of the page to be identified to obtain the layout code information of the page element; the layout code information is used to define the layout of the page element.
[0080] Specifically, compared with the layout code information of page elements, the layout information of this page element cannot obtain information such as the font size, width / height type, and padding of the page element. The lack of font size makes it impossible to calculate the height and width of the font display, and the lack of width / height type and padding of the page element makes it impossible to determine whether the text of the page element is not fully displayed.
[0081] In some exemplary implementations, based on layout information, the page layout code file is searched to obtain the layout code information of page elements, including:
[0082] When the layout information contains target information, the page layout code file is searched based on the target information to obtain the layout code information of the page elements;
[0083] When the layout information does not contain target information, the layout information of the target page element is obtained by searching the view structure text generated based on the view structure information of the page to be identified. The layout information of the target page element includes the target identifier of the target page element. Based on the target identifier, the view structure text is searched to obtain the layout code information corresponding to the target identifier. The layout code information corresponding to the target identifier is determined as the layout code information of the target page element. Based on the position and relative position information of the layout code information of the target page element in the view structure text, the page layout code file is searched to obtain the layout code information of the page element. The relative position information represents the relative position of the layout information of the target page element and the layout information of the page element in the view structure text.
[0084] Specifically, when the layout information includes target information, the layout code information of the page element can be obtained by searching the page layout code file based on the target information. When the layout information does not include target information, the layout information of the target page element containing the target identifier is first found in the view structure text generated from the view structure information of the page to be identified. Since the relative position of the layout information of the target page element and the layout information of the page element can be determined in the view structure text, the position of the layout code information of the page element in the page layout code file can be determined by using the relative position information and the position of the layout code information of the target page element in the page layout code file, thereby obtaining the layout code information of the page element.
[0085] In some exemplary implementations, the target information includes display text information; based on the target information, the page layout code file is searched to obtain the layout code information of the page elements, including:
[0086] When the target information contains the identifier of a page element, the page layout code file is searched based on the identifier to obtain the layout code information corresponding to the identifier. The layout code information corresponding to the identifier is then determined as the layout code information of the page element.
[0087] When the target information does not contain an identifier, the page layout code file is searched based on the display text information to obtain the layout code information containing the display text information. The layout code information containing the display text information is then identified as the layout code information of the page element.
[0088] Specifically, when the target information contains an identifier for a page element, the layout code information corresponding to that identifier is found in the page layout code file, thus identifying it as the layout code information for the page element. When the target information does not contain an identifier, the layout code information containing the displayed text information is found in the page layout code file, thus identifying it as the layout code information for the page element.
[0089] Step S3: When the layout information includes display text information, calculate based on the layout code information and layout information to obtain the current display text information and target display text information of the page element;
[0090] Specifically, when the width and height of page elements are fixed in the layout code information, the current displayed text width is obtained by subtracting the difference between the left and right margins of the page element from the width of the page element, and the difference between the top and bottom margins of the page element from the height of the page element. If the page element also contains icons, the current displayed text width is obtained by subtracting the width of the left and right margins of the page element and the width of the icon from the width of the page element, and the current displayed text height is obtained by subtracting the height of the top and bottom margins of the page element and the height of the icon from the height of the page element. The height of the icon and the height can be obtained from the view structure information or the layout code information.
[0091] The calculation of the target displayed text information is based on the font language, font text, and font attributes to obtain the target displayed text height and width. Among them, the font language and font text are based on the layout information. It should be noted that the font text information contained in the layout information is the complete font text information of the page element and is not affected by issues such as incomplete display. The font attributes are obtained through the layout code information. These font attributes include information such as font size and whether the font is bold. For example, the height and width of the font required for text display are calculated using the Pillow library in Python software based on the font language, font text, and font attributes.
[0092] Step S4: Based on the currently displayed text information and the target displayed text information of the page element, perform text problem identification to obtain the text problem identification result of the page element.
[0093] Specifically, when there is a maximum width limit on the target displayed text, the font is split. Taking English words as an example, the width of the word and the space are added sequentially. When the added width exceeds the maximum width, a line break is performed. The height of the target displayed text is calculated as the font line height multiplied by the number of lines, where the font line height is based on the height of the text itself. Common text display incompleteness issues include the following: fixed text height resulting in incomplete display and adaptive text width and height but displaying beyond the boundaries, leading to incomplete display. For the case of fixed text height resulting in incomplete display, first, the width and height attributes of the page element are obtained. If the width and height are fixed, the width and height of the target displayed text under the width limit are calculated. It is then determined whether the fixed height of the page element meets the requirement. If the fixed height of the page element is less than the height of the target displayed text, the text is incomplete. For the case of adaptive text width and height resulting in incomplete display, the layout information of the page element is obtained. If the layout information defines the starting left boundary distance of the text but has no constraint on the right boundary, the text may display beyond the screen, resulting in incomplete display. There are several common causes of incorrect line breaks: Incorrect line breaks within a single word or between buttons occur because the current text width of the page element is insufficient; incorrect line breaks occur when the width of any word exceeds the maximum current text display width limit; incorrect line breaks occur when the width and height of the target text exceed the current text display width limit of the page element, and the page element is clickable.
[0094] In some exemplary implementations, when the page to be identified includes multiple different pages to be identified in the target application, the method further includes:
[0095] The target problem identification results in the problem identification result set are deduplicated to obtain the deduplicated problem identification results; the target problem identification results represent multiple identical problem identification results of the same page element in multiple different pages to be identified; the problem identification result set includes positional overlap problem identification results and text problem identification results.
[0096] Specifically, since multiple identical problem identification results for the same page element in multiple different pages to be identified are obtained, the multiple identical problem identification results are used as the target problem identification result. The target problem identification results in the problem identification result set are deduplicated to obtain the deduplicated problem identification result. The problem identification result set includes positional overlap problem identification results and text problem identification results.
[0097] In some exemplary embodiments, the method further includes:
[0098] Obtain screenshots of multiple different pages to be identified;
[0099] After obtaining the deduplication and problem identification results, the method also includes:
[0100] The deduplication problem identification results are marked on screenshots of multiple different pages to be identified, and the positions of the deduplication problem identification results and the positions of the corresponding page elements on the screenshots of multiple different pages to be identified are marked one-to-one.
[0101] By marking the deduplication problem identification results on screenshots of multiple different pages to be identified, and ensuring that the positions of the deduplication problem identification results and the positions of the corresponding page elements on the screenshots of multiple different pages to be identified are in a one-to-one correspondence, for example, by drawing borders of page elements with identification problems on the corresponding page screenshots and adding specific description information of the identification problems, it is easy to verify the problems.
[0102] In some exemplary embodiments, the method further includes:
[0103] Use an automated testing framework to perform clicks on the target application;
[0104] Obtain the view structure information of the page before the click and the view structure information of the page after the click in the target application;
[0105] A similarity comparison is performed based on the view structure information of the page before and after the click.
[0106] Determine whether the similarity comparison result is less than the first preset similarity threshold;
[0107] If so, confirm that the page after clicking is the page to be identified.
[0108] Specifically, the first preset similarity threshold can be set according to specific settings. For example, it can be set to 90%. Based on the automatic click operation, the similarity is compared between the view structure information of the page before the click and the view structure information of the page after the click. When the result of the similarity comparison is less than the first preset similarity threshold of 90%, the page after the click is determined to be the page to be identified.
[0109] This application also provides an automatic click method to obtain view structure information and screenshots of all target programs in the Android system. First, it utilizes UIAutomator, an automated testing framework provided by Android, to perform click operations. It can also be used to obtain view structure information of application pages. For example, the following click touch methods are configured: Random click (randomly select coordinates and click once within the target program's page area); Random click clickable (randomly click clickable) among page elements on the target program's page; Random swipe (randomly select start and end coordinates within the target program's page); Random swipe (randomly select scrollable page elements within the target program's page); Swipe down once to open the negative one screen (Swipe down); Swipe up once to open the corresponding page (Swipe up); Automatic click and swipe within the target program's page (Auto click); Click the "All Apps" icon (Click Allapp); Return to the home page (Click Home). By defining multiple touch methods, automatic click patterns can be configured for different target applications. For example, for a specific target application, configuration can be set to randomly click elements with click attributes within the target application's page, randomly swipe, or automatically click, preventing navigation to other target application pages or access to the negative one screen during the click process. Furthermore, repeated clicks on page elements can be suppressed by recording click paths, and click efficiency can be improved by configuring touch methods and recording automatic click paths.
[0110] First, please refer to Figure 2 , Figure 2 This is a schematic diagram of the automatic click process of a page element problem identification method provided in an embodiment of this application. The steps are as follows:
[0111] Step S201: Obtain and save the view structure information and screenshot of the target application's page before the click;
[0112] Specifically, after obtaining the view structure information and screenshot of the target application's page before the click, the view structure information can be compared with a set of saved view structure information. If the view structure information is the same as any view structure information in the set of saved view structure information, it means that the view structure information and screenshot of the page before the click have been saved and do not need to be saved again. The method for determining whether the view structure information and screenshot have been saved can be to perform a similarity comparison. For example, when the similarity comparison result between the view structure information and any view structure information in the set of saved view structure information is greater than or equal to a second preset similarity threshold of 90%, it is determined that the view structure information and screenshot of the page before the click have been saved.
[0113] Step S202: Select the unclicked page elements from the set of page elements on the page before the click;
[0114] Specifically, one method to determine unclicked page elements is to save the clicked page elements. The selected page element can be compared with the saved set of clicked page elements in the page containing that element. If the page element is not in the saved set of clicked page elements, then the page element is considered an unclicked page element.
[0115] Step S203: Determine whether the unclicked page element is a page element that returns to the previous page;
[0116] If not, proceed to step S204: click on the unclicked page element to get the page after clicking;
[0117] If so, after rearranging the click order of the unclicked page elements, return to step S202;
[0118] Step S205: Obtain the view information and screenshot of the page after clicking;
[0119] Step S206: Determine whether the page after clicking is the same as the page before clicking;
[0120] Specifically, the similarity of the obtained view structure information of the page before the click and the view structure information of the page after the click is compared; it is determined whether the result of the similarity comparison is less than a first preset similarity threshold; if so, it is determined whether the page after the click is the same as the page before the click; for example, the first preset similarity threshold is set to 90%. Based on the automatic click operation, the similarity of the obtained view structure information of the page before the click and the view structure information of the page after the click is compared. When the result of the similarity comparison is greater than or equal to the first preset similarity threshold of 90%, the page after the click is the same as the page before the click, and the page after the click is the page to be identified.
[0121] Step S207: Update the page after the click to the page before the click, until the only unclicked page element in the page element set of the page before the click is the page element that returns to the previous page, and click the page element that returns to the previous page.
[0122] Specifically, clicking the page element to return to the previous page will return you to the previous page. Then, you will continue to execute step S201 until all page elements of the target application have been clicked.
[0123] Specifically, after a click is completed, the saved set of clicked page elements and the saved set of view structure information can be compared and searched. It should be noted that the same page element on different pages needs to be saved. The saved information of clicked page elements includes the page information it belongs to. The saved set of view structure information is checked to see if the number of page elements in it is greater than the number of page elements in the saved set of clicked page elements. The extra page elements are the unclicked page elements. Based on the page structure information corresponding to the unclicked page elements, the page containing the unclicked page elements can be found, and the user can jump back to that page to click on the unclicked page elements, thereby further ensuring click coverage.
[0124] In addition, when saving the view structure information and screenshot of the page before the target application is clicked, the save time is recorded. If the latest save time meets the preset time, it is determined that the target application has been clicked, and then another target application can be clicked. For example, the preset time is 120 seconds, the last save time is 08:00:00, and the current time is 08:02:00, which means that the target application is determined to have been clicked.
[0125] The following describes a specific embodiment of the page element identification method provided in this application. Clicking on a target application in an Android system yields page 1 of the target application. Page 1 is the page to be identified. Page elements in page 1 include A1, B1, C1, and D1. First, the view structure information and screenshot of page 1 are acquired and saved. A1 is selected, and it is determined that A1 is a page element that returns to the previous page. After rearranging the click order of the unclicked page elements, B1 is selected. It is determined that B1 is not a page element that returns to the previous page. After clicking B1, the view structure information and screenshot of the page after the click are acquired. The view structure information of the page after the click is compared with the view structure information of the page before the click. The similarity result is 50%, which is less than... The first preset similarity threshold is 90%, so the page after clicking is page 2. Page 2 is different from page 1, and page 2 is the page to be identified. The view structure information and screenshot of page 2 are saved. The page elements in page 2 include A2, C2, and D2, where A2 is the page element that returns to the previous page. When C2 is selected, it is determined that C2 is not the page element that returns to the previous page. After clicking C2, the view structure information and screenshot of the page after clicking are obtained. The view structure information of the page after clicking is compared with the view structure information of the page before clicking. The result is a similarity of 91%, which is greater than the first preset similarity threshold of 90%. It is determined that the page after clicking is the same as page 2, and the view structure information and screenshot of the page after clicking are not saved repeatedly. D is selected. At step 2, it is determined that D2 is not a page element that returns to the previous page. After clicking D2, the view structure information and screenshot of the page after the click are obtained. The view structure information of the page after the click is compared with the view structure information of the page before the click. The similarity result is 70%, which is less than the first preset similarity threshold of 90%. It is determined that the page after clicking D2 is different from page 2. The page after clicking D2 is page 3. The view structure information of page 3 is compared with the view structure information in the saved view structure information set. The comparison result is 80%, which is less than the second preset similarity threshold of 90%. The obtained view structure information and screenshot of page 3 are saved. The page elements in page 3 only include A3. A3 is the page element that returns to the previous page. Clicking... After clicking A3, the view structure information and screenshot of the page after the click are obtained. The view structure information of the page after the click is compared with the view structure information of the page before the click. The result is a similarity of 70%, which is less than the first preset similarity threshold of 90%. The page after clicking A3 is different from page 3 and is the page to be identified. The view structure information of page 2 is compared with the view structure information in the saved view structure information set. The comparison result is 100%, which is greater than the second preset similarity threshold of 90%. Therefore, it is page 2, and the view structure information and screenshot of page 2 are no longer saved. It is determined that the only unclicked page element in page 2 is A2. If A2 is clicked, the view structure information and screenshot after the click are obtained to continue the judgment.It is determined that the page after clicking A2 is different from page 2 and is the page to be identified. After similarity comparison, it is page 1. It is determined that the view structure information and screenshot of page 1 have been saved, and the view structure information and screenshot of page 1 will not be saved again. Since D1 on page 1 has not been clicked, the selection and judgment of D1 will continue to be carried out according to the above steps until all page elements on all pages of the target application have been clicked. During the clicking process, the clicked page elements and their page information are recorded. By comparing the saved set of page view structure information with the saved set of clicked page elements, the unclicked page elements and their pages can be identified, and the user can directly jump to the page to click. When the click time threshold is met, the clicking of the target application stops, and the clicking of the next target application can continue. Then, based on the obtained view structure information of all pages in the target application, problem identification is performed. B1's layout information contains a B1 identifier. Directly based on this identifier, the layout code information corresponding to this identifier in the page layout code file is found; this is B1's layout code information. Following the order in the page view structure information, the search continues for C1's layout code information. C1's layout information does not contain display text information or identifiers. Based on the relative positions of C1 and B1 in the view structure text generated from the view structure information, combined with the position of B1's layout code information in the page layout code file, C1's layout code information can be found. After obtaining the layout code information for each page element in all pages, for page elements with layout information containing display text information, the font size, bolding, and other attributes in the text are determined based on their layout code information. The target display text information, including the width and height of the target display text, is calculated based on the page element's layout code information. The width, height, left and right margins, top and bottom margins of the page element, and the width and height of elements containing icons are used to calculate the currently displayed text information of the page element. This currently displayed text information and the target displayed text information are then used for text problem identification to obtain the text problem identification results. The hierarchy of each page element on the page is determined based on the view structure information. Multiple page elements at the same hierarchy are then overlapped based on the page element boundary coordinates contained in their respective layout information to obtain the position overlap identification results. This results in a set of problem identification results for the entire target application. C1 and C2 are the same page element C on different pages, and both C1 and C2 have text problem identification results for fixed-height, incomplete text display. The two text problem identification results for C with fixed-height, incomplete text display are deduplicated, and only one text problem identification result for C with fixed-height, incomplete text display is saved. After obtaining the deduplicated problem identification results, they are marked.The text recognition result for a problem where the text height of C is fixed but not fully displayed can be marked at the screenshot location corresponding to the page containing C1, or at the screenshot location corresponding to the page containing C2. Each marked location corresponds one-to-one with the position of the corresponding page element in the screenshot.
[0126] As can be seen from the above technical solutions of the embodiments of this application, the embodiments of this application obtain the view structure information of the page to be identified of the target application; the view structure information includes the layout information of each page element in the page to be identified; for each page element in the page to be identified, based on the layout information of the page element, the page layout code file of the page to be identified is searched to obtain the layout code information of the page element used to define the layout of the page element; when the layout information contains display text information, calculations are performed based on the layout code information and the layout information, and display text problem identification is performed on the current display text information and target display text information of the page element obtained based on the calculation to obtain the problem identification result of the page element, thereby achieving the purpose of automatically identifying display text problems for each page element in the page to be identified.
[0127] This application also provides a page element problem identification device. Figure 3 This is a structural block diagram of a page element problem identification device, such as... Figure 3 As shown, the page element problem identification device 300 includes:
[0128] According to a second aspect of the embodiments of this application, a page element problem identification device 300 is provided, the device comprising:
[0129] The view structure information acquisition module 310 is used to acquire the view structure information of the page to be identified in the target application; the view structure information includes the layout information of each page element in the page to be identified;
[0130] The layout code information lookup module 320 is used to search for the page layout code file of the page to be identified for each page element in the page to be identified, based on the layout information of the page element, and obtain the layout code information of the page element; the layout code information is used to define the layout of the page element.
[0131] The calculation module 330 is used to calculate, based on the layout code information and layout information, the current display text information and the target display text information of the page element when the layout information contains display text information;
[0132] The text problem recognition module 340 is used to perform text problem recognition based on the currently displayed text information and the target displayed text information of the page element, and obtain the text problem recognition result of the page element.
[0133] In one exemplary embodiment, the layout information includes the boundary coordinates of page elements on the page to be identified; the device 300 further includes:
[0134] The structure hierarchy determination module is used to determine the structure hierarchy corresponding to each page element in the page to be identified based on the view structure information.
[0135] The position overlap problem identification module is used to identify position overlap problems between page elements of the same structural level on the page to be identified based on the boundary coordinate information of each page element on the page to be identified, and obtain the position overlap problem identification result of each page element on the page to be identified.
[0136] In one exemplary embodiment, when the page to be identified includes multiple different pages to be identified in the target application, the device 300 further includes:
[0137] The deduplication module is used to deduplicatize the target problem identification results in the problem identification result set to obtain the deduplicated problem identification results; the target problem identification results represent multiple identical problem identification results of the same page element in multiple different pages to be identified; the problem identification result set includes positional overlap problem identification results and text problem identification results.
[0138] In one exemplary embodiment, the device 300 further includes:
[0139] The screenshot acquisition module is used to acquire screenshots of multiple different pages to be identified;
[0140] The tagging module is used to mark the deduplicated problem identification results on screenshots of multiple different pages to be identified, and the position of the marked deduplicated problem identification result corresponds one-to-one with the position of the page element corresponding to the deduplicated problem identification result on the screenshots of multiple different pages to be identified.
[0141] In one exemplary implementation, the layout code information lookup module 320 includes:
[0142] The first search module is used to search the page layout code file based on the target information when the layout information contains target information, so as to obtain the layout code information of the page elements.
[0143] The second search module is used to search for the layout information of the target page element by generating view structure text based on the view structure information of the page to be identified when the layout information does not contain target information. The layout information of the target page element includes the target identifier of the target page element. Based on the target identifier, the view structure text is searched to obtain the layout code information corresponding to the target identifier, and the layout code information corresponding to the target identifier is determined as the layout code information of the target page element. Based on the position and relative position information of the layout code information of the target page element in the view structure text, the page layout code file is searched to obtain the layout code information of the page element. The relative position information represents the relative position of the layout information of the target page element and the layout information of the page element in the view structure text.
[0144] In one exemplary implementation, the first lookup module includes:
[0145] The identifier lookup module is used to search the page layout code file based on the identifier when the target information contains the identifier of the page element, obtain the layout code information corresponding to the identifier, and determine the layout code information corresponding to the identifier as the layout code information of the page element.
[0146] The display text information search module searches the page layout code file based on the display text information when the target information does not contain an identifier. It then obtains the layout code information containing the display text information and identifies it as the layout code information for the page element.
[0147] In one exemplary embodiment, the device 300 further includes:
[0148] An automated testing framework for performing clicks on a target application;
[0149] The module for obtaining clicked view structure information is used to obtain the view structure information of the page before the click and the page after the click in the target application.
[0150] The similarity comparison module is used to compare the similarity based on the view structure information of the page before the click and the view structure information of the page after the click.
[0151] The similarity determination module is used to determine whether the result of the similarity comparison is less than a first preset similarity threshold;
[0152] The module for determining the page to be identified determines the page to be identified if the result of the similarity comparison is less than the first preset similarity threshold.
[0153] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual 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. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0154] This application also provides an electronic device, including a processor; a memory for storing processor-executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, it implements the page element problem identification method provided in any of the above embodiments.
[0155] The electronic device can be a terminal, a server, or a similar computing device. Taking a terminal as an example... Figure 4 This is a block diagram illustrating an electronic device implementing a page element problem identification method according to an exemplary embodiment, specifically:
[0156] The terminal may include an RF (Radio Frequency) circuit 410, a memory 420 including one or more computer-readable storage media, an input unit 430, a display unit 440, a sensor 450, an audio circuit 360, a WiFi (Wireless Fidelity) module 470, a processor 480 including one or more processing cores, and a power supply 490, among other components. Those skilled in the art will understand that... Figure 3 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0157] The RF circuit 410 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 480 for processing; additionally, it transmits uplink data to the base station. Typically, the RF circuit 410 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. Furthermore, the RF circuit 410 can also communicate wirelessly with networks and other terminals. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
[0158] The memory 420 can be used to store software programs and modules. The processor 480 executes various functional applications and data processing by running the software programs and modules stored in the memory 420. The memory 420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 420 may also include a memory controller to provide access to the memory 420 for the processor 480 and the input unit 430.
[0159] Input unit 430 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, input unit 430 may include a touch-sensitive surface 431 and other input devices 432. Touch-sensitive surface 431, also known as a touch display or touchpad, can collect user touch operations on or near it (such as user operations using fingers, styluses, or any suitable object or accessory on or near touch-sensitive surface 431), and drive corresponding connection devices according to a pre-set program. Optionally, touch-sensitive surface 431 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 480, and can receive and execute commands from the processor 480. In addition, various types of touch-sensitive surface 431 can be implemented using resistive, capacitive, infrared, and surface acoustic wave technologies. In addition to the touch-sensitive surface 431, the input unit 430 may also include other input devices 432. Specifically, other input devices 432 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0160] The display unit 440 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. The display unit 440 may include a display panel 441, which may optionally be configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or similar display panel 441. Further, a touch-sensitive surface 431 may cover the display panel 441. When the touch-sensitive surface 431 detects a touch operation on or near it, it transmits the information to the processor 480 to determine the type of touch event. Subsequently, the processor 480 provides corresponding visual output on the display panel 441 according to the type of touch event. The touch-sensitive surface 431 and the display panel 441 can be two independent components to implement input and output functions. However, in some embodiments, the touch-sensitive surface 431 and the display panel 441 can be integrated to achieve both input and output functions.
[0161] The terminal may also include at least one sensor 450, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 441 according to the ambient light level, and the proximity sensor can turn off the display panel 441 and / or backlight when the terminal is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that identify the terminal's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured on the terminal, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0162] Audio circuitry 460, speaker 461, and microphone 462 provide an audio interface between the user and the terminal. Audio circuitry 460 converts received audio data into electrical signals, which are then transmitted to speaker 461, where they are converted into sound signals for output. Conversely, microphone 462 converts collected sound signals into electrical signals, which are received by audio circuitry 460, converted back into audio data, and then processed by processor 480 before being transmitted via RF circuitry 410 to, for example, another terminal, or output to memory 420 for further processing. Audio circuitry 460 may also include an earphone jack to facilitate communication between a peripheral headset and the terminal.
[0163] WiFi is a short-range wireless transmission technology. The terminal, through the WiFi module 470, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 4 WiFi module 470 is shown, but it is understood that it is not an essential component of the terminal and can be omitted as needed without changing the nature of the invention.
[0164] The processor 480 is the control center of the terminal, connecting various parts of the terminal via various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the memory 420, and by calling data stored in the memory 420. Optionally, the processor 480 may include one or more processing cores; preferably, the processor 480 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user page, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 480.
[0165] The terminal also includes a power supply 490 (such as a battery) to power various components. Preferably, the power supply can be logically connected to the processor 480 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 490 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0166] This application also provides a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement any of the page element problem identification methods provided in the above method embodiments.
[0167] Optionally, in the embodiments of this application, the above-mentioned storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0168] This application also provides a computer program that, when executed by a processor, implements any of the page element problem identification methods provided in the above-described method embodiments.
[0169] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0170] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0171] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0172] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for identifying page element problems, characterized in that, The method includes: Obtain the view structure information of the page to be identified in the target application; the view structure information includes the layout information of each page element in the page to be identified; the layout information includes the font language and font text; For each page element in the page to be identified, based on the layout information of the page element, the page layout code file of the page to be identified is searched to obtain the layout code information of the page element; the layout code information is used to define the layout of the page element; the layout code information includes font attributes; When the layout information includes display text information, calculations are performed based on the layout code information and the layout information to obtain the current display text information and the target display text information of the page element. The current display text information includes the current display text width and the current display text height, and the target display text information includes the target display text width and the target display text height; including: When the layout code information includes page element width, page element height, left and right margins, and top and bottom margins, the difference between the page element width and the left and right margins is used to determine the current displayed text width; the difference between the page element height and the top and bottom margins is used to determine the current displayed text height. Alternatively, if the layout code information includes the page element width, page element height, left and right margins, top and bottom margins, icon width, and icon height, the current displayed text width is determined by subtracting the left and right margins from the page element width and then subtracting the icon width; the current displayed text height is determined by subtracting the top and bottom margins from the page element height and then subtracting the icon height. The target display text width and the target display text height are determined based on the font language, font text, and font attributes. Based on the currently displayed text information and the target displayed text information of the page element, a text problem identification is performed to obtain the text problem identification result of the page element; the text problems of the page element include incorrect text display, incorrect line breaks, and text overlap.
2. The method for identifying page element problems according to claim 1, characterized in that, The layout information includes the boundary coordinate information of the page elements on the page to be identified; After obtaining the view structure information of the target application's page to be identified, the method further includes: Based on the view structure information, determine the structural hierarchy corresponding to each page element in the page to be identified; For the page to be identified, the position overlap problem between page elements of the same structural level in the page to be identified is identified based on the boundary coordinate information of each page element in the page to be identified, so as to obtain the position overlap problem identification result of each page element in the page to be identified.
3. The method for identifying page element problems according to claim 2, characterized in that, When the page to be identified includes multiple different pages in the target application, the method further includes: The target problem identification results in the problem identification result set are deduplicated to obtain the deduplicated problem identification results; the target problem identification results represent multiple identical problem identification results of the same page element in the multiple different pages to be identified; the problem identification result set includes positional overlap problem identification results and text problem identification results.
4. The method for identifying page element problems according to claim 3, characterized in that, The method further includes: Obtain screenshots of the multiple different pages to be identified; After obtaining the deduplication problem identification result, the method further includes: The deduplication problem identification results are marked on the screenshots of the multiple different pages to be identified, and the positions of the deduplication problem identification results and the positions of the page elements corresponding to the deduplication problem identification results on the screenshots of the multiple different pages to be identified are marked one-to-one.
5. The method for identifying page element problems according to claim 1, characterized in that, The step of searching the page layout code file based on the layout information to obtain the layout code information of the page elements includes: When the layout information contains target information, the page layout code file is searched based on the target information to obtain the layout code information of the page element; When the layout information does not contain target information, the layout information of the target page element is obtained by searching the view structure text generated based on the view structure information of the page to be identified. The layout information of the target page element includes the target identifier of the target page element. Based on the target identifier, the view structure text is searched to obtain the layout code information corresponding to the target identifier. The layout code information corresponding to the target identifier is determined as the layout code information of the target page element. Based on the position and relative position information of the layout code information of the target page element in the view structure text, the page layout code file is searched to obtain the layout code information of the page element. The relative position information represents the relative position of the layout information of the target page element and the layout information of the page element in the view structure text.
6. The method for identifying page element problems according to claim 5, characterized in that, The target information includes display text information; the step of searching the page layout code file based on the target information to obtain the layout code information of the page elements includes: When the target information contains the identifier of the page element, the page layout code file is searched based on the identifier to obtain the layout code information corresponding to the identifier, and the layout code information corresponding to the identifier is determined as the layout code information of the page element. When the target information does not contain the identifier, the page layout code file is searched based on the display text information to obtain layout code information containing the display text information, and the layout code information containing the display text information is determined as the layout code information of the page element.
7. The method for identifying page element problems according to claim 1, characterized in that, The method further includes: The target application is clicked using an automated testing framework; Obtain the view structure information of the page before the click and the view structure information of the page after the click in the target application; A similarity comparison is performed based on the view structure information of the page before the click and the view structure information of the page after the click. Determine whether the result of the similarity comparison is less than a first preset similarity threshold; If so, confirm that the page after clicking is the page to be identified.
8. A page element problem identification device, characterized in that, The device includes: The view structure information acquisition module is used to acquire the view structure information of the page to be identified in the target application; the view structure information includes the layout information of each page element in the page to be identified; the layout information includes the font language and font text; The layout code information search module is used to search for the page layout code file of the page to be identified for each page element in the page to be identified, based on the layout information of the page element, to obtain the layout code information of the page element; the layout code information is used to define the layout of the page element; the layout code information includes font attributes; The calculation module is configured to, when the layout information includes display text information, calculate based on the layout code information and the layout information to obtain the current display text information and the target display text information of the page element; the current display text information includes the current display text width and the current display text height, and the target display text information includes the target display text width and the target display text height; including: When the layout code information includes page element width, page element height, left and right margins, and top and bottom margins, the difference between the page element width and the left and right margins is used to determine the current displayed text width; the difference between the page element height and the top and bottom margins is used to determine the current displayed text height. Alternatively, if the layout code information includes the page element width, page element height, left and right margins, top and bottom margins, icon width, and icon height, the current displayed text width is determined by subtracting the left and right margins from the page element width and then subtracting the icon width; the current displayed text height is determined by subtracting the top and bottom margins from the page element height and then subtracting the icon height. The target display text width and the target display text height are determined based on the font language, font text, and font attributes. The text problem identification module is used to identify display text problems based on the currently displayed text information and the target displayed text information of the page element, and to obtain the text problem identification result of the page element; the text problems of the page element include incorrect text display, incorrect line breaks, and text overlap.
9. An electronic device, characterized in that, The method includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement a page element problem identification method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement a page element problem identification method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Problem positioning method based on web front-end testing as well as related device and system
CN105760290A
Method and device for identifying front-end page design error
CN109960772A