Automated testing method and system
By building automated testing methods and systems for keyword databases, the problems of high cost and low efficiency of manual testing in the existing technology are solved, efficient automated testing of software products is realized, and testing costs are reduced.
Patent Information
- Application Number
- CN202411920708.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Relying on manual testing software products in the prior art results in high testing costs and low efficiency, and cannot meet the testing needs of multi-functional and multi-yield software products.
Provides an automated testing method and system, by building a keyword library, including scene positioning keyword scripts, operation keyword scripts and index keyword scripts, encapsulating feature controls, layer scenes, cell attributes and adjustment menu items of automated testing software products.
Through automated testing methods, the testing cost is effectively reduced and the testing efficiency is improved. Testers do not need to understand different test controls, and can quickly master the automated testing methods.
Smart Images

Figure CN119357067B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to an automated testing method and system. Background Art
[0002] With the vigorous development of the software industry, the application breadth of software is expanding, the scale of software products is becoming larger and larger, and with it comes higher and higher requirements for software quality.
[0003] Software testing is one of the important guarantees of software quality. It refers to the process of verifying whether the developed software product meets the requirements in configuration and whether its functions meet the needs of users through testing during the software development process.
[0004] Current software testing is mainly done through manual testing, which not only has high testing costs but also low testing efficiency, and can no longer meet the testing needs of multi-functional and high-volume software products. Summary of the invention
[0005] In view of the deficiencies in the prior art, the purpose of the present invention is to provide an automated testing method and system, aiming to solve the technical problem that the prior art relies on manual testing to complete the testing of software products, which not only has high testing costs but also low testing efficiency.
[0006] In order to achieve the above objectives, in a first aspect, an embodiment of the present application provides an automated testing method, comprising the following steps:
[0007] Construct a keyword library, the keyword library includes a scene positioning keyword script, an operation keyword script and an index keyword script, the scene positioning keyword script, the operation keyword script and the index keyword script all encapsulate a number of feature controls;
[0008] After the software product is started, the scene configuration list is indexed by the scene positioning keyword script, and the layer scene of the software product is tested based on the scene configuration list to obtain a final layer scene, wherein the final layer scene includes a plurality of final layers linked in sequence;
[0009] Determine whether the final layer is a table-type layer. If the final layer is a table-type layer, locate a cell, assign a target attribute to the cell, change the real-time attribute of the cell through the operation keyword script, and complete the operation test through the real-time attribute and the target attribute;
[0010] The adjustment menu item of the final layer is selected, and the adjustment menu item is linked to a plurality of sub-menu items. The index keyword script is used to determine whether the sub-menu items can be accurately indexed, thereby completing the software test.
[0011] Compared with the prior art, the beneficial effects of the present invention are as follows: by constructing the keyword library, the testing of the layer scene, cell properties and adjustment menu items of the software product are respectively completed based on the scene positioning keyword script, the operation keyword script and the index keyword script encapsulated with the feature control, and the testing of the software product is completed in an automated manner. Compared with the manual testing method, it effectively reduces the testing cost. At the same time, the test can be completed efficiently, and the test is performed through the keyword script. The tester does not need to understand different test controls and can quickly master the automated testing method.
[0012] Further, the scene configuration list includes a main configuration and a plurality of sequentially linked secondary configurations, the layer scene includes a main scene and a plurality of sequentially linked secondary scenes, and the step of testing the layer scene of the software product based on the scene configuration list includes:
[0013] Building a main simulated scene based on the main configuration, and determining whether the main simulated scene is consistent with the main scene;
[0014] If the main simulated scene is consistent with the main scene, extract the secondary configuration linked to the main configuration and the secondary scene linked to the main scene, and construct a first simulated scene based on the secondary configuration linked to the main configuration, and determine whether the first simulated scene is consistent with the secondary scene;
[0015] If the first simulated scene is inconsistent with the secondary scene, replacing the secondary scene with the first simulated scene;
[0016] If the first simulated scene is consistent with the secondary scene, extract the sequentially linked secondary configurations to construct a number of second simulated scenes, extract the sequentially linked secondary scenes, and compare the second simulated scenes with the secondary scenes one by one.
[0017] Furthermore, the real-time attribute includes a first value attribute, a real-time link attribute and a second value attribute, and the step of changing the real-time attribute of the cell through the operation keyword script includes:
[0018] Based on the operation keyword script index detection instructions, verification instructions and operation instructions, judging whether the cell is a check box or a hyperlink through the detection instructions;
[0019] If the cell is a check box, setting a first value attribute for the check box through the operation instruction;
[0020] If the cell is a hyperlink, reading the hyperlink through the operation instruction to obtain a real-time link attribute;
[0021] If the cell is not a check box or a hyperlink, verifying whether the cell is in a time format by using the verification instruction;
[0022] If the cell is in a time format, a second value attribute is set for the cell through the operation instruction.
[0023] Furthermore, the step of determining whether the cell is a check box or a hyperlink includes:
[0024] Acquire a format image of the cell, and compare the format image with a preset check image and a preset link image respectively to obtain a check similarity and a link similarity;
[0025] Determine whether the multiple selection similarity and the link similarity are greater than a similarity threshold;
[0026] If the check similarity is greater than the similarity threshold, the cell is determined to be a check box; if the link similarity is greater than the similarity threshold, the cell is determined to be a hyperlink.
[0027] Furthermore, the target attribute includes a first target attribute, a target link attribute and a second target attribute, and the step of completing the operation test through the real-time attribute and the target attribute includes:
[0028] When the cell is a check box, determining whether the first value attribute is the same as the first target attribute, and if the first value attribute is the same as the first target attribute, determining that the operation is correct;
[0029] When the cell is a hyperlink, determining whether the real-time link attribute is the same as the target link attribute, and if the real-time link attribute is the same as the target link attribute, determining that the operation is correct;
[0030] When the cell is in the time format, it is determined whether the second value attribute is the same as the second target attribute. If the second value attribute is the same as the second target attribute, it is determined that the operation is correct.
[0031] Furthermore, the step of determining whether the submenu item can be accurately indexed by the index keyword script includes:
[0032] Selecting a target menu item from a plurality of the submenu items, and obtaining an expansion direction of the submenu item, wherein the expansion direction includes horizontal expansion and vertical expansion;
[0033] Selecting the submenu item in the expansion direction through the index keyword script, and determining whether the selected submenu item is the target menu item;
[0034] If the selected submenu item is the target menu item, it is determined that the submenu item can be accurately indexed.
[0035] Furthermore, the step of obtaining the expansion direction of the submenu item, wherein the expansion direction includes horizontal expansion and vertical expansion, comprises:
[0036] Detecting whether two adjacent submenus have an intersection in the horizontal direction or the vertical direction;
[0037] If there is an intersection between two adjacent submenus, determining whether the pixel of the intersection is greater than a pixel threshold;
[0038] If the pixels of the intersection are greater than the pixel threshold, it is determined that the submenu item is expanded horizontally or vertically.
[0039] In a second aspect, an embodiment of the present application provides an automated testing system, which is applied to the automated testing method described in the first aspect above, and the system includes:
[0040] A construction module, used to construct a keyword library, the keyword library includes a scene positioning keyword script, an operation keyword script and an index keyword script, the scene positioning keyword script, the operation keyword script and the index keyword script all encapsulate a number of feature controls;
[0041] A first test module is used to, after starting the software product, index a scene configuration list through the scene positioning keyword script, and test the layer scene of the software product based on the scene configuration list to obtain a final layer scene, wherein the final layer scene includes a plurality of final layers linked in sequence;
[0042] The second test module is used to determine whether the final layer is a table-type layer. If the final layer is a table-type layer, locate a certain cell, assign a target attribute to the cell, change the real-time attribute of the cell through the operation keyword script, and complete the operation test through the real-time attribute and the target attribute;
[0043] The third test module is used to select the adjustment menu item of the final layer, where the adjustment menu item is linked to several sub-menu items, and determine whether the sub-menu items can be accurately indexed through the index keyword script, thereby completing the software test.
[0044] In a third aspect, an embodiment of the present application provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the automated testing method described in the first aspect above is implemented.
[0045] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the automated testing method described in the first aspect above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of an automated testing method in a first embodiment of the present invention;
[0047] Figure 2 It is a structural block diagram of an automated testing system in a second embodiment of the present invention;
[0048] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0049] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0050] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0052] See also Figure 1 The automated testing method provided by the first embodiment of the present invention comprises the following steps:
[0053] S10: construct a keyword library, the keyword library includes a scene positioning keyword script, an operation keyword script and an index keyword script, the scene positioning keyword script, the operation keyword script and the index keyword script all encapsulate a number of feature controls;
[0054] The parameters of the scene positioning keyword script, the operation keyword script and the index keyword script are all dictionary form parameters, and the key and value of the dictionary can be empty.
[0055] S20: after starting the software product, indexing the scene configuration list through the scene positioning keyword script, testing the layer scene of the software product based on the scene configuration list to obtain a final layer scene, wherein the final layer scene includes a plurality of final layers linked in sequence;
[0056] The scene configuration list includes a main configuration and several sub-configurations linked in sequence, and the layer scene includes a main scene and several sub-scenes linked in sequence. It can be understood that by clicking an option in the main scene, you can link to the sub-scene, and by clicking an option in the sub-scene linked to the main scene, you can link to the sub-scene of the next level again. The main configuration and the sub-configuration have the same meaning, which will not be repeated here.
[0057] The step S20 comprises:
[0058] S210: constructing a main simulated scene based on the main configuration, and determining whether the main simulated scene is consistent with the main scene;
[0059] S220: If the main simulated scene is consistent with the main scene, extract the secondary configuration linked to the main configuration and the secondary scene linked to the main scene, and construct a first simulated scene based on the secondary configuration linked to the main configuration, and determine whether the first simulated scene is consistent with the secondary scene;
[0060] If the main simulated scene is inconsistent with the main scene, the main scene is replaced by the main simulated scene. The secondary scene in this step is a secondary scene linked to the main scene.
[0061] S230: If the first simulated scene is inconsistent with the secondary scene, replacing the secondary scene with the first simulated scene;
[0062] S240: If the first simulated scene is consistent with the secondary scene, extract the sequentially linked secondary configurations to construct a plurality of second simulated scenes, extract the sequentially linked secondary scenes, and compare the plurality of the second simulated scenes with the plurality of the secondary scenes one by one;
[0063] The subsequent comparison and judgment between the second simulated scene and the secondary scene is the same as the aforementioned judgment, which will not be repeated here, and continues until the comparison between all the second simulated scenes and the secondary scenes is completed.
[0064] S30: determining whether the final layer is a table-type layer; if the final layer is a table-type layer, locating a certain cell, assigning a target attribute to the cell, changing the real-time attribute of the cell through the operation keyword script, and completing the operation test through the real-time attribute and the target attribute;
[0065] The step S30 comprises:
[0066] S310: Based on the operation keyword script index detection instruction, verification instruction and operation instruction, determine whether the cell is a check box or a hyperlink through the detection instruction;
[0067] Specifically, a format image of the cell is obtained, and the format image is compared with a preset check image and a preset link image respectively to obtain a check similarity and a link similarity; it is determined whether the check similarity and the link similarity are greater than a similarity threshold; if the check similarity is greater than the similarity threshold, the cell is determined to be a check box, and if the link similarity is greater than the similarity threshold, the cell is determined to be a hyperlink.
[0068] S320: If the cell is a check box, setting a first value attribute for the check box through the operation instruction;
[0069] S330: If the cell is a hyperlink, read the hyperlink through the operation instruction to obtain a real-time link attribute;
[0070] S340: If the cell is not a check box or a hyperlink, verifying whether the cell is in a time format by using the verification instruction;
[0071] S350: If the cell is in a time format, a second value attribute is set for the cell through the operation instruction.
[0072] In this embodiment, the target attributes include a first target attribute, a target link attribute and a second target attribute, the first target attribute has the same meaning as the first value attribute, the target link attribute has the same meaning as the real-time link attribute, and the second target attribute has the same meaning as the second value attribute.
[0073] S360: When the cell is a check box, determining whether the first value attribute is the same as the first target attribute, and if the first value attribute is the same as the first target attribute, determining that the operation is correct;
[0074] S370: When the cell is a hyperlink, determining whether the real-time link attribute is the same as the target link attribute, and if the real-time link attribute is the same as the target link attribute, determining that the operation is correct;
[0075] S380: When the cell is in a time format, determining whether the second value attribute is the same as the second target attribute, and if the second value attribute is the same as the second target attribute, determining that the operation is correct;
[0076] S40: selecting an adjustment menu item of the final layer, wherein the adjustment menu item is linked to a plurality of sub-menu items, and determining whether the sub-menu items can be accurately indexed by the index keyword script, thereby completing software testing;
[0077] The step S40 comprises:
[0078] S410: Selecting a target menu item from a plurality of the submenu items, and obtaining an expansion direction of the submenu item, wherein the expansion direction includes horizontal expansion and vertical expansion;
[0079] Specifically, it is detected whether two adjacent submenus have an intersection in the horizontal direction or the vertical direction; if there is an intersection between the two adjacent submenus, it is determined whether the pixel of the intersection is greater than the pixel threshold; if the pixel of the intersection is greater than the pixel threshold, it is determined that the submenu item is horizontally expanded or vertically expanded. In this embodiment, the pixel threshold is 3.
[0080] S420: selecting the submenu item in the expansion direction by using the index keyword script, and determining whether the selected submenu item is the target menu item;
[0081] S430: If the selected submenu item is the target menu item, it is determined that the submenu item can be accurately indexed.
[0082] By constructing the keyword library, the testing of the layer scene, cell properties and adjustment menu items of the software product are respectively completed based on the scene positioning keyword script, the operation keyword script and the index keyword script encapsulated with the feature control, and the testing of the software product is completed in an automated manner. Compared with the manual testing method, it effectively reduces the testing cost. At the same time, the test can be completed efficiently. Moreover, by testing through keyword scripts, the tester does not need to understand different test controls and can quickly master the automated testing method.
[0083] See also Figure 2The second embodiment of the present invention provides an automated testing system, which is applied to the automated testing method described in the above embodiment, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0084] The system comprises:
[0085] A construction module 10 is used to construct a keyword library, wherein the keyword library includes a scene positioning keyword script, an operation keyword script, and an index keyword script, wherein the scene positioning keyword script, the operation keyword script, and the index keyword script all encapsulate a plurality of characteristic controls;
[0086] The first test module 20 is used to, after starting the software product, index the scene configuration list through the scene positioning keyword script, and test the layer scene of the software product based on the scene configuration list to obtain a final layer scene, wherein the final layer scene includes a plurality of final layers linked in sequence;
[0087] The first test module 20 includes:
[0088] A first unit is used to construct a main simulated scene based on the main configuration, and determine whether the main simulated scene is consistent with the main scene;
[0089] The second unit is used for extracting the secondary configuration linked to the primary configuration and the secondary scene linked to the primary scene if the primary simulated scene is consistent with the primary scene, and constructing a first simulated scene based on the secondary configuration linked to the primary configuration, and determining whether the first simulated scene is consistent with the secondary scene;
[0090] A third unit is configured to replace the secondary scene with the first simulated scene if the first simulated scene is inconsistent with the secondary scene;
[0091] The fourth unit is used for extracting the sequentially linked secondary configurations to construct a plurality of second simulated scenes if the first simulated scene is consistent with the secondary scene, and extracting the sequentially linked secondary scenes, and comparing the plurality of the second simulated scenes with the plurality of the secondary scenes one by one;
[0092] The second test module 30 is used to determine whether the final layer is a table-type layer. If the final layer is a table-type layer, locate a certain cell, assign a target attribute to the cell, change the real-time attribute of the cell through the operation keyword script, and complete the operation test through the real-time attribute and the target attribute;
[0093] The second test module 30 includes:
[0094] A fifth unit is used to detect instructions, check instructions and operation instructions based on the operation keyword script index, and determine whether the cell is a check box or a hyperlink through the detection instruction;
[0095] The fifth unit is specifically used to obtain the format image of the cell, and compare the format image with a preset check image and a preset link image respectively to obtain a check similarity and a link similarity; determine whether the check similarity and the link similarity are greater than a similarity threshold; if the check similarity is greater than the similarity threshold, determine that the cell is a check box, and if the link similarity is greater than the similarity threshold, determine that the cell is a hyperlink;
[0096] A sixth unit, for setting a first value attribute for the check box through the operation instruction if the cell is a check box;
[0097] A seventh unit is used for reading the hyperlink through the operation instruction to obtain a real-time link attribute if the cell is a hyperlink;
[0098] The eighth unit is used for verifying whether the cell is in a time format by using the verification instruction if the cell is not a check box or a hyperlink;
[0099] A ninth unit, for setting a second value attribute for the cell through the operation instruction if the cell is in a time format;
[0100] A tenth unit, used for, when the cell is a check box, determining whether the first value attribute is the same as the first target attribute, and if the first value attribute is the same as the first target attribute, determining that the operation is correct;
[0101] The eleventh unit is used for judging whether the real-time link attribute is the same as the target link attribute when the cell is a hyperlink, and if the real-time link attribute is the same as the target link attribute, judging that the operation is correct;
[0102] A twelfth unit is used for, when the cell is in a time format, determining whether the second value attribute is the same as the second target attribute, and if the second value attribute is the same as the second target attribute, determining that the operation is correct;
[0103] The third test module 40 is used to select the adjustment menu item of the final layer, the adjustment menu item is linked to a plurality of sub-menu items, and determine whether the sub-menu items can be accurately indexed through the index keyword script, thereby completing the software test;
[0104] The third test module 40 includes:
[0105] The thirteenth unit is used to select a target menu item from a plurality of the submenu items and obtain an expansion direction of the submenu item, wherein the expansion direction includes horizontal expansion and vertical expansion;
[0106] The thirteenth unit is specifically used for detecting whether two adjacent submenus have an intersection in the horizontal direction or the vertical direction; if there is an intersection between the two adjacent submenus, determining whether the pixel of the intersection is greater than a pixel threshold; if the pixel of the intersection is greater than the pixel threshold, determining whether the submenu item is expanded horizontally or vertically;
[0107] A fourteenth unit is used to select the submenu item in the expansion direction through the index keyword script, and determine whether the selected submenu item is the target menu item;
[0108] The fifteenth unit is used to determine whether the submenu item can be accurately indexed if the selected submenu item is the target menu item.
[0109] The present invention also provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the automated testing method as described in the above technical solution when executing the computer program.
[0110] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the automated testing method described in the above technical solution is implemented.
[0111] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0112] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. An automated testing method, characterized in that: The following steps are involved: Construct a keyword library, the keyword library includes a scene positioning keyword script, an operation keyword script and an index keyword script, the scene positioning keyword script, the operation keyword script and the index keyword script all encapsulate a number of feature controls; After starting the software product, the scene configuration list is indexed by the scene positioning keyword script, the scene configuration list includes a main configuration and a plurality of sub-configurations linked in sequence, and the layer scene of the software product is tested based on the scene configuration list to obtain a final layer scene, the layer scene includes a main scene and a plurality of sub-scenes linked in sequence, and the final layer scene includes a plurality of final layers linked in sequence; The step of testing the layer scene of the software product based on the scene configuration list comprises: Building a main simulated scene based on the main configuration, and determining whether the main simulated scene is consistent with the main scene; If the main simulated scene is consistent with the main scene, extract the secondary configuration linked to the main configuration and the secondary scene linked to the main scene, and construct a first simulated scene based on the secondary configuration linked to the main configuration, and determine whether the first simulated scene is consistent with the secondary scene; If the first simulated scene is inconsistent with the secondary scene, replacing the secondary scene with the first simulated scene; If the first simulated scene is consistent with the secondary scene, extract the sequentially linked secondary configurations to construct a plurality of second simulated scenes, extract the sequentially linked secondary scenes, and compare the plurality of the second simulated scenes with the plurality of the secondary scenes one by one; Determine whether the final layer is a table-type layer. If the final layer is a table-type layer, locate a cell, assign a target attribute to the cell, change the real-time attribute of the cell through the operation keyword script, and complete the operation test through the real-time attribute and the target attribute; The adjustment menu item of the final layer is selected, and the adjustment menu item is linked to a plurality of sub-menu items. The index keyword script is used to determine whether the sub-menu items can be accurately indexed, thereby completing the software test.
2. The automated testing method according to claim 1, characterized in that: The real-time attribute includes a first value attribute, a real-time link attribute and a second value attribute, and the step of changing the real-time attribute of the cell by using the operation keyword script includes: Based on the operation keyword script index detection instructions, verification instructions and operation instructions, judging whether the cell is a check box or a hyperlink through the detection instructions; If the cell is a check box, setting a first value attribute for the check box through the operation instruction; If the cell is a hyperlink, reading the hyperlink through the operation instruction to obtain a real-time link attribute; If the cell is not a check box or a hyperlink, verifying whether the cell is in a time format by using the verification instruction; If the cell is in a time format, a second value attribute is set for the cell through the operation instruction.
3. The automated testing method according to claim 2, characterized in that: The step of determining whether the cell is a check box or a hyperlink comprises: Acquire a format image of the cell, and compare the format image with a preset check image and a preset link image respectively to obtain a check similarity and a link similarity; Determine whether the multiple selection similarity and the link similarity are greater than a similarity threshold; If the check similarity is greater than the similarity threshold, the cell is determined to be a check box; if the link similarity is greater than the similarity threshold, the cell is determined to be a hyperlink.
4. The automated testing method according to claim 2, characterized in that: The target attributes include a first target attribute, a target link attribute, and a second target attribute. The step of completing the operation test through the real-time attribute and the target attribute includes: When the cell is a check box, determining whether the first value attribute is the same as the first target attribute, and if the first value attribute is the same as the first target attribute, determining that the operation is correct; When the cell is a hyperlink, determining whether the real-time link attribute is the same as the target link attribute, and if the real-time link attribute is the same as the target link attribute, determining that the operation is correct; When the cell is in the time format, it is determined whether the second value attribute is the same as the second target attribute. If the second value attribute is the same as the second target attribute, it is determined that the operation is correct.
5. The automated testing method according to claim 1, characterized in that: The step of determining whether the submenu item can be accurately indexed by the index keyword script comprises: Selecting a target menu item from a plurality of the submenu items, and obtaining an expansion direction of the submenu item, wherein the expansion direction includes horizontal expansion and vertical expansion; Selecting the submenu item in the expansion direction through the index keyword script, and determining whether the selected submenu item is the target menu item; If the selected submenu item is the target menu item, it is determined that the submenu item can be accurately indexed.
6. The automated testing method according to claim 5, characterized in that: The step of obtaining the expansion direction of the submenu item, wherein the expansion direction includes horizontal expansion and vertical expansion, comprises: Detecting whether two adjacent submenus have an intersection in the horizontal direction or the vertical direction; If there is an intersection between two adjacent submenus, determining whether the pixel of the intersection is greater than a pixel threshold; If the pixels of the intersection are greater than the pixel threshold, it is determined that the submenu item is expanded horizontally or vertically.
7. An automated testing system, applied to the automated testing method according to any one of claims 1 to 6, characterized in that: The system comprises: A construction module, used to construct a keyword library, the keyword library includes a scene positioning keyword script, an operation keyword script and an index keyword script, the scene positioning keyword script, the operation keyword script and the index keyword script all encapsulate a number of feature controls; A first test module is used for, after starting the software product, indexing a scene configuration list through the scene positioning keyword script, the scene configuration list including a main configuration and a plurality of sequentially linked secondary configurations, testing the layer scene of the software product based on the scene configuration list to obtain a final layer scene, the layer scene including a main scene and a plurality of sequentially linked secondary scenes, the final layer scene including a plurality of sequentially linked final layers; The first test module includes: A first unit is used to construct a main simulated scene based on the main configuration, and determine whether the main simulated scene is consistent with the main scene; The second unit is used for extracting the secondary configuration linked to the primary configuration and the secondary scene linked to the primary scene if the primary simulated scene is consistent with the primary scene, and constructing a first simulated scene based on the secondary configuration linked to the primary configuration, and determining whether the first simulated scene is consistent with the secondary scene; A third unit is configured to replace the secondary scene with the first simulated scene if the first simulated scene is inconsistent with the secondary scene; The fourth unit is used for extracting the sequentially linked secondary configurations to construct a plurality of second simulated scenes if the first simulated scene is consistent with the secondary scene, and extracting the sequentially linked secondary scenes, and comparing the plurality of the second simulated scenes with the plurality of the secondary scenes one by one; The second test module is used to determine whether the final layer is a table-type layer. If the final layer is a table-type layer, locate a certain cell, assign a target attribute to the cell, change the real-time attribute of the cell through the operation keyword script, and complete the operation test through the real-time attribute and the target attribute; The third test module is used to select the adjustment menu item of the final layer, where the adjustment menu item is linked to several sub-menu items, and determine whether the sub-menu items can be accurately indexed through the index keyword script, thereby completing the software test.
8. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the automated testing method according to any one of claims 1 to 6 is implemented.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automated testing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Page function testing method and related device
CN110221969A
Scalable testing tool for graphical user interfaces object oriented system and method
US20120246515A1