Automatic page desensitization test method and device, equipment, storage medium and product

Through automated desensitization testing methods, element positioning and testing verification of the application to be tested after desensitization is solved, and the problem of prone to verification omissions in human resources testing in the prior art is improved, and the accuracy of desensitization testing is improved.

CN119557221APending Publication Date: 2025-03-04ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411656646.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, data desensitization tests rely on testers to manually click to view desensitization data under each page of the application, resulting in the human labor test being easily missed in verification when processing a large amount of data to be tested, resulting in low accuracy of desensitization tests.

Method used

A page automatic desensitization testing method is proposed. By obtaining the desensitized application to be tested, the elements are positioned on the pages at each level, the target positioning elements are obtained, and these elements are tested and verified to generate corresponding test reports.

Benefits of technology

By automatically performing element positioning and testing verification on the elements to be tested on each level of the page in the desensitized application, preventing untested elements from existing on individual levels of the pages in the page, improving the accuracy of the desensitization test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557221A_ABST
    Figure CN119557221A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic page desensitization testing method and device, equipment, a storage medium and a product, relates to the technical field of computers, and discloses the automatic page desensitization testing method which comprises the steps that a to-be-tested application obtained after desensitization is obtained; performing element positioning on each level page of the to-be-tested application to obtain a target positioning element, and performing test verification on the target positioning element to obtain a target verification result, the target positioning element including to-be-tested elements of each level page in the to-be-tested application; and generating a test report corresponding to the target verification result. According to the application, element positioning is automatically executed on the to-be-tested elements of the pages of all the levels in the to-be-tested application after desensitization, so that the situation that untested elements exist in the pages of all the levels in the pages of the to-be-tested application is prevented, and a tester does not need to manually click and view desensitization data under all the pages of the application, so that the accuracy of desensitization testing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to methods, devices, equipment, storage media and products for automated desensitization testing of pages. Background Art

[0002] At present, with the rapid development of the software industry, more and more companies are proposing to desensitize internal sensitive data based on data security needs, such as user names, mobile phone numbers, license plates, addresses, ID numbers, etc. Usually, companies add corresponding desensitization functions during the software development process to desensitize the data under their applications, and the testing of the desensitization function is also an indispensable part of the development process.

[0003] In the related art, data desensitization testing usually relies on testers to test and provide feedback on the desensitized data. However, this method requires testers to manually click to view the desensitized data on each page of the application. When dealing with a large amount of data to be tested, manual testing is prone to verification omissions, resulting in low accuracy of desensitization testing.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a page automated desensitization testing method, aiming to solve the technical problem of low accuracy of desensitization testing.

[0006] To achieve the above purpose, the present application proposes a method for automatic desensitization testing of pages, the method comprising:

[0007] Get the desensitized application to be tested;

[0008] Performing element positioning on each level page of the application to be tested to obtain a target positioning element, and performing test verification on the target positioning element to obtain a target verification result, wherein the target positioning element includes the elements to be tested on each level page of the application to be tested;

[0009] Generate a test report corresponding to the target verification results.

[0010] Optionally, the step of locating elements on pages of each level of the application to be tested to obtain target located elements, and performing test verification on the target located elements to obtain target verification results includes:

[0011] Get element positioning script;

[0012] Based on the element positioning script, a page click operation is performed on the application to be tested level by level to obtain page information of each level;

[0013] Performing element positioning operations on the page information of each level to obtain the elements to be tested of the pages of each level;

[0014] The elements to be tested of the pages at each level are combined into a target positioning element, and the target positioning element is tested and verified to obtain a target verification result.

[0015] Optionally, the step of performing a page click operation level by level on the application to be tested based on the element positioning script to obtain page information of each level includes:

[0016] Based on the element positioning script, a search operation for an interactive button is performed on the current level page to obtain the interactive button of the current level page, and a click operation is performed on the interactive button of the current level page to obtain the next level page information, wherein the interactive button carries a jump link to the next level page;

[0017] The step of executing the element positioning script on the next-level page, performing a search operation for interactive buttons on the current-level page to obtain the interactive buttons of the current-level page, and performing a click operation on the interactive buttons of the current-level page to obtain the next-level page information, until there are no interactive buttons on the current-level page, and obtaining the page information of each level.

[0018] Optionally, the step of performing a click operation on the interactive button of the current level page to obtain the next level page information includes:

[0019] The jump links in the interactive buttons of the current level page are saved in the preset storage variables in sequence;

[0020] Click operations are performed on the jump links in sequence from the storage variables to obtain next-level page information corresponding to each of the interactive buttons.

[0021] Optionally, the step of obtaining an element positioning script includes:

[0022] Acquire a test recording script and a terminal screen information set, wherein the test recording script includes test screen size information, initial element positioning information and element size, and the terminal screen information set includes screen size information of multiple terminal screens;

[0023] Calculating the element line break point of each terminal screen based on the element size and the screen size information;

[0024] Based on the element line break point, the initial element positioning information is adjusted to obtain the target element positioning information of each terminal screen;

[0025] Based on the target element positioning information, generating an initial positioning script for each terminal screen;

[0026] The test recording script and the initial positioning script of each terminal screen are combined to obtain an element positioning script adapted to different screen sizes.

[0027] Optionally, the step of locating elements on pages of each level of the application to be tested to obtain target located elements, and performing test verification on the target located elements to obtain target verification results includes:

[0028] Locating elements of the current level page of the application to be tested to obtain the elements to be tested of the current level page, and testing and verifying the elements to be tested to obtain the element verification result of the current level page;

[0029] Performing a search operation for an interactive button on a current level page to obtain an interactive button on the current level page, and performing a click operation on the interactive button on the current level page to display a next level page;

[0030] The steps of locating elements of the current level page of the application to be tested are performed on the next level page to obtain the elements to be tested of the current level page, and testing and verifying the elements to be tested to obtain the element verification result of the current level page, until there is no interactive button on the current level page, then merging the element verification results of all level pages to obtain the target verification result.

[0031] In addition, to achieve the above purpose, the present application also proposes a page automatic desensitization testing device, the page automatic desensitization testing device comprising:

[0032] The acquisition module is used to obtain the desensitized application to be tested;

[0033] A positioning module, used to locate elements of each level page of the application to be tested, obtain target positioning elements, and test and verify the target positioning elements to obtain target verification results, wherein the target positioning elements include the elements to be tested of each level page in the application to be tested;

[0034] A generation module is used to generate a test report corresponding to the target verification result.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a page automatic desensitization testing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the page automatic desensitization testing method described above.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the page automatic desensitization testing method described above are implemented.

[0037] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the page automatic desensitization testing method as described above.

[0038] One or more technical solutions proposed in this application have at least the following technical effects:

[0039] Compared with the data desensitization test in the related art, which usually relies on the tester to detect and feedback the desensitized data. However, this method requires the tester to manually click to view the desensitized data under each page of the application. When processing a large amount of data to be tested, the problem of verification omission is prone to occur in the manual test, resulting in the low accuracy of the desensitization test. In comparison, the present application performs element positioning on the pages of each level of the application to be tested after desensitization, obtains the target positioning element including the elements to be tested after desensitization at each level in the application to be tested, and finally tests and verifies the target positioning element after positioning, obtains the target verification result, and generates a test report of the corresponding target verification result. It is understandable that the present application automatically performs element positioning on the elements to be tested of each level of the page in the application to be tested after desensitization, so as to prevent the presence of untested elements in the individual level pages of the page of the application to be tested, and there is no need for the tester to manually click to view the desensitized data under each page of the application, so as to improve the accuracy of the desensitization test. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A schematic diagram of the process flow provided for the first embodiment of the method for automated desensitization testing of pages of this application;

[0043] Figure 2 A flow chart of the second embodiment of the method for automated desensitization testing of pages in this application;

[0044] Figure 3 A schematic diagram of a process flow provided for the third embodiment of the method for automated desensitization testing of pages of this application;

[0045] Figure 4 This is a schematic diagram of the module structure of the automated desensitization testing device of the embodiment page of the present application;

[0046] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the page automated desensitization testing method in the embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] The main solution of the embodiment of the present application is: obtain the desensitized application to be tested; locate the elements of each level page of the application to be tested to obtain the target location element, and test and verify the target location element to obtain the target verification result, wherein the target location element includes the elements to be tested of each level page of the application to be tested; generate a test report corresponding to the target verification result.

[0051] In this embodiment, the present application uses a page automatic desensitization testing device as the execution body. For the convenience of expression, it is hereinafter referred to as a "device" for specific description.

[0052] In the related technology, data desensitization testing usually relies on testers to test and provide feedback on the desensitized data. However, this method requires testers to manually click to view the desensitized data on each page of the application. When dealing with a large amount of data to be tested, manual testing is prone to verification omissions, resulting in low accuracy of desensitization testing.

[0053] The present application provides a solution to realize automated desensitization testing of desensitized applications to be tested, and improves the accuracy of the desensitization testing.

[0054] It can be seen from the above embodiments that the present application locates elements of each level page of the application to be tested after desensitization, obtains target location elements including the elements to be tested after desensitization at each level in the application to be tested, and finally tests and verifies the located target location elements to obtain target verification results, and generates a test report corresponding to the target verification results. It is understandable that the present application automatically performs element location on the elements to be tested of each level page of the application to be tested after desensitization, so as to prevent the existence of untested elements in individual level pages of the application to be tested, and there is no need for testers to manually click to view the desensitized data under each page of the application, thereby improving the accuracy of the desensitization test.

[0055] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a terminal system, etc. that can realize the above functions. The following takes the page automatic desensitization test device as an example to illustrate this embodiment and the following embodiments.

[0056] Based on this, the present application embodiment provides a page automatic desensitization testing method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the automated desensitization testing method for pages of this application.

[0057] In this embodiment, the page automatic desensitization testing method includes steps S100 to S300:

[0058] Step S100, obtaining the desensitized application to be tested;

[0059] It should be noted that in software testing, desensitization usually refers to the process of removing or replacing sensitive data from the test environment to ensure the security and compliance of the test data. Specifically, desensitization ensures that the test data does not leak any sensitive information, such as personal identity information, financial data, etc. The desensitization process specifically replaces the actual sensitive data with simulated data or pseudo data, which is similar to the real data in function and format, but does not contain any real information.

[0060] It is understandable that the desensitized application to be tested refers to the application that is ready for testing after the desensitization process, that is, the sensitive data in the desensitized application to be tested has been desensitized. The desensitization test of this application specifically tests whether the sensitive data after the desensitization process is desensitized according to the preset desensitization rules.

[0061] In a specific implementation, the device obtains the desensitized application to be tested by receiving the desensitized application to be tested uploaded by the tester; or the device extracts the corresponding desensitized application to be tested according to the set desensitized application to be tested file address, which is not specifically limited here.

[0062] Step S200, locating elements of each level page of the application to be tested to obtain target locating elements, and testing and verifying the target locating elements to obtain target verification results, wherein the target locating elements include the elements to be tested of each level page of the application to be tested;

[0063] In this embodiment, the desensitization test of the present application is specifically for testing the elements to be tested of each level of the page of the application to be tested, wherein the elements to be tested refer to the page elements after desensitization. Specifically, the device locates the elements of each level of the page of the application to be tested after desensitization, and obtains the target positioning elements including the desensitized elements to be tested at each level in the application to be tested, and finally tests and verifies the located target positioning elements to obtain the target verification results, wherein the target positioning elements include the elements to be tested of each level of the page of the application to be tested.

[0064] It is understandable that the present application automatically performs element positioning on the elements to be tested on each level page in the desensitized application to be tested, so as to prevent the existence of untested elements in individual level pages of the application to be tested, and there is no need for testers to manually click to view the desensitized data under each page of the application, thereby improving the accuracy of the desensitization test.

[0065] It should be noted that when performing web page automation testing or web page element operations, locating page elements is a key step. Element locating methods include:

[0066] 1. ID positioning: Use the ID attribute of the element for positioning;

[0067] 2. XPath positioning: XPath is a language used to select nodes in XML documents, and is also applicable to HTML documents;

[0068] 3. CSS selector positioning: Use CSS selectors to locate elements, similar to how elements are selected in CSS;

[0069] 4. Link text positioning: locate link elements by the full text or partial text of the link;

[0070] 5. Partial link text positioning: positioning link elements by part of the link text;

[0071] 6. Name attribute positioning: Use the name attribute of the element for positioning;

[0072] 7. Tag name positioning: positioning by the tag name of the element;

[0073] 8. Class name positioning: Use the class name of the element for positioning;

[0074] 9. Attribute positioning: positioning by element attributes and attribute values;

[0075] 10. Text content positioning: positioning by the text content of the element;

[0076] 11. Relative positioning: positioning by the relative position of the element;

[0077] 12. Coordinate positioning: Positioning by the element’s position coordinates on the page.

[0078] It is understandable that each of the above element positioning methods has its applicable scenarios. Selecting a suitable positioning method can improve the stability and accuracy of the test. The device may need to select the most suitable positioning method according to the specific structure of the page and the characteristics of the elements.

[0079] In a specific implementation, the test verification method performed by the device on the target positioning element includes but is not limited to: 1. Assertion verification, specifically using the assertion method in the automated testing framework, such as the assert statement, to verify whether the text or attribute of the element meets the expected desensitization result; 2. Regular expression matching, specifically using regular expressions to verify whether the text of the element meets the desensitization rules, such as some characters are replaced with asterisks; 3. Attribute verification, specifically checking whether the attribute value of the element meets the desensitization rules, such as whether the data in the data attribute is desensitized; 4. UI automated testing, specifically using the UI automated testing tool to write a test script, simulate user operations, and verify the performance of desensitized information in different scenarios. Through the above methods, the device can comprehensively verify whether the application meets the expected desensitization rules and security requirements when processing sensitive information. For example, the mobile phone number only displays the first three and last four, the two-character name displays the surname, the name of more than three characters displays the first and last one, the ID card displays the first three and last four, the VIN code displays the first six and last four, the email displays the first and all after @, and the bank card displays the first six and last four, etc., and can also be set independently according to the requirements of the enterprise or the requirements of the security department.

[0080] Furthermore, the present application is based on the UI automation framework setting, and can perform multiple checks on an element, such as the desensitization check of the name. If the name returned by the page is two characters, the second character is desensitized, and an if judgment is added. If there are more than 2 characters, it is asserted that the first and last characters are not *, that is, the middle characters are desensitized characters.

[0081] In a specific implementation, the device locates elements on each level page of the application to be tested, obtains a target location element, and performs a test verification on the target location element to obtain a target verification result, including:

[0082] Obtain an element locating script; based on the element locating script, perform a page click operation on the application to be tested step by step to obtain page information of each level; perform an element locating operation on the page information of each level to obtain the elements to be tested of the pages of each level; merge the elements to be tested of the pages of each level into a target locating element, and perform a test and verification on the target locating element to obtain a target verification result.

[0083] It should be noted that the element positioning script is a test script used by the device for element positioning, specifically a series of instructions or codes for page automated desensitization testing, which can be executed by the test tool to verify whether the desensitization function of the software meets expectations, that is, the main purpose of the test script is to ensure that the software can work properly during the development process and after release, and to promptly discover and fix defects. Further, the element positioning script can be a recording script or a test case, wherein the recording script is suitable for scenarios where it is necessary to simulate the interaction between the user and the application (page desensitization test scenario), so the present application is preferably a recording script, wherein the recording script is generated by recording the user's operating behavior.

[0084] In a specific implementation, since the application to be tested usually includes multiple levels of pages, in order to prevent omissions in the test of elements to be tested, the device performs a level-by-level click operation on the page of the application to be tested based on the element positioning script to obtain page information of each level, wherein the element positioning script is preferably a recording script, and the device performs a level-by-level click operation on the corresponding page of the application to be tested according to the element positioning script to obtain page information of each level, wherein the page information of each level includes text information, image information, layout information, buttons, links and other information under each level page of the application to be tested.

[0085] In this embodiment, the device locates the elements to be tested on the pages of each level, and then tests and verifies all the located target positioning elements to obtain a target verification result. Specifically, the device performs an element positioning operation on the page information of each level to obtain the elements to be tested on the pages of each level. The device then merges the elements to be tested on the pages of each level into target positioning elements, and tests and verifies the target positioning elements to obtain a target verification result, wherein the target verification result includes the number of failed test cases, the number of successful test cases, and a specific test case execution log.

[0086] In a specific implementation, the device performs page click operations on the application to be tested based on the element positioning script, and obtains the steps of page information of each level, including:

[0087] Based on the element positioning script, a search operation for interactive buttons is performed on the current level page to obtain the interactive buttons of the current level page, and a click operation is performed on the interactive buttons of the current level page to obtain the next level page information, wherein the interactive button carries a jump link to the next level page; the steps of performing the search operation for interactive buttons based on the element positioning script on the current level page to obtain the interactive buttons of the current level page, and a click operation is performed on the interactive buttons of the current level page to obtain the next level page information, until there is no interactive button on the current level page, and the page information of each level is obtained.

[0088] It should be noted that the interactive button is a user interface element. Certain operations or events can be triggered by clicking the interactive button on the page. In this embodiment, the interactive button is used to trigger the event of entering / or displaying the next level page (or pop-up box). The interactive button usually includes a text label or an icon, and in this embodiment, the interactive button carries a jump link to the next level page.

[0089] In a specific implementation, after the device performs a search operation for interactive buttons on the current level page, if there are interactive buttons on the current level page, a click operation is performed on the interactive button of the current level page to enter / or display the next level page, thereby obtaining the next level page information. Further, the steps of performing a search operation for interactive buttons on the current level page based on the element positioning script, obtaining the interactive buttons of the current level page, and clicking the interactive buttons of the current level page to obtain the next level page information are repeated on the next level page until there are no interactive buttons on the current level page, thereby obtaining the page information of each level.

[0090] In a specific implementation, the device performs a click operation on the interactive button of the current level page to obtain the next level page information, including:

[0091] The device saves the jump links in the interactive buttons of the current level page into preset storage variables in sequence; performs click operations on the jump links in sequence from the storage variables to obtain the next level page information corresponding to each of the interactive buttons.

[0092] It is understandable that a hierarchical page usually includes multiple interactive buttons. After the device searches out all the interactive buttons of the current hierarchical page, it saves the jump links in the interactive buttons in sequence to preset storage variables, wherein the storage variables include but are not limited to lists and tuples. Then the device performs click operations on the jump links in sequence from the storage variables to obtain the next level page information corresponding to each of the interactive buttons.

[0093] In a specific implementation, the device performs click operations on the jump links from the storage variables in sequence to prevent individual hierarchical pages in the page of the application to be tested from not being clicked or searched, thereby preventing the omission of the elements to be tested, thereby improving the accuracy of the desensitization test.

[0094] In a specific implementation, the device performs an element positioning operation on the page information of each level to obtain the elements to be tested of the pages of each level, including:

[0095] Obtain a positioning method library, wherein the positioning method library includes an element positioning method, an element class name positioning method, a path positioning method, and a coordinate positioning method; for different levels of page information, select a corresponding positioning method from the positioning method library to perform an element positioning operation to obtain elements to be tested at each level; store the elements to be tested at each level in sequence to obtain elements to be tested.

[0096] In a specific implementation, the device selects a corresponding positioning method from the positioning method library to perform an element positioning operation for different levels of page information, obtains elements to be tested at each level, and stores the elements to be tested at each level in sequence to obtain elements to be tested. That is, the present application uses different element positioning methods for pages of different levels to prevent the presence of untested elements in individual level pages of the application to be tested, thereby improving the accuracy of the desensitization test.

[0097] In a specific implementation, the device performs a test on the element to be tested to obtain a test result, including:

[0098] In response to the configuration information input by the user, a verification configuration of the application to be tested is formed, wherein the verification configuration includes multiple verification methods; based on the verification configuration, test verification of multiple verification methods is performed on each element in the elements to be tested to obtain a verification result.

[0099] In a specific implementation, the device performs multiple checks on an element, such as a desensitized check on a name. If the name returned by the page is two characters, the second character is desensitized, and an if judgment is added. If there are more than two characters, it is asserted that the first and last characters are not *, that is, the middle characters are desensitized characters. That is, the present application improves the accuracy of the test by testing each element to be tested in multiple verification methods.

[0100] Step S300, generating a test report corresponding to the target verification result.

[0101] In the specific implementation, after obtaining the target verification result, the device will generate a test report corresponding to the target verification result. Under the report module, you can set the method to send the report, such as email, etc. Furthermore, the test report contains the total number of test cases, the number of successes, the number of failures, and the specific case execution log. The cause of the error can be determined based on the log to facilitate the modification and maintenance of the UI desensitized data test case.

[0102] It is understandable that the automation group of this device can set multiple triggering methods such as automatic self-execution, scheduled execution, service release trigger execution, etc., so as to ensure the desensitization of sensitive data, reduce the risk of sensitive data leakage, and protect the privacy of enterprises or users.

[0103] Compared with the data desensitization test in the related art, which usually relies on the tester to detect and feedback the desensitized data. However, this method requires the tester to manually click to view the desensitized data under each page of the application. When processing a large amount of data to be tested, the problem of verification omission is prone to occur in the manual test, resulting in the low accuracy of the desensitization test. In comparison, the present application performs element positioning on the pages of each level of the application to be tested after desensitization, obtains the target positioning element including the elements to be tested after desensitization at each level in the application to be tested, and finally tests and verifies the target positioning element after positioning, obtains the target verification result, and generates a test report of the corresponding target verification result. It is understandable that the present application automatically performs element positioning on the elements to be tested of each level of the page in the application to be tested after desensitization, so as to prevent the presence of untested elements in the individual level pages of the page of the application to be tested, and there is no need for the tester to manually click to view the desensitized data under each page of the application, so as to improve the accuracy of the desensitization test.

[0104] Based on the above first embodiment, the present application also proposes another embodiment, referring to Figure 2 , the page automated desensitization testing method comprises:

[0105] In a specific implementation, the device performs a step-by-step click operation on each level page in the application to be tested based on the hierarchical query script to obtain the step of page information of each level, and further includes:

[0106] Step A100, locating elements of the current level page of the application to be tested, obtaining the elements to be tested of the current level page, and testing and verifying the elements to be tested, obtaining the element verification result of the current level page;

[0107] Step A200, performing a search operation for an interactive button on the current level page to obtain an interactive button on the current level page, and performing a click operation on the interactive button on the current level page to display a next level page;

[0108] Step A300, executes the step of locating elements of the current level page of the application to be tested on the next level page, obtaining the elements to be tested of the current level page, and testing and verifying the elements to be tested to obtain the element verification result of the current level page, until there is no interactive button on the current level page, then merges the element verification results of all level pages to obtain the target verification result.

[0109] In the specific implementation, this method is different from the first embodiment in which all the target positioning elements are tested and verified after positioning. In this embodiment, the device performs a test and verification on each element to be tested on each level page after positioning, and obtains the element verification result of the current level page. When the device obtains the element verification result of the current level page, it performs a search operation for the interactive button on the current level page to obtain the interactive button of the current level page, and performs a click operation on the interactive button of the current level page to display the next level page. After the device enters the next level page, it performs the steps of locating the elements of the current level page of the application to be tested, obtaining the elements to be tested on the current level page, and testing and verifying the elements to be tested to obtain the element verification result of the current level page, until there is no interactive button on the current level page, then the element verification results of all level pages are merged to obtain the target verification result.

[0110] For example, the application to be tested includes the A1 level and the A2 level, wherein the A1 level is the upper level of the A2 level. In this embodiment, the elements of the A1 level are first located to obtain the elements X1 and X2 under the A1 level, and then X1 and X2 are tested and verified to obtain the element verification results Y1 and Y2 of the A1 level. Then, the A2 level is entered through the interactive button of the A1 level, and the elements of the A2 level are located to obtain the elements X3 and X4 under the A2 level. Then, X3 and X4 are tested and verified to obtain the element verification results Y3 and Y4 of the A2 level. In the first embodiment, after all elements X1-X4 are located, the test verification is uniformly performed to obtain the corresponding element verification results Y1-Y4.

[0111] In the specific implementation, the present application automatically performs element positioning on the elements to be tested on each level page in the desensitized application to be tested, so as to prevent the existence of untested elements in individual level pages of the application to be tested, and there is no need for testers to manually click to view the desensitized data under each page of the application, thereby improving the accuracy of the desensitization test.

[0112] Based on the above first and second embodiments, the present application also proposes another embodiment, referring to Figure 3 , the page automated desensitization testing method comprises:

[0113] In a specific implementation, the step of the device obtaining the element positioning script includes:

[0114] Step B100, the device obtains a test recording script and a terminal screen information set, wherein the test recording script includes test screen size information, initial element positioning information and element size, and the terminal screen information set includes screen size information of multiple terminal screens;

[0115] It should be noted that the element positioning script is preferably a recording script, wherein the recording script is generated by recording the user's operating behavior, that is, a test recording script, and the test recording script includes test screen size information, initial element positioning information and element size, wherein the test screen size information refers to the screen size information of the user's test operation under recording, for example, the application is displayed on an 18-inch screen, and the tester performs test operations on it and performs recording; if element positioning is involved in the user's operating behavior, the initial element positioning information refers to the element positioning information involved in the recorded user test operation process; the element size refers to the character size involved in the element.

[0116] It is understandable that the test recording script proposed in this application is only suitable for screens with the same test screen size as the test recording script. If the screen size actually used for testing is inconsistent with the test screen size of the test recording script, it may cause inconsistent element layout. If the element layout is inconsistent, the position of the elements to be tested will also be different. If the test is still performed according to the test recording script, it will result in the inability to accurately locate the corresponding elements on the page actually tested. Therefore, the goal of this application is to enable the element positioning operation of its test to adapt to different screen sizes based on the test recording script.

[0117] Furthermore, the device obtains a terminal screen information set, wherein the terminal screen information set includes screen size information of multiple terminal screens, wherein the screen size information does not include test screen size information, and includes other screen sizes.

[0118] Step B200, calculating the element line break point of each terminal screen based on the element size and the screen size information;

[0119] In a specific implementation, the element line break point refers to the breakpoint of the element in the page layout, specifically, the element (picture or text) changes from one line to the next line for display, and this breakpoint is the line break point. Specifically, the device calculates the element line break point of each terminal screen based on the element size and the screen size information, specifically, the number of elements that can be accommodated in each line of each terminal screen is calculated based on the element size and the screen size information of each terminal screen. In this process, the text box size of the UI design can also be considered, and the position of the last element in each line is used as the element line break point.

[0120] Step B300, adjusting the initial element positioning information based on the element line break point to obtain the target element positioning information of each terminal screen;

[0121] In a specific implementation, after determining the element line break point of each terminal screen, the device adjusts the initial element positioning information and the element layout thereof, and then determines the target element positioning information of each terminal screen, wherein the target element positioning information is generated after the layout of the initial element positioning information is adjusted for different terminal screen sizes. For example, the coordinates of element X in the initial element positioning information of the recorded user test operation scenario are (X1, Y1), which are the coordinates under the test screen size (the test screen size is 11 inches). To adapt to the 13-inch terminal screen, the device adaptively adjusts the initial element positioning information (X1, Y1) of element X, and obtains the coordinates of the element X under the element layout of the 13-inch terminal screen as (X2, Y2), that is, the target element positioning information of element X on the 13-inch terminal screen is (X2, Y2).

[0122] Step B400, generating an initial positioning script for each terminal screen based on the target element positioning information;

[0123] In a specific implementation, after determining the target element positioning information of each terminal screen, the device generates an initial positioning script for each terminal screen. That is, the initial positioning script does not require the tester to change a screen for repeated testing, but instead reversely generates the corresponding positioning script through deductive simulation.

[0124] Step B500: merging the test recording script and the initial positioning script of each terminal screen to obtain an element positioning script adapted to different screen sizes.

[0125] In a specific implementation, the device merges the test recording script and the initial positioning script of each terminal screen to obtain an element positioning script adapted to different screen sizes, thereby solving the problem of page elements that cannot be accurately positioned when the screen size (size) is inconsistent with the test screen, thereby improving the efficiency and accuracy of the desensitization test.

[0126] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the automated desensitization testing method for pages of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0127] This application also provides a page automatic desensitization testing device, please refer to Figure 4 , the page automatic desensitization testing device comprises:

[0128] An acquisition module 10 is used to acquire the desensitized application to be tested;

[0129] The positioning module 20 is used to locate elements of each level page of the application to be tested, obtain target positioning elements, and test and verify the target positioning elements to obtain target verification results, wherein the target positioning elements include the elements to be tested of each level page in the application to be tested;

[0130] The generating module 30 is used to generate a test report corresponding to the target verification result.

[0131] Optionally, the positioning module 20 includes:

[0132] Script acquisition module, used to obtain element positioning scripts;

[0133] A click module is used to perform page click operations on the application to be tested level by level based on the element positioning script to obtain page information of each level;

[0134] An element locating module is used to perform an element locating operation on the page information of each level to obtain the elements to be tested of the page of each level;

[0135] The verification module is used to merge the elements to be tested of the pages of each level into a target positioning element, and perform a test verification on the target positioning element to obtain a target verification result.

[0136] Optionally, the click module includes:

[0137] An interactive module, used to perform a search operation for an interactive button on the current level page based on the element positioning script, obtain the interactive button of the current level page, and perform a click operation on the interactive button of the current level page to obtain the next level page information, wherein the interactive button carries a jump link to the next level page;

[0138] An iterative execution module is used to execute the element positioning script on the next-level page, perform a search operation for interactive buttons on the current-level page, obtain the interactive buttons of the current-level page, and perform a click operation on the interactive buttons of the current-level page to obtain the next-level page information, until there is no interactive button on the current-level page, and obtain the page information of each level.

[0139] Optionally, the interaction module includes:

[0140] A saving module, used to save the jump links in the interactive buttons of the current level page into preset storage variables in sequence;

[0141] The sequential clicking module is used to sequentially click the jump links from the storage variables to obtain the next level page information corresponding to each of the interactive buttons.

[0142] Optionally, the script acquisition module includes:

[0143] An information acquisition module, used to acquire a test recording script and a terminal screen information set, wherein the test recording script includes test screen size information, initial element positioning information and element size, and the terminal screen information set includes screen size information of multiple terminal screens;

[0144] A line break point calculation module, used to calculate the element line break point of each terminal screen based on the element size and the screen size information;

[0145] An adjustment module, configured to adjust the initial element positioning information based on the element line break point to obtain target element positioning information of each terminal screen;

[0146] A positioning script generation module, used to generate an initial positioning script for each terminal screen based on the target element positioning information;

[0147] The merging module is used to merge the test recording script and the initial positioning script of each terminal screen to obtain an element positioning script adapted to different screen sizes.

[0148] The page automatic desensitization test device provided by the present application adopts the page automatic desensitization test method in the above embodiment, which can solve the technical problems of page automatic desensitization test. Compared with the prior art, the beneficial effects of the page automatic desensitization test device provided by the present application are the same as the beneficial effects of the page automatic desensitization test method provided by the above embodiment, and the other technical features in the page automatic desensitization test device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0149] The present application provides a page automated desensitization testing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the page automated desensitization testing method in the above-mentioned embodiment 1.

[0150] Reference below Figure 5, which shows a schematic diagram of the structure of a page automatic desensitization test device suitable for implementing the embodiment of the present application. The page automatic desensitization test device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The page automated desensitization testing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0151] like Figure 5 As shown, the page automated desensitization test device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the page automated desensitization test device are also stored in RAM1004. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the page automated desensitization test device to communicate wirelessly or wired with other devices to exchange data. Although the page automated desensitization test device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0152] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0153] The page automated desensitization test device provided by the present application adopts the page automated desensitization test method in the above embodiment, which can solve the technical problems of page automated desensitization test. Compared with the prior art, the beneficial effects of the page automated desensitization test device provided by the present application are the same as the beneficial effects of the page automated desensitization test method provided by the above embodiment, and the other technical features in the page automated desensitization test device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0154] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0155] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0156] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the page automated desensitization testing method in the above-mentioned embodiment.

[0157] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0158] The above-mentioned computer-readable storage medium may be included in the page automatic desensitization testing device; or it may exist independently without being assembled into the page automatic desensitization testing device.

[0159] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the page automated desensitization testing device, the page automated desensitization testing device performs: page automated desensitization testing.

[0160] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0161] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0162] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0163] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned page automated desensitization testing method, and can solve the technical problems of page automated desensitization testing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the page automated desensitization testing method provided in the above-mentioned embodiment, and will not be elaborated here.

[0164] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned page automatic desensitization testing method.

[0165] The computer program product provided by this application can solve the technical problem of page automated desensitization testing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the page automated desensitization testing method provided by the above embodiment, which will not be repeated here.

[0166] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A page automated desensitization testing method, characterized in that: The method for automatic desensitization testing of a page includes: Get the desensitized application to be tested; Performing element positioning on each level page of the application to be tested to obtain a target positioning element, and performing test verification on the target positioning element to obtain a target verification result, wherein the target positioning element includes the elements to be tested on each level page of the application to be tested; Generate a test report corresponding to the target verification results.

2. The page automated desensitization testing method according to claim 1, characterized in that: The step of locating elements of each level page of the application to be tested to obtain target locating elements, and testing and verifying the target locating elements to obtain target verification results includes: Get element positioning script; Based on the element positioning script, a page click operation is performed on the application to be tested level by level to obtain page information of each level; Performing element positioning operations on the page information of each level to obtain the elements to be tested of the pages of each level; The elements to be tested of the pages at each level are combined into a target positioning element, and the target positioning element is tested and verified to obtain a target verification result.

3. The page automated desensitization testing method according to claim 2, characterized in that: The step of performing page click operations on the application to be tested level by level based on the element positioning script to obtain page information of each level includes: Based on the element positioning script, a search operation for an interactive button is performed on the current level page to obtain the interactive button of the current level page, and a click operation is performed on the interactive button of the current level page to obtain the next level page information, wherein the interactive button carries a jump link to the next level page; The step of executing the element positioning script on the next-level page, performing a search operation for interactive buttons on the current-level page to obtain the interactive buttons of the current-level page, and performing a click operation on the interactive buttons of the current-level page to obtain the next-level page information, until there are no interactive buttons on the current-level page, and obtaining the page information of each level.

4. The page automated desensitization testing method according to claim 3, characterized in that: The step of performing a click operation on the interactive button of the current level page to obtain the next level page information includes: The jump links in the interactive buttons of the current level page are saved in the preset storage variables in sequence; Click operations are performed on the jump links in sequence from the storage variables to obtain next-level page information corresponding to each of the interactive buttons.

5. The page automated desensitization testing method according to claim 2, characterized in that: The step of obtaining the element positioning script includes: Acquire a test recording script and a terminal screen information set, wherein the test recording script includes test screen size information, initial element positioning information and element size, and the terminal screen information set includes screen size information of multiple terminal screens; Calculating the element line break point of each terminal screen based on the element size and the screen size information; Based on the element line break point, the initial element positioning information is adjusted to obtain the target element positioning information of each terminal screen; Based on the target element positioning information, generating an initial positioning script for each terminal screen; The test recording script and the initial positioning script of each terminal screen are combined to obtain an element positioning script adapted to different screen sizes.

6. The page automated desensitization testing method according to claim 1, characterized in that: The step of locating elements of each level page of the application to be tested to obtain target locating elements, and testing and verifying the target locating elements to obtain target verification results includes: Locating elements of the current level page of the application to be tested to obtain the elements to be tested of the current level page, and testing and verifying the elements to be tested to obtain the element verification result of the current level page; Performing a search operation for an interactive button on a current level page to obtain an interactive button on the current level page, and performing a click operation on the interactive button on the current level page to display a next level page; The steps of locating elements of the current level page of the application to be tested are performed on the next level page to obtain the elements to be tested of the current level page, and testing and verifying the elements to be tested to obtain the element verification result of the current level page, until there is no interactive button on the current level page, then merging the element verification results of all level pages to obtain the target verification result.

7. A page automatic desensitization testing device, characterized in that: The device comprises: The acquisition module is used to obtain the desensitized application to be tested; A positioning module, used to locate elements of each level page of the application to be tested, obtain target positioning elements, and test and verify the target positioning elements to obtain target verification results, wherein the target positioning elements include the elements to be tested of each level page in the application to be tested; A generation module is used to generate a test report corresponding to the target verification result.

8. A page automatic desensitization testing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the page automated desensitization testing method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the page automatic desensitization testing method as described in any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the page automated desensitization testing method as described in any one of claims 1 to 6 are implemented.