Automatic page testing method and device, equipment, storage medium and product

By obtaining login user permissions and dynamic click operations based on control positioning identifiers, page testing is automatically implemented, solving the problem that manual testing cannot achieve comprehensiveness in the existing technology, ensuring the integrity and accuracy of page testing.

CN119149394APending Publication Date: 2024-12-17CHINA MERCHANTS BANK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411043557.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the prior art, page testing of websites or applications relies on manual testing by experienced testers. As the data content increases, it is easy to lead to missed tests, and comprehensive page testing cannot be achieved, which poses a risk of production defects.

Method used

By obtaining login user permissions, determining the menu list, positioning the identifier based on the preset control, performing dynamic click operations, realizing test traversal of first-level menus and second-level menus, automating the page test after users with different permissions to log in, and generating corresponding traversal Test strategy, dynamically click the operation to achieve the target test results.

Benefits of technology

There is no need to rely on experienced testers to automate comprehensive page testing to ensure the integrity of page testing after users with different permissions log in, and reduce the risk of test omissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149394A_ABST
    Figure CN119149394A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic page testing method and device, equipment, a storage medium and a product, and relates to the technical field of software testing, and the automatic page testing method comprises the steps that login user permission is obtained, a menu list is determined based on the login user permission, the menu list comprises a first-level menu and a second-level menu, and the first-level menu and the second-level menu are stored in the first-level menu; the second-level menu is a one-level or multi-level expansion menu under the first-level menu, and the first-level menu and the second-level menu comprise pages to be tested; and based on a preset control positioning identifier, executing a dynamic click operation on the to-be-tested page to obtain a target test result of the to-be-tested page so as to realize test traversal of the first-level menu and the second-level menu. According to the page testing method and device, page testing after login of users with different permissions is automatically achieved, manual testing does not need to be conducted by experienced testers, and therefore comprehensive page testing is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to page automation testing methods, devices, equipment, storage media and products. Background Art

[0002] At present, with the development of computer technology, the development, testing and maintenance of application APPs involve all walks of life. For example, financial enterprises need to develop bank websites or application user interfaces to run related businesses normally and meet user needs. To ensure the operation of the above functions, page testing of websites or applications is an essential link.

[0003] In the related art, page testing of websites or applications usually relies on manual testing by experienced testers. However, as the data content of page testing continues to increase, manual testing methods are prone to test omissions in the face of large amounts of data content, which in turn leads to the risk of corresponding production defects, that is, this method cannot achieve comprehensive page 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 automation testing method, aiming to solve the technical problem that comprehensive page testing cannot be achieved.

[0006] To achieve the above purpose, the present application proposes a page automation testing method, the page automation testing method comprising:

[0007] Obtaining the login user's authority, and determining a menu list based on the login user's authority, wherein the menu list includes a primary menu and a secondary menu, the secondary menu is a one-level or multi-level extended menu under the primary menu, and the primary menu and the secondary menu include a page to be tested;

[0008] Based on the preset control location identifier, a dynamic click operation is performed on the page to be tested to obtain a target test result of the page to be tested, so as to implement test traversal of the primary menu and the secondary menu.

[0009] Optionally, the step of obtaining the test result of the page to be tested by dynamically performing a dynamic click operation on the page to be tested based on a preset control location identifier includes:

[0010] Capturing path information of a preset control location identifier, and based on the path information, performing a dynamic click operation on the page to be tested of the first-level menu through the control location identifier to obtain first loading data, wherein the first loading data includes at least one second-level menu identifier;

[0011] Performing a text test on the first loaded data to obtain a first test result, and performing a dynamic click operation on the secondary menu logo to display a page to be tested of the secondary menu;

[0012] Perform a dynamic click operation on the page to be tested of the secondary menu to obtain second loading data, perform a text test on the second loading data to obtain a second test result, and determine a target test result of the page to be tested based on the first test result and the second test result.

[0013] Optionally, the step of obtaining the test result of the page to be tested by dynamically performing a dynamic click operation on the page to be tested based on a preset control location identifier includes:

[0014] Get the menu inspection data table;

[0015] Determining the frame type information of the page to be tested based on the menu inspection data table;

[0016] Generate a traversal test strategy corresponding to the framework type information;

[0017] Based on the preset control location identifier, the test result of the page to be tested is obtained by dynamically executing the dynamic click operation corresponding to the traversal test strategy on the page to be tested.

[0018] Optionally, the step of determining the frame type information of the page to be tested based on the menu inspection data table includes:

[0019] Extracting the relevant information about the page to be clicked and the frame attribute information in the menu inspection data table, wherein the frame attribute information includes new frame attributes and old frame attributes;

[0020] Based on the relevant information, determining state attribute information of the page to be tested, wherein the state attribute information includes dynamic frame attributes and static frame attributes;

[0021] Based on the frame attribute information and the state attribute information, frame type information of the page to be tested is composed.

[0022] Optionally, the step of generating a traversal test strategy corresponding to the framework type information includes:

[0023] If the frame type information is a static frame attribute and a new frame attribute, a first traversal test strategy is generated, wherein the first traversal test strategy includes determining a text attribute of a control to be clicked, and based on the text attribute, dynamically clicking the control to be clicked on the page to be tested to achieve text loading and traversal;

[0024] If the frame type information is a static frame attribute and an old frame attribute, a second traversal test strategy is generated, wherein the second traversal test strategy includes dynamically clicking a control to be clicked on the page to be tested to achieve loading and traversal of text;

[0025] If the frame type information includes a dynamic frame attribute, a third traversal test strategy is generated, wherein the third traversal test strategy includes dynamically clicking text on the page to be tested to implement traversal of the text.

[0026] Optionally, the step of obtaining the logged-in user authority and determining the menu list based on the logged-in user authority includes:

[0027] After the user logs in to the page testing platform, the user information of the user is obtained;

[0028] Extracting a user code from the user information, and determining the role information of the user based on the user code;

[0029] Determine the menu permissions corresponding to each of the role information, obtain the login user permissions, call the API interface, traverse the menu permissions, and summarize to obtain a menu list.

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

[0031] An acquisition module, used to acquire the login user authority, and determine a menu list based on the login user authority, wherein the menu list includes a primary menu and a secondary menu, the secondary menu is a one-level or multi-level extended menu under the primary menu, and the primary menu and the secondary menu include a page to be tested;

[0032] The test module is used to obtain the target test result of the page to be tested by performing a dynamic click operation on the page to be tested based on a preset control positioning identifier, so as to realize the test traversal of the first-level menu and the second-level menu.

[0033] In addition, to achieve the above objectives, the present application also proposes a page automation testing device, which includes: 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 automation testing method described above.

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

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the page automatic testing method described above are implemented.

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

[0037] Compared with the related art, page testing of websites or applications usually relies on manual testing by experienced testers. However, as the data content of page testing continues to increase, the manual testing method is prone to test omissions in the face of a large amount of data content, and then the risk of corresponding production defects occurs, that is, this method cannot achieve comprehensive page testing. In comparison, this application determines a menu list including a primary menu and a secondary menu according to different login user permissions, and based on a preset control positioning identifier, obtains the target test result of the page to be tested by performing a dynamic click operation on the page to be tested, and automatically implements page testing after users with different permissions log in, without relying on experienced testers to perform manual testing, thereby achieving comprehensive page testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] 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.

[0039] 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.

[0040] Figure 1 A flowchart of the first embodiment of the page automation testing method provided in this application;

[0041] Figure 2This is a schematic diagram of the automated hardware device structure of the automated testing method for this application page;

[0042] Figure 3 This is the timing diagram of a single menu test for the page automation test method of this application;

[0043] Figure 4 This is a flow chart of the interface automation test of the page automation test method of this application;

[0044] Figure 5 A flowchart of the second embodiment of the page automation testing method of this application is provided;

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

[0046] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the page automation 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: obtaining the login user permissions, and based on the login user permissions, determining a menu list, wherein the menu list includes a primary menu and a secondary menu, the secondary menu is an extended menu of one or more levels under the primary menu, and the primary menu and the secondary menu include a page to be tested; based on a preset control positioning identifier, by performing a dynamic click operation on the page to be tested, a target test result of the page to be tested is obtained to achieve test traversal of the primary menu and the secondary menu.

[0051] In this embodiment, for the convenience of description, the following description is made by taking the page automatic testing device as the execution subject.

[0052] In the related art, page testing of websites or applications usually relies on manual testing by experienced testers. However, as the data content of page testing continues to increase, manual testing methods are prone to test omissions in the face of large amounts of data content, which in turn leads to the risk of corresponding production defects, that is, this method cannot achieve comprehensive page testing.

[0053] This application provides a solution to automatically implement page testing after users with different permissions log in, thereby achieving comprehensive page testing.

[0054] It can be seen from the above embodiments that the present application determines a menu list including a primary menu and a secondary menu according to different login user permissions, and based on a preset control positioning identifier, obtains a target test result of the page to be tested by performing a dynamic click operation on the page to be tested, thereby automatically implementing page testing after users with different permissions log in, without relying on experienced testers to perform manual testing, thereby achieving comprehensive page testing.

[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 capable of realizing the above functions, a terminal system, etc. The following takes the bastion host as an example to illustrate this embodiment and the following embodiments.

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

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

[0058] Step S100, obtaining the login user authority, and determining a menu list based on the login user authority, wherein the menu list includes a primary menu and a secondary menu, the secondary menu is a one-level or multi-level extended menu under the primary menu, and the primary menu and the secondary menu include a page to be tested;

[0059] In the specific implementation, the functional modules involved in the implementation scheme of this application and the structural diagram of the hardware devices to be supported are referred to in Figure 2 The automation equipment includes: PC, on which automation scripts are written by calling interfaces, operating Web elements, and accessing databases; server, which includes databases, Web servers, etc., and provides data storage, data processing and other services for PC clients, so that users can access various applications on the network. Communication bus, which is responsible for transmitting data between various components of the computer system; router, which can realize mutual communication between different networks, ensure the correct transmission of data, and improve the security of the network.

[0060] It should be noted that the login user permissions refer to the page viewing permissions that different users have after logging into the system platform. The menu list refers to a series of options provided to users for selection in a web page or application. The menu list includes a primary menu and a secondary menu. The secondary menu is an extended menu of one or more levels under the primary menu. The primary menu and the secondary menu include the page to be tested.

[0061] In the specific implementation, the menu list can be a navigation link, function button, setting item, etc. It is understandable that when conducting page testing, testers need to check the following aspects of the menu list: 1. Functionality: whether all menu items work as expected and whether the links jump correctly; 2. Accessibility: whether the menu is easily accessible and whether it supports keyboard operation and screen reader; 3. Responsiveness: whether the menu displays and works normally under different screen sizes and resolutions; 4. Consistency: whether the menu style and behavior are consistent in different pages and components; 5. Performance: whether the menu loads and interacts smoothly, whether there is delay or jamming; 6. Security: whether the menu items handle user input correctly to prevent potential security vulnerabilities. Among them, testing the menu list is an important part of ensuring that the user interface is friendly, easy to use and secure.

[0062] In a specific implementation, the device obtains the login user authority and determines the menu list based on the login user authority, including:

[0063] After the user logs in to the page testing platform, the user information of the user is obtained; the user code in the user information is extracted, and based on the user code, the role information of the user is determined; the menu permissions corresponding to each role information are determined, the logged-in user permissions are obtained, and the API interface is called to traverse the menu permissions and summarize to obtain a menu list.

[0064] In the specific implementation, the device first uses the interface automation "open webpage action" to open the financial leasing business system environment integration page, and uses the interface automation "click action" on the financial leasing business system environment integration page to select the Chinese name and login environment of the required login user, and further clicks the user name hyperlink to jump to the business platform homepage, waits for the page to load, and the user logs in successfully. That is, the device simulates the user login page test platform, or it can also be a real user logging in to the page test platform, and this method is not specifically limited.

[0065] Furthermore, the device queries the user code of the selected user according to the user name in the user information table of the business database, and uses the user code as an input parameter to call the API, and obtains all the roles owned by the user in the return message. The device further uses all the roles owned by the user as an input parameter, calls the API, and obtains the menu permissions owned by the user in the return message. The data in the return message is a three-level nested dictionary, in which the menu where the leaf node is located can be opened, so it is necessary to write a Python script to parse the nested menus, and summarize the menu data into a list through traversal, in which the list elements are dictionaries, and the key value of each dictionary is the first-level menu, and the value is the second-level menu, that is, the menu where the leaf node is located.

[0066] Step S200, based on a preset control location identifier, a dynamic click operation is performed on the page to be tested to obtain a target test result of the page to be tested, so as to implement a test traversal of the primary menu and the secondary menu.

[0067] It should be noted that the control location identifier refers to XPath (XML Path Language), which is a language used for navigation and query in XML documents. It is used for Web documents, but is also applicable to HTML documents because HTML is a subset of XML. XPath allows the selection of nodes or sets of nodes in XML or HTML documents, and then operations are performed on these nodes, such as retrieving data, comparing or modifying. Specifically, technicians usually use the XPath method to locate page elements, that is, using a variety of methods such as element attributes, text content, hierarchical relationships, etc. to locate elements.

[0068] In a specific implementation, the device uses XPath to perform dynamic click operations on the page to be tested to obtain the target test results of the page to be tested, so as to realize the test traversal of the first-level menu and the second-level menu. That is, the device dynamically reuses interface controls through variable XPath according to the permission information of different users to realize the interface automation of menu traversal after different users log in.

[0069] In a specific implementation, the device obtains the test result of the page to be tested by dynamically performing a dynamic click operation on the page to be tested based on a preset control location identifier, including:

[0070] Capture the path information of the preset control location identifier, and based on the path information, perform a dynamic click operation on the page to be tested of the first-level menu through the control location identifier to obtain first loading data, wherein the first loading data includes at least one second-level menu identifier; perform a text test on the first loading data to obtain a first test result, and perform a dynamic click operation on the second-level menu identifier to display the page to be tested of the second-level menu; perform a dynamic click operation on the page to be tested of the second-level menu to obtain second loading data, perform a text test on the second loading data to obtain a second test result, and determine the target test result of the page to be tested based on the first test result and the second test result.

[0071] In the specific implementation, refer to Figure 3 and Figure 4 After determining the menu list of user permissions, first dynamically click on the first-level menu to loop through the first-level menu. Specifically, the device captures the XPath (control location identifier) ​​path of the first-level menu list and uses the number of loops as the index number of the menu list. In this way, XPath traversal can be achieved, and the first-level menu can be located through variable XPath, thereby realizing automatic traversal of the menu. Use the "click action" of the interface automation to click on the first-level menu to open the first-level menu list, that is, the device captures the path information of the preset control location identifier, and based on the path information, through the control location identifier, performs a dynamic click operation on the page to be tested of the first-level menu to obtain the first loading data, wherein the first loading data includes at least one second-level menu identifier. Use the "control attribute acquisition" of the interface automation to obtain the text attribute of the first-level menu and obtain the menu name of the first-level menu.

[0072] Furthermore, the device performs a text test on the first loaded data to obtain a first test result, and performs a dynamic click operation on the secondary menu identifier to display the page to be tested of the secondary menu, that is, returns to the secondary menu, and further loops through the secondary menu. Specifically, the device queries the menu inspection data table, queries the secondary menu according to the first-level menu, displays the page to be tested of the secondary menu, and uses the interface automated "AI text detection" to locate the secondary menu, and then uses the interface automated "click action" to click the secondary menu to implement a text test on the second loaded data and obtain a second test result. Finally, the device determines the target test result of the page to be tested based on the first test result and the second test result.

[0073] It should be noted that the menu inspection data table is a pre-built form containing data from each field of the menu. Specifically, the fields in the menu inspection data table include ID (identification id), first (first-level menu), second (second-level menu), isclick (whether it needs to be clicked), clickstr (click text), aitex (detection text), and isnew (whether it is a new frame). The functions of the menu inspection data table include: 1. Storing the linkage relationship between the first-level menu and the second-level menu; 2. Judging whether the page is a dynamic / static new frame or a dynamic / old frame based on the isclick, isnew, and fields. If the page is a dynamic frame, the "click action" is performed through the clickstr field; 3. aitex stores the detection text of the page inspection.

[0074] Compared with the related art, page testing of websites or applications usually relies on manual testing by experienced testers. However, as the data content of page testing continues to increase, the manual testing method is prone to test omissions in the face of a large amount of data content, and then the risk of corresponding production defects occurs, that is, this method cannot achieve comprehensive page testing. In comparison, this application determines a menu list including a primary menu and a secondary menu according to different login user permissions, and based on a preset control positioning identifier, obtains the target test result of the page to be tested by performing a dynamic click operation on the page to be tested, and automatically implements page testing after users with different permissions log in, without relying on experienced testers to perform manual testing, thereby achieving comprehensive page testing.

[0075] Based on the above first embodiment, the present application also proposes another embodiment, referring to Figure 5 , the page automation testing method includes:

[0076] In a specific implementation, the device obtains the test result of the page to be tested by dynamically performing a dynamic click operation on the page to be tested based on a preset control location identifier, including:

[0077] Step A100, obtaining a menu inspection data table;

[0078] It should be noted that the menu inspection data table is a pre-built form containing data from each field of the menu. Specifically, the fields in the menu inspection data table include ID (identification id), first (first-level menu), second (second-level menu), isclick (whether it needs to be clicked), clickstr (click text), aitex (detection text), and isnew (whether it is a new frame). The functions of the menu inspection data table include: 1. Storing the linkage relationship between the first-level menu and the second-level menu; 2. Judging whether the page is a dynamic / static new frame or a dynamic / old frame based on the isclick, isnew, and fields. If the page is a dynamic frame, the "click action" is performed through the clickstr field; 3. aitex stores the detection text of the page inspection.

[0079] Step A200, determining the frame type information of the page to be tested based on the menu inspection data table;

[0080] In a specific implementation, the device determines the frame type information of the page to be tested according to the fields stored in the menu inspection data table.

[0081] In a specific implementation, the step of determining the frame type information of the page to be tested based on the menu inspection data table includes:

[0082] Extracting relevant information about the page to be clicked and frame attribute information from the menu inspection data table, wherein the frame attribute information includes new frame attributes and old frame attributes; determining state attribute information of the page to be tested based on the relevant information, wherein the state attribute information includes dynamic frame attributes and static frame attributes; and composing frame type information of the page to be tested based on the frame attribute information and the state attribute information.

[0083] In a specific implementation, the isclick field in the menu inspection data table contains relevant information about whether the page needs to be clicked. The field stores information on whether the page needs to be clicked. If the page needs to be clicked, the state attribute information of the page frame is identified as a static frame attribute. If the page does not need to be clicked, the state attribute information of the page frame is identified as a static frame attribute. The frame attribute information includes new frame attributes and old frame attributes. Compared with the new frame attributes, the old frame attributes lack the text attribute of the control. Therefore, different traversal test strategies need to be used for different frame attributes.

[0084] Step A300, generating a traversal test strategy corresponding to the framework type information;

[0085] In a specific implementation, the step of generating a traversal test strategy corresponding to the framework type information includes:

[0086] If the frame type information is a static frame attribute and a new frame attribute, a first traversal test strategy is generated, wherein the first traversal test strategy includes determining the text attribute of the control to be clicked, and based on the text attribute, dynamically clicking the control to be clicked on the page to be tested to achieve text loading and traversal; if the frame type information is a static frame attribute and an old frame attribute, a second traversal test strategy is generated, wherein the second traversal test strategy includes dynamically clicking the control to be clicked on the page to be tested to achieve text loading and traversal; if the frame type information includes a dynamic frame attribute, a third traversal test strategy is generated, wherein the third traversal test strategy includes dynamically clicking text on the page to be tested to achieve traversal of the text.

[0087] In a specific implementation, the device can determine whether the page is a dynamic / static new frame or a dynamic / old frame according to the isclick, isnew and other fields in the menu inspection data table. If the page is, if the frame type information is a static frame attribute and a new frame attribute, a first traversal test strategy is generated, wherein the first traversal test strategy includes determining the text attribute of the control to be clicked, and based on the text attribute, dynamically clicking the control to be clicked on the page to be tested to achieve text loading and traversal; if the frame type information is a static frame attribute and an old frame attribute, a second traversal test strategy is generated, wherein the second traversal test strategy includes dynamically clicking the control to be clicked on the page to be tested to achieve text loading and traversal; if the frame type information includes a dynamic frame attribute, a third traversal test strategy is generated, wherein the third traversal test strategy includes dynamically clicking text on the page to be tested to achieve text traversal.

[0088] Step A400, based on a preset control location identifier, a test result of the page to be tested is obtained by dynamically executing a dynamic click operation corresponding to the traversal test strategy on the page to be tested.

[0089] In a specific implementation, the device obtains the test result of the page to be tested by dynamically executing the dynamic click operation corresponding to the traversal test strategy on the page to be tested based on a preset control location identifier. Specifically, the present application implements a universal solution for interface inspection of different pages by constructing a data table in TDM, associating page detection content and menu directory.

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

[0091] This application also provides a page automation testing device, please refer to Figure 6 , the page automation testing device comprises:

[0092] The acquisition module 10 is used to obtain the login user authority and determine the menu list based on the login user authority, wherein the menu list includes a primary menu and a secondary menu, the secondary menu is a one-level or multi-level extended menu under the primary menu, and the primary menu and the secondary menu include a page to be tested;

[0093] The testing module 20 is used to obtain the target test result of the page to be tested by performing a dynamic click operation on the page to be tested based on a preset control location identifier, so as to implement the test traversal of the primary menu and the secondary menu.

[0094] Optionally, the testing module 20 includes:

[0095] A capture module, used to capture path information of a preset control location identifier, and based on the path information, perform a dynamic click operation on the page to be tested of the first-level menu through the control location identifier to obtain first loading data, wherein the first loading data includes at least one second-level menu identifier;

[0096] A display module, configured to perform a text test on the first loaded data to obtain a first test result, and to perform a dynamic click operation on the secondary menu logo to display a page to be tested of the secondary menu;

[0097] A text testing module is used to perform a dynamic click operation on the page to be tested of the secondary menu to obtain second loading data, perform a text test on the second loading data to obtain a second test result, and determine a target test result of the page to be tested based on the first test result and the second test result.

[0098] Optionally, the testing module 20 further includes:

[0099] A data table acquisition module is used to acquire a menu inspection data table;

[0100] A determination module, used to determine the frame type information of the page to be tested based on the menu inspection data table;

[0101] A generation module, used for generating a traversal test strategy corresponding to the framework type information;

[0102] The traversal module is used to obtain the test result of the page to be tested by dynamically executing the dynamic click operation corresponding to the traversal test strategy on the page to be tested based on the preset control location identifier.

[0103] Optionally, the determining module includes:

[0104] An extraction module, used to extract the relevant information about the page to be clicked and the frame attribute information in the menu inspection data table, wherein the frame attribute information includes new frame attributes and old frame attributes;

[0105] A state attribute information determination module, used to determine the state attribute information of the page to be tested based on the relevant information, wherein the state attribute information includes dynamic frame attributes and static frame attributes;

[0106] A composition module is used to compose the frame type information of the page to be tested based on the frame attribute information and the state attribute information.

[0107] Optionally, the generating module includes:

[0108] A first traversal test strategy determination module is used to generate a first traversal test strategy if the frame type information is a static frame attribute and a new frame attribute, wherein the first traversal test strategy includes determining a text attribute of a control to be clicked, and based on the text attribute, dynamically clicking the control to be clicked on the page to be tested to achieve text loading and traversal;

[0109] A second traversal test strategy determination module is used to generate a second traversal test strategy if the frame type information is a static frame attribute and an old frame attribute, wherein the second traversal test strategy includes dynamically clicking a control to be clicked on the page to be tested to load and traverse text;

[0110] The third traversal test strategy determination module is used to generate a third traversal test strategy if the frame type information includes a dynamic frame attribute, wherein the third traversal test strategy includes dynamically clicking text on the page to be tested to achieve traversal of the text.

[0111] Optionally, the acquisition module 10 includes:

[0112] A user information acquisition module, used to acquire the user information of the user after the user logs in to the page testing platform;

[0113] A role information determination module, used to extract the user code from the user information and determine the role information of the user based on the user code;

[0114] The authority determination module is used to determine the menu authority corresponding to each role information, obtain the login user authority, and call the API interface to traverse the menu authority and summarize to obtain a menu list.

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

[0116] The present application provides a page automation testing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed 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 automation testing method in the above-mentioned embodiment one.

[0117] Reference below Figure 7 , which shows a schematic diagram of the structure of a page automation test device suitable for implementing the embodiment of the present application. The page automation test device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, 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 7 The page automation 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.

[0118] like Figure 7As shown, the page automation test equipment may include a processing device 1001 (such as a central processing unit, a graphics processor, 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. In RAM1004, various programs and data required for the operation of the page automation test equipment are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the page automation test device to communicate with other devices wirelessly or by wire to exchange data. Although the page automation 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 can be implemented or provided alternatively.

[0119] 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.

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

[0121] 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.

[0122] 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.

[0123] 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 automation testing method in the above-mentioned embodiment.

[0124] 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.

[0125] The computer-readable storage medium may be included in the page automation testing device; or may exist independently without being assembled into the page automation testing device.

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

[0127] 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).

[0128] 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.

[0129] 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.

[0130] The readable storage medium provided by 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 automation testing method, and can solve the technical problems of page automation testing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the page automation testing method provided by the above-mentioned embodiment, and will not be repeated here.

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

[0132] The computer program product provided by this application can solve the technical problem of page automation 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 automation testing method provided by the above embodiment, which will not be repeated here.

[0133] 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 automation testing method, characterized in that: The page automation testing method includes: Obtaining the login user's authority, and determining a menu list based on the login user's authority, wherein the menu list includes a primary menu and a secondary menu, the secondary menu is a one-level or multi-level extended menu under the primary menu, and the primary menu and the secondary menu include a page to be tested; Based on the preset control location identifier, a dynamic click operation is performed on the page to be tested to obtain a target test result of the page to be tested, so as to implement test traversal of the primary menu and the secondary menu.

2. The page automation testing method according to claim 1, characterized in that: The step of obtaining the test result of the page to be tested by dynamically performing a dynamic click operation on the page to be tested based on a preset control location identifier includes: Capturing path information of a preset control location identifier, and based on the path information, performing a dynamic click operation on the page to be tested of the first-level menu through the control location identifier to obtain first loading data, wherein the first loading data includes at least one second-level menu identifier; Performing a text test on the first loaded data to obtain a first test result, and performing a dynamic click operation on the secondary menu logo to display a page to be tested of the secondary menu; Perform a dynamic click operation on the page to be tested of the secondary menu to obtain second loading data, perform a text test on the second loading data to obtain a second test result, and determine a target test result of the page to be tested based on the first test result and the second test result.

3. The page automation testing method according to claim 1, characterized in that: The step of obtaining the test result of the page to be tested by dynamically performing a dynamic click operation on the page to be tested based on a preset control location identifier includes: Get the menu inspection data table; Determining the frame type information of the page to be tested based on the menu inspection data table; Generate a traversal test strategy corresponding to the framework type information; Based on the preset control location identifier, the test result of the page to be tested is obtained by dynamically executing the dynamic click operation corresponding to the traversal test strategy on the page to be tested.

4. The page automation testing method according to claim 3, characterized in that: The step of determining the frame type information of the page to be tested based on the menu inspection data table includes: Extracting the relevant information about the page to be clicked and the frame attribute information in the menu inspection data table, wherein the frame attribute information includes new frame attributes and old frame attributes; Based on the relevant information, determining state attribute information of the page to be tested, wherein the state attribute information includes dynamic frame attributes and static frame attributes; Based on the frame attribute information and the state attribute information, frame type information of the page to be tested is composed.

5. The page automation testing method according to claim 4, characterized in that: The step of generating a traversal test strategy corresponding to the framework type information includes: If the frame type information is a static frame attribute and a new frame attribute, a first traversal test strategy is generated, wherein the first traversal test strategy includes determining a text attribute of a control to be clicked, and based on the text attribute, dynamically clicking the control to be clicked on the page to be tested to achieve text loading and traversal; If the frame type information is a static frame attribute and an old frame attribute, a second traversal test strategy is generated, wherein the second traversal test strategy includes dynamically clicking a control to be clicked on the page to be tested to achieve loading and traversal of text; If the frame type information includes a dynamic frame attribute, a third traversal test strategy is generated, wherein the third traversal test strategy includes dynamically clicking text on the page to be tested to implement traversal of the text.

6. The page automation testing method according to claim 1, characterized in that: The step of obtaining the login user authority and determining the menu list based on the login user authority includes: After the user logs in to the page testing platform, the user information of the user is obtained; Extracting a user code from the user information, and determining the role information of the user based on the user code; Determine the menu permissions corresponding to each of the role information, obtain the login user permissions, call the API interface, traverse the menu permissions, and summarize to obtain a menu list.

7. A page automation testing device, characterized in that: The device comprises: An acquisition module, used to acquire the login user authority, and determine a menu list based on the login user authority, wherein the menu list includes a primary menu and a secondary menu, the secondary menu is a one-level or multi-level extended menu under the primary menu, and the primary menu and the secondary menu include a page to be tested; The test module is used to obtain the target test result of the page to be tested by performing a dynamic click operation on the page to be tested based on a preset control positioning identifier, so as to realize the test traversal of the first-level menu and the second-level menu.

8. A page automation 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 automatic testing method according to 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 testing method according to any one of claims 1 to 6 are implemented.

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

Citation Information

Cited By

  • Automatic test method and system for information system, electronic equipment and medium

    CN121579375A