CN115098362B - Page test method, page test device, electronic equipment and storage medium - Google Patents
Page test method, page test device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115098362B CN115098362B CN202210679735.6A CN202210679735A CN115098362B CN 115098362 B CN115098362 B CN 115098362B CN 202210679735 A CN202210679735 A CN 202210679735A CN 115098362 B CN115098362 B CN 115098362B
- Authority
- CN
- China
- Prior art keywords
- page
- target
- path
- state transition
- transition diagram
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 71
- 238000001545 Page's trend test Methods 0.000 title description 16
- 238000012360 testing method Methods 0.000 claims abstract description 158
- 238000010586 diagram Methods 0.000 claims abstract description 156
- 230000007704 transition Effects 0.000 claims abstract description 138
- 230000008569 process Effects 0.000 claims description 25
- 230000004044 response Effects 0.000 claims description 20
- 230000009191 jumping Effects 0.000 claims description 9
- 238000010276 construction Methods 0.000 claims description 4
- 230000000875 corresponding effect Effects 0.000 description 48
- 230000009471 action Effects 0.000 description 15
- 230000006870 function Effects 0.000 description 14
- 238000004590 computer program Methods 0.000 description 11
- 238000012545 processing Methods 0.000 description 9
- 238000013138 pruning Methods 0.000 description 6
- 238000012216 screening Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000007246 mechanism Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012430 stability testing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The disclosure provides a page testing method, a device, electronic equipment and a storage medium, relates to the technical field of automatic testing, and further relates to the field of automatic testing of pages, so as to at least solve the technical problem of lower accuracy of testing pages in the related art. The specific implementation scheme is as follows: acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page; planning paths of a current page and a target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation between different pages through a plurality of nodes and edges between adjacent nodes, each node in the plurality of nodes respectively represents a different page, and the edges between the adjacent nodes are used for representing operations corresponding to the jump between the different pages; and testing the target path to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page.
Description
Technical Field
The disclosure relates to the technical field of interface automation testing, in particular to page automation testing, and especially relates to a page testing method, a device, electronic equipment and a storage medium.
Background
The test of the mobile terminal mainly judges whether a certain functional point in the page can be fed back according to expectations, at present, test cases are manually written, after the test cases are written, a tester specially executing the test needs to know a test target, communicate the test cases and the test steps, and finally execute related cases.
Disclosure of Invention
The disclosure provides a page testing method, a page testing device, electronic equipment and a storage medium, which are used for at least solving the technical problem of low accuracy of testing pages in related technologies.
According to an aspect of the present disclosure, there is provided a page test method, including: acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page; planning paths of a current page and a target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation between different pages through a plurality of nodes and edges between adjacent nodes, each node in the plurality of nodes respectively represents a different page, and the edges between the adjacent nodes are used for representing operations corresponding to the jump between the different pages; and testing the target path to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page.
According to another aspect of the present disclosure, there is provided a page testing apparatus including: the acquisition module is used for acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page; the path planning module is used for planning paths of the current page and the target page based on the target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing the jump relation among different pages through a plurality of nodes and edges among adjacent nodes, each node among the plurality of nodes respectively represents a different page, and the edges among the adjacent nodes are used for representing the operation corresponding to the jump among the different pages; the testing module is used for testing the target path to obtain a testing result, wherein the testing result is used for indicating whether the current page successfully jumps to the target page.
According to still another aspect of the present disclosure, there is provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the page test method set forth in the present disclosure.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the page test method set forth in the present disclosure.
According to yet another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, performs the page testing method proposed by the present disclosure.
In the method, a current page and a target page are firstly obtained, wherein the target page is a page to be skipped corresponding to the current page; planning paths of a current page and a target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation between different pages through a plurality of nodes and edges between adjacent nodes, each node in the plurality of nodes respectively represents a different page, and the edges between the adjacent nodes are used for representing operations corresponding to the jump between the different pages; determining a target control corresponding to the target path based on the target state transition diagram, wherein the target control is used for realizing the jump of the page; and testing the target path based on the target control to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page, thereby improving the efficiency of testing the page. It is easy to notice that the test path of the page is planned through the target state transition diagram, the path to be tested does not need to be planned manually, the test efficiency can be improved, whether the current page can successfully jump to the target page can be judged through the target control to test the target path, and the technical problem of lower accuracy of testing the page in the related technology is solved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a block diagram of a hardware architecture of a computer terminal (or mobile device) for implementing a page test method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a page test method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a target state transition diagram according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a pruning-based screening mechanism according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an example pruning-based screening mechanism according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a hybrid programming approach based on page source code in accordance with an embodiment of the present disclosure;
fig. 7 is a block diagram of a page testing apparatus according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Application testing at the mobile end involves functional testing, stability testing, manual testing, etc., and often targets a specific functional point test, which mainly focuses on whether a functional point can feed back as expected, such as clicking a live cover to jump to a live page. In the preparation stage, an effective way is lacking, the target page can be automatically reached (the current scheme requires manual intervention operation), and when the tested function points are more, a great effort is required to maintain the way of reaching the target page (for example, how to reach the live page), but the main effort cannot be put into the test for the target function point (clicking the live cover). The current technical scheme is that a path reaching a target page is manually written during testing, and testing activities are executed in the target.
The prior art has the following defects:
1. the labor input is large, test cases are manually written, and a tester needs to know where a target page is, design an operation sequence, and write and maintain related case steps. After the execution fails, the path needs to be manually detected and corrected, and the path cannot be automatically adjusted in real time according to the current page result.
2. And cannot be automatically executed. After the test cases are written, a tester specially executing the test needs to know the test target, communicate the test cases and the test steps, and finally execute the related cases.
According to an embodiment of the present disclosure, a page test method is provided, it being noted that the steps shown in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that herein.
The method embodiments provided by the embodiments of the present disclosure may be performed in a mobile terminal, a computer terminal, or similar electronic device. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein. Fig. 1 is a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a page test method according to an embodiment of the present disclosure.
As shown in fig. 1, the computer terminal 100 includes a computing unit 101 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 102 or a computer program loaded from a storage unit 108 into a Random Access Memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the computer terminal 100 can also be stored. The computing unit 101, ROM 102, and RAM 103 are connected to each other by a bus 104. An input/output (I/O) interface 105 is also connected to bus 104.
Various components in computer terminal 100 are connected to I/O interface 105, including: an input unit 106 such as a keyboard, a mouse, etc.; an output unit 107 such as various types of displays, speakers, and the like; a storage unit 108 such as a magnetic disk, an optical disk, or the like; and a communication unit 109 such as a network card, modem, wireless communication transceiver, etc. The communication unit 109 allows the computer terminal 100 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 101 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 101 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 101 performs the page test method described herein. For example, in some embodiments, the page testing method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 108. In some embodiments, part or all of the computer program may be loaded and/or installed onto the computer terminal 100 via the ROM 102 and/or the communication unit 109. When a computer program is loaded into RAM 103 and executed by computing unit 101, one or more steps of the page test method described herein may be performed. Alternatively, in other embodiments, the computing unit 101 may be configured to perform the page test method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here can be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
It should be noted here that, in some alternative embodiments, the electronic device shown in fig. 1 described above may include hardware elements (including circuits), software elements (including computer code stored on a computer readable medium), or a combination of both hardware and software elements. It should be noted that fig. 1 is only one example of a specific example, and is intended to illustrate the types of components that may be present in the above-described electronic devices.
In the above-described operating environment, the present disclosure provides a page test method as shown in fig. 2, which may be performed by a computer terminal or similar electronic device as shown in fig. 1. Fig. 2 is a flow chart of a page testing method according to an embodiment of the present disclosure. As shown in fig. 2, the method may include the steps of:
step S201, a current page and a target page are acquired.
The target page is a page to be skipped corresponding to the current page. The target page may be a plurality of pages, and the number of target pages is not limited herein.
The current page may be the page from which the jump is started. The target page may be a page to which a jump is finally made. The current page and the target page may be different pages in the web page.
The current page and the target page can be selected by a tester according to the test requirement. The current page and the target page can also be automatically generated according to the test items, for example, the skip function of the live broadcast page needs to be tested, and then the live broadcast page can be automatically selected as the current page according to the test items of the skip function of the live broadcast page, and the page of the live broadcast room corresponding to the target cover in the live broadcast page is the target page.
In the live broadcast scene, the current page may be a page where a live broadcast homepage is located, and the target page may be a page where a live broadcast room is located. The method and the device can test the page skip function of entering the live broadcasting room in the live broadcasting scene. In the instant messaging scene, the current page may be a page where the chat address book is located, and the target page may be a page where the chat interface is located. The page skip function of the chat interface in the instant messaging scene can be tested.
In an alternative embodiment, the current page and the target page may not pass through other pages in the process of jumping, and the current page and the target page may also transfer to jump to other pages in the process of jumping.
Step S202, planning paths of the current page and the target page based on the target state transition diagram to obtain a target path.
The target state transition diagram is used for representing the skip relation among different pages through a plurality of nodes and edges among adjacent nodes, each node among the plurality of nodes represents a different page, and the edges among the adjacent nodes are used for representing operations corresponding to skip among the different pages.
The target state transition diagram may be a state transition diagram constructed according to historical experience.
The plurality of nodes may be used to represent a plurality of pages, and the edges between the adjacent nodes may be skip relations between different pages, where the skip relations may be skip to another page by controlling the control in the page.
In an alternative embodiment, the jump relationship may be represented by an operation of the control. Different operations can be performed on the control to jump to different pages, for example, by clicking on the control to jump to page a and by sliding the control to jump to page B.
In another alternative embodiment, the skip relationship may be represented by an operation on a page, a different operation may be performed on a page to skip to other pages, for example, by sliding page a right to page B, by sliding page a left to page C, and double clicking on page a may enter page D.
In an alternative embodiment, a global depiction may be performed on the operational relationship of the application page, so that the operational relationship of the application page may be automatically obtained from the operation activities such as the page by manually constructing the operational relationship of the page in the path planning process of the application page, and the obtained operational relationship of the page may be abstracted. Optionally, a page may be used as a node, and an operation on the page may be used as an edge to construct an action relationship diagram between pages, that is, the target state transition diagram described above, and the target state transition diagram may be stored in a diagram database, and may be called from the diagram database when the target state transition diagram needs to be used.
In another optional embodiment, after determining the current page to start jumping and the target page to be finally reached, the page source codes of the current page and the target page are acquired, so that the current page and the target page can be subjected to jumping path planning according to the page source codes through the target state transition diagram, and a target path with high jumping efficiency and high jumping success rate is obtained.
FIG. 3 is a schematic diagram of a target state transition diagram according to an embodiment of the disclosure, where each node (page 1, page 2, etc.) represents a page node, each edge (action 1, action 2, etc.) represents an action relationship, and a directed graph formed by the nodes is stored in a graph database, as shown in FIG. 3, and taking page 1 to reach page 7 as an example, page 1 may proceed to page 2 first, and then enter page 7 through action 2, where page 1 may be the current page, and page 7 may be the target page.
Step S203, testing the target path to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page.
In an alternative embodiment, when the jump between adjacent nodes in the target path needs to be implemented by the control, the corresponding target control may be obtained according to the target path first, so as to test the target path according to the target control, and obtain a test result.
Optionally, when the jump between adjacent nodes in the target path is not needed to be implemented through the control, the target path can be directly tested, and a test result is obtained.
In an alternative embodiment, the testing machine can be utilized to automatically test the target path, whether the target path can be successfully jumped from the current page to the target page is judged, if the target path can be jumped from the current page to the target page, the normal jump function from the current page to the target page is indicated, and the success of the test can be determined; if the current page can not be jumped to the target page through the target path, the jump function abnormality from the current page to the target page is indicated, the test failure can be determined, and the node with the jump failure can be fed back after the test failure, so that a user can process the page corresponding to the node with the jump failure, and after the processing, the target path can be further tested.
In another alternative embodiment, after the target path is tested, the test result and the target state transition diagram may be output to the display interface of the tester, so that the tester may check the failed node through the target state transition diagram and process the page corresponding to the node and further test if the test result is that the current page is not successfully jumped to the target page.
In another alternative embodiment, after determining the position of the current page in the target state transition diagram, determining which action is to be executed to the target page, and because the paths to the target page may be multiple, ordering and matching the controls required by the actions according to the historical success rate, if the current page is positioned according to the page unique identifier, determining whether an operable control is on the path according to the page source code and obtaining the corresponding operation, if the current page is positioned according to the control, determining that the page is located according to the control, directly obtaining the corresponding operation, after obtaining the target path and the actions required to be executed, converting the target path and the actions into commands required to be executed, transmitting the commands required to be executed to the testing machine, and automatically executing the corresponding actions and reaching a new page by the testing machine, and continuing to execute the processes on the new page until reaching the target page.
In the method, a current page and a target page are firstly obtained, wherein the target page is a page to be skipped corresponding to the current page; planning paths of a current page and a target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation between different pages through a plurality of nodes and edges between adjacent nodes, each node in the plurality of nodes respectively represents a different page, and the edges between the adjacent nodes are used for representing operations corresponding to the jump between the different pages; determining a target control corresponding to the target path based on the target state transition diagram, wherein the target control is used for realizing the jump of the page; and testing the target path based on the target control to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page, thereby improving the efficiency of testing the page. It is easy to notice that the test path of the page is planned through the target state transition diagram, the test path is not required to be planned manually, the test efficiency can be improved, the target path is tested, whether the current page can successfully jump to the target page can be judged, and the technical problem of lower accuracy of testing the page in the related technology is solved.
Optionally, path planning is performed on the current page and the target page based on the target state transition diagram to obtain a target path, including: acquiring a first page identifier of a current page and a second page identifier of a target page; judging whether a first page identifier and a second page identifier exist in the target state transition diagram; in response to the target state transition diagram having the first page identification, a target path is determined based on the first page identification and the second page identification.
The first page identifier may be unique identification information of the current page.
The second page identifier may be unique identification information of the target page.
In an alternative embodiment, the page source codes of the current page and the target page can be acquired first, and the first page identifier and the second page identifier can be determined according to the information of the page source codes, wherein the page source codes are the basis of page rendering of the application program, and the page source codes comprise the layout, the data information and the like of each control in the page.
In another optional embodiment, after the first page identifier and the second page identifier are obtained, whether the target state transition diagram has the first page identifier and the second page identifier or not may be judged first, if the target state transition diagram has the first page identifier, a target path may be determined according to the first page identifier and the second page identifier, if the target state transition diagram does not have the first page identifier, it is indicated that the page source code in the current page has a change, matching may be performed on the page source code in the target state transition diagram according to the control in the page source code, a page with the same control or a larger number of the same control may be determined as the current page, and the page identifier of the page may be determined as the first page identifier, so as to complete the testing process of the page.
In yet another alternative embodiment, if the first page identifier exists in the target state transition diagram, the node corresponding to the first page identifier and the second page identifier in the target state transition diagram may be determined according to the target state transition diagram, that is, the positions corresponding to the first page identifier and the second page identifier in the target state transition diagram, bidirectional breadth traversal may be performed on the node corresponding to the first page identifier and the node corresponding to the second page identifier, a shortest path between the first page identifier and the second page identifier may be found, and the shortest path may be determined to be the target path.
Through the steps, under the condition that the first page identifier exists in the target state transition diagram, the target path can be directly determined according to the first page identifier and the second page identifier, and the path searching efficiency can be improved, so that the testing efficiency is improved.
Optionally, determining the target path based on the first page identifier and the second page identifier includes: determining that the first page identifier is at a first node of the target state transition diagram; determining a second page identifier to be at a second node of the target state transition diagram; acquiring at least one path between a first node and a second node; the shortest path of the at least one path is determined to be the target path.
In an alternative embodiment, a first node of the target state transition diagram of the first page identifier may be determined, a second node of the target state transition diagram of the second page identifier may be determined, at least one path between the first node and the second node may be obtained, and in a case that there are multiple paths, the multiple paths may be screened, where the path with the highest frequency or the shortest frequency of use is screened as the target path.
Through the steps, after the first page identifier and the second page identifier are obtained, the first node corresponding to the first page identifier is determined, the second node corresponding to the second page identifier is determined, at least one path can be found through the node in the target state transition diagram, the shortest path is determined as the target path, and the jump test efficiency from the current page to the target page can be improved through the shortest path.
Optionally, the method further comprises: acquiring a first control identifier of a current page in response to the target state transition diagram not having the first page identifier, wherein the first control identifier is an identifier of at least one control contained in the current page; judging whether a first page containing a first control identifier exists in the target state transition diagram, wherein a target path exists between the first page and the target page; and determining that a third page identifier of the first page is the first page identifier in response to the existence of the first page in the target state transition diagram.
The first control identifier may be a unique identifier corresponding to one or more controls in the current page.
The third page identifier may be a current page identifier of the first page, and if there is a first page with a higher similarity to the current page in the target state transition diagram, the current page identifier of the first page, that is, the third page identifier may be set to be the first page identifier of the current page, so as to determine the first node of the target state transition diagram according to the first page identifier, thereby determining the target path according to the first node and the second node.
In an alternative embodiment, due to the existence of various personalized contents, the page source codes of the same page are often changed, so that it is often difficult for the first identification information of the current page to be matched with the corresponding node in the target state transition diagram, that is, if the first page identification is not present in the target state transition diagram, the matching needs to be performed according to each control in the page source codes of the current page, whether a node corresponding to a certain page containing the same control exists or not is found, and a path exists between the node and the target page.
In another optional embodiment, under the condition that the first page identifier does not exist in the target state transition diagram, the first control identifier of the current page may be acquired, and the first page with the same control identifier is matched to the first page with the same control identifier according to the first control identifier, where the current page may be a page after the page source code of the first page is changed, the first page may be a page stored in the target state transition diagram before being changed, and if the page is changed, the corresponding page identifier information of the first page may also be changed in the same step, so that the first page may be a page before the current page is not changed. At this time, the first page identification may be updated to a third page identification of the first page.
Through the steps, when the first page identifier does not exist in the target state transition diagram, matching can be performed according to the control identifier, and the page identifier is changed due to the fact that the content in the page is changed, so that whether a first page containing the first control identifier exists or not can be judged according to the target state transition diagram, if the first page contains the first control identifier, the first page is described as the page before the current page is changed in a high probability, at the moment, the third page identifier of the first page can be determined as the first page identifier, and a target path is determined according to the first page, so that the subsequent test flow is facilitated.
Optionally, the method further comprises: acquiring a control attribute of a current page in response to the first page identifier not existing in the target state transition diagram, wherein the control attribute is text information corresponding to at least one control contained in the current page; determining a second page based on the target state transition diagram and the control attribute, wherein the similarity between the control attribute contained in the second page and the control attribute corresponding to the current page is greater than the preset similarity; a fourth page identification of the second page is determined to be the first page identification.
The control attribute of the current page may be text information and resource identifier corresponding to at least one control, where the text information may be a text description of the control, for example, a name of the control.
In an optional embodiment, when the page identifier of the first page does not exist in the target state transition diagram, fuzzy matching is performed on the control attribute according to the page source code recorded in the target state transition diagram, a second page corresponding to the control attribute is obtained, and a fourth page identifier of the second page is determined to be the first page identifier.
Through the steps, the second page close to the current page can be determined according to the control attribute under the condition that the target state transition diagram does not contain the first page identifier or the first control identifier, so that the target path is determined according to the second page, and the subsequent test flow is facilitated.
Optionally, the method further comprises: constructing a temporary state transition diagram based on the current page and the target page; planning paths of the current page and the target page based on the temporary state transfer diagram to obtain a first path; comparing the first path with the target path to obtain a comparison result, wherein the comparison result is used for indicating whether the first path is smaller than the target path; and in response to the comparison result that the first path is smaller than the target path, replacing the target path in the target state transition diagram as the first path.
In an alternative embodiment, a temporary state transition diagram may be constructed for the operation information or the test information that the current page reaches the target page, where the temporary state transition diagram may be a concise state transition diagram, which may be constructed by simplifying the current page, the information in the target page, and the operation information, and optionally, may be obtained by cleaning the information in the target page and the operation information.
In an alternative embodiment, the shortest path from the current page to the target page may be calculated according to a shortest path algorithm, which may help to delete nodes traversed by loops, long paths, etc. The current page may be a starting page, for example, the current page may be a top page of the application program, and the target page may be a page (may be a specific page frame) that needs to be reached finally. It should be noted that the target page may be a plurality of pages.
In another alternative embodiment, after the path planning is performed on the current page and the target page according to the temporary state transition diagram to obtain a first path, the first path and the target path may be compared, whether the first path is smaller than the target path may be determined, and if the first path is smaller than the target path, the target path in the target state transition diagram may be replaced with the first path.
In still another alternative embodiment, when the comparison result is that the first path is smaller than the target path, the use frequency of the target path may be obtained, when the use frequency of the target path is greater than a preset value, the target state transition diagram may not be updated, and when the use frequency of the target path is smaller than the preset value, the target path in the target state transition diagram may be replaced to be the first path.
The method described in the above steps is actually a screening process of pruning the target state transition diagram, and as the history operation experience is disordered, the number of action relations in the target state transition diagram is increased along with the time; at the same time, changes in application version cause some actions to fail. Therefore, the target state transition diagram needs to be continuously adjusted, and before the target state transition diagram is updated each time, the action needing to be updated is preprocessed, and a screening mechanism for pruning the state transition diagram can be established. Fig. 4 is a schematic diagram of a pruning-based screening mechanism according to an embodiment of the present disclosure.
In the learning stage, a temporary graph structure is constructed for the operation information of each task, the graph structure is stored in a memory in a contiguous graph mode, and then the shortest path from the current page to each target page is calculated according to a shortest path algorithm, and in the process, the shortest path algorithm can help to delete nodes passing by loops, long paths and the like.
In the forgetting stage, a series of paths obtained in the learning stage are compared with paths in the target state transition diagram, and a longer path is rejected with a higher probability, and finally whether to replace an old path with a new path or directly reject the new path is determined according to the priority selection rule. Through the learning and forgetting processes, only a certain scale of ordered data in the state transition diagram along with the change of time is ensured, and along with the change of version, the data are effective data, so that invalid paths can be deleted in time.
Fig. 5 is a schematic diagram of an example pruning-based screening mechanism according to an embodiment of the present disclosure. Each letter represents a different target page, and different numbers represent different states of the target pages, and each target page only needs one path in the process of extracting the shortest path, so that the action of the dotted line and the relevant nodes in fig. 5 are not reserved, and only the action of the solid line and the relevant nodes are reserved. In the forgetting stage, if the number of paths in the state transition diagram exceeds a certain threshold, a new path is reserved or rejected according to priority, and a specific priority formula can be as follows Wherein the reject i To reject the summary of the ith pathRate, path i For the ith path, len (path i ) Is the length of the ith path, Σ is the sum symbol, and the probability of rejecting the ith path is the sum of the length of the ith path divided by the length of all paths. The path of the best possible segment can be preserved by this formula.
As can be seen from the above equation, the probability of a path being deleted or rejected is proportional to its length.
Through the steps, the redundant paths in the target state transition diagram can be deleted by constructing the temporary state transition diagram, so that the storage resources occupied by the target state transition diagram can be reduced.
Optionally, the method further comprises: responding to the test result that the current page does not jump to the target page successfully, and acquiring a preset node in the target path, wherein the preset node is a node corresponding to the page which passes through the current page and does not jump successfully in the process of jumping to the target page; adding a preset program to a preset page corresponding to the preset node to obtain an addition result, wherein the preset program is a program which does not depend on the target control to jump to the preset page; and testing the target path based on the addition result to obtain a test result.
The preset node may be a node with a jump failure.
In the target state transition diagram, a node may correspond to a page, when the current page jumps to the target page, a plurality of nodes may pass through, if there is a node that does not jump successfully, the node may be determined to be a preset node, a preset page corresponding to the preset node is obtained, the about preset page may be an intermediate page that needs to jump between the current page and the target page, and the preset page may also be the target page.
In an alternative embodiment, when the test result is that the current page does not successfully jump to the target page, a preset node with jump failure in the target path may be determined, a corresponding preset page with jump failure is determined based on the preset node, a page source code of the preset page may be obtained, and a preset program is added in the page source code, where the preset program may be a preset url schema (Uniformm Resource Locator schema, uniform resource locator).
The above-mentioned adding result may be a preset page to which a preset program is added, and the edge before the node corresponding to the preset page in the target path may be updated according to the adding result, that is, the operation relationship may be updated, and the operation relationship may be updated to directly jump to the preset page through the preset program, so as to update the target path, and the updated target path may be tested to obtain the test result.
Through the steps, the program can be added to the preset page with the jump failure, the jump is not needed according to the control, and the jump is carried out directly, so that the success rate of the target path test is improved.
Optionally, the method further comprises: acquiring target test cases and historical operation information, wherein the target test cases are pre-written and/or randomly generated skip relations between a third page and a fourth page, and the historical operation information is skip relations between the third page and the fourth page in the historical operation process; and constructing a target state transition diagram based on the target test case and/or the historical operation information.
The target test case can be the operation relation between page source codes and page jumps written in advance by a tester, the target test case can also be the jump relation between a third page and a fourth page which are randomly generated, and the historical operation information can be information reserved in the process of operating the pages by a user in a historical manner. The third page may be a start page, and the fourth page may be a target page that is finally reached.
Through the steps, the target state transition diagram can be constructed by using various types of data, so that the constructed target state transition diagram contains various rich contents, and the application range of the target state transition diagram is improved.
In an alternative embodiment, the target state transition diagram may be constructed by combining the target test case and the page source code of the historical operation information, and when there is a new test case or new operation information, the target state transition diagram may be updated by using the new test case or the new operation information.
Fig. 6 is a schematic diagram of a hybrid planning manner based on page source codes according to an embodiment of the present disclosure, where in the hybrid planning manner based on page source codes, a target test case may be built through a page unique identifier positioning position, a non-test case may be built according to a page unique identifier positioning position and a page positioning position associated with a control unique identifier, a target state transition diagram may be built according to the target test case, the target state transition diagram may be updated according to the non-test case, that is, the above-mentioned historical operation information, and when using the target state transition diagram, the unique identifier of the control, the user configuration information, the attribute information of the control, and the like may be matched through the target test case and the non-test case so as to determine the current page.
By the page testing method, labor of testers can be saved. In the process of testing the functions of the pages, a tester does not need to know how to reach the target page, repeatedly write the pre-steps, repeatedly operate the pre-steps, and pay attention to how to perform specific tests on the target page. The page testing method of the present disclosure may be performed automatically. No human intervention is needed before the target page is reached, and related instructions are judged by the strategy and sent to the testing machine for automatic execution. The page test method has wide application scenes, and the path planning can help the testers to quickly reach the target page to be tested, can be applied to automatic accurate test and path restoration of regression test cases, and has wide application scenes.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present disclosure may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present disclosure.
The disclosure further provides a page testing device, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 7 is a block diagram of a page testing apparatus according to an embodiment of the present disclosure, and as shown in fig. 7, a page testing apparatus 700 includes: an acquisition module 702, a path planning module 704, a testing module 706.
The acquisition module is used for acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page; the path planning module is used for planning paths of the current page and the target page based on the target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing the jump relation among different pages through a plurality of nodes and edges among adjacent nodes, each node among the plurality of nodes respectively represents a different page, and the edges among the adjacent nodes are used for representing the operation corresponding to the jump among the different pages; the testing module is used for testing the target path to obtain a testing result, wherein the testing result is used for indicating whether the current page successfully jumps to the target page.
Optionally, the path planning module includes: the device comprises an acquisition unit, a judging unit and a determining unit.
The acquisition unit is used for acquiring a first page identifier of the current page and a second page identifier of the target page; the judging unit is used for judging whether the target state transition diagram has a first page identifier and a second page identifier; the determining unit is used for determining a target path based on the first page identifier and the second page identifier in response to the existence of the first page identifier in the target state transition diagram.
Optionally, the determining unit includes: determining a subunit and acquiring the subunit.
The determining subunit is used for determining that the first page identifier is in a first node of the target state transition diagram; the determining subunit is further configured to determine that the second page identifier is at a second node of the target state transition diagram; the acquisition subunit is used for acquiring at least one path between the first node and the second node; the determining subunit is further configured to determine a shortest path of the at least one path as a target path.
Optionally, the apparatus further comprises: and the judging module and the determining module.
The acquisition module is further used for acquiring a first control identifier of the current page in response to the fact that the first page identifier does not exist in the target state transition diagram, wherein the first control identifier is an identifier of at least one control contained in the current page; the judging module is further used for judging whether a first page containing a first control identifier exists in the target state transition diagram, wherein a target path exists between the first page and the target page; the determining module is further configured to determine, in response to the target state transition diagram having the first page, that a third page identifier of the first page is the first page identifier.
Optionally, the obtaining module is further configured to obtain a control attribute of the current page in response to the target state transition diagram not having the first page identifier, where the control attribute is text information corresponding to at least one control included in the current page; the determining module is further configured to determine a second page based on the target state transition diagram and the control attribute, where a similarity between the control attribute included in the second page and the control attribute corresponding to the current page is greater than a preset similarity; the determining module is further configured to determine a fourth page identifier of the second page as the first page identifier.
Optionally, the apparatus further comprises: the device comprises a construction module, a comparison module and a replacement module.
The construction module is used for constructing a temporary state transition diagram based on the current page and the target page; the path planning module is also used for planning paths of the current page and the target page based on the temporary state transfer diagram to obtain a first path; the comparison module is also used for comparing the first path with the target path to obtain a comparison result, wherein the comparison result is used for indicating whether the first path is smaller than the target path or not; the replacing module is further configured to replace the target path in the target state transition diagram to be the first path in response to the comparison result being that the first path is smaller than the target path.
Optionally, the apparatus further comprises: and the adding module and the testing module.
The acquisition module is further used for acquiring preset nodes in the target path in response to the fact that the current page does not jump to the target page successfully as a result of the test, wherein the preset nodes are nodes corresponding to the page which does not jump successfully and passes through in the process of jumping the current page to the target page; the adding module is further used for adding a preset program to a preset page corresponding to the preset node to obtain an adding result, wherein the preset program is a program which does not depend on the target control to jump to the preset page; the test module is also used for testing the target path based on the addition result to obtain a test result.
Optionally, the obtaining module is further configured to obtain a target test case and historical operation information, where the target test case is a skip relation between a third page and a fourth page that are pre-written and/or randomly generated, and the historical operation information is a skip relation between the third page and the fourth page in a historical operation process; the building module is also used for building a target state transition diagram based on the target test cases and/or the historical operation information.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
According to an embodiment of the present disclosure, there is also provided an electronic device comprising a memory having stored therein computer instructions and at least one processor configured to execute the computer instructions to perform the steps of any of the method embodiments described above.
Optionally, the electronic device may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in the present disclosure, the above processor may be configured to perform the following steps by a computer program:
s1, acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page;
s2, planning paths of a current page and a target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation between different pages through a plurality of nodes and edges between adjacent nodes, each node in the plurality of nodes respectively represents a different page, and the edges between the adjacent nodes are used for representing operations corresponding to the jump between the different pages;
and S3, testing the target path to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
According to an embodiment of the present disclosure, the present disclosure also provides a non-transitory computer readable storage medium having stored therein computer instructions, wherein the computer instructions are configured to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described nonvolatile storage medium may be configured to store a computer program for performing the steps of:
s1, acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page;
s2, planning paths of a current page and a target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation between different pages through a plurality of nodes and edges between adjacent nodes, each node in the plurality of nodes respectively represents a different page, and the edges between the adjacent nodes are used for representing operations corresponding to the jump between the different pages;
and S3, testing the target path to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page.
Alternatively, in the present embodiment, the non-transitory computer readable storage medium described above may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product. Program code for carrying out embodiments of the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the foregoing embodiments of the present disclosure, the descriptions of the various embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a usb disk, a read-only memory (ROM), a random-access memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, etc., which can store program codes.
The foregoing is merely a preferred embodiment of the present disclosure, and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present disclosure, which are intended to be comprehended within the scope of the present disclosure.
Claims (12)
1. A method of page testing, comprising:
acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page, and the current page is a page for starting to skip;
performing path planning on the current page and the target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation between different pages through a plurality of nodes and edges between adjacent nodes, each node in the plurality of nodes respectively represents a different page, and the edges between the adjacent nodes are used for representing operations corresponding to the jump between the different pages;
testing the target path to obtain a test result, wherein the test result is used for indicating whether the current page successfully jumps to the target page;
the method for planning the path of the current page and the target page based on the target state transition diagram comprises the following steps:
Acquiring a first page identifier of the current page and a second page identifier of the target page;
judging whether the target state transition diagram has the first page identifier and the second page identifier or not;
determining the target path based on the first page identification and the second page identification in response to the target state transition diagram having the first page identification and the second page identification;
wherein, in response to the target state transition diagram not having the first page identification, the method further comprises:
acquiring a first control identifier of the current page, wherein the first control identifier is an identifier of at least one control contained in the current page;
judging whether a first page containing the first control identifier exists in the target state transition diagram, wherein the target path exists between the first page and the target page;
determining a third page identifier of the first page as the first page identifier in response to the first page existing in the target state transition diagram;
or alternatively, the first and second heat exchangers may be,
acquiring a control attribute of the current page, wherein the control attribute is text information corresponding to at least one control contained in the current page;
Determining a second page based on the target state transition diagram and the control attribute, wherein the similarity between the control attribute contained in the second page and the control attribute corresponding to the current page is greater than a preset similarity;
and determining a fourth page identifier of the second page as the first page identifier.
2. The method of claim 1, wherein determining the target path based on the first page identification and the second page identification comprises:
determining that the first page identifier is at a first node of the target state transition diagram;
determining a second node of the target state transition diagram of the second page identifier;
acquiring at least one path between the first node and the second node;
determining the shortest path in the at least one path as the target path.
3. The method of claim 1, wherein the method further comprises:
constructing a temporary state transition diagram based on the current page and the target page;
planning paths of the current page and the target page based on the temporary state transition diagram to obtain a first path;
comparing the first path with the target path to obtain a comparison result, wherein the comparison result is used for indicating whether the first path is smaller than the target path;
And in response to the comparison result that the first path is smaller than the target path, replacing the target path in the target state transition diagram as the first path.
4. The method of claim 1, wherein the method further comprises:
responding to the test result that the current page is not successfully jumped to the target page, and acquiring a preset node in the target path, wherein the preset node is a node corresponding to an unsuccessfully jumped page passing through in the process of the current page being jumped to the target page;
adding a preset program to a preset page corresponding to the preset node to obtain an addition result, wherein the preset program is a program which does not depend on a target control to jump to the preset page;
and testing the target path based on the adding result to obtain the testing result.
5. The method of claim 1, wherein the method further comprises:
acquiring a target test case and historical operation information, wherein the target test case is a skip relation between a third page and a fourth page which are pre-written and/or randomly generated, and the historical operation information is a skip relation between the third page and the fourth page in a historical operation process;
And constructing the target state transition diagram based on the target test case and/or the historical operation information.
6. A page testing apparatus, comprising:
the acquisition module is used for acquiring a current page and a target page, wherein the target page is a page to be skipped corresponding to the current page, and the current page is a page for starting to skip;
the path planning module is used for carrying out path planning on the current page and the target page based on a target state transition diagram to obtain a target path, wherein the target state transition diagram is used for representing a jump relation among different pages through a plurality of nodes and edges among adjacent nodes, each node among the plurality of nodes respectively represents a different page, and the edges among the adjacent nodes are used for representing operations corresponding to jumping among the different pages;
the test module is used for testing the target path to obtain a test result, wherein the test result is used for indicating whether the current page is successfully jumped to the target page;
wherein, the route planning module includes:
the acquisition unit is used for acquiring a first page identifier of the current page and a second page identifier of the target page;
The judging unit is used for judging whether the first page identifier and the second page identifier exist in the target state transition diagram;
a determining unit, configured to determine, in response to the target state transition diagram having the first page identifier and the second page identifier, the target path based on the first page identifier and the second page identifier;
wherein,,
the acquisition module is further configured to acquire a first control identifier of the current page in response to the target state transition diagram not having the first page identifier, where the first control identifier is an identifier of at least one control included in the current page;
the judging module is used for judging whether the target state transition diagram has a first page containing the first control mark, wherein the target path exists between the first page and the target page;
the determining module is further configured to determine, in response to the target state transition diagram having the first page, a third page identifier of the first page as the first page identifier;
wherein,,
the acquisition module is further configured to acquire a control attribute of the current page in response to the target state transition diagram not having the first page identifier, where the control attribute is text information corresponding to at least one control included in the current page;
The determining module is further configured to determine a second page based on the target state transition diagram and the control attribute, where a similarity between the control attribute included in the second page and the control attribute corresponding to the current page is greater than a preset similarity;
the determining module is further configured to determine a fourth page identifier of the second page as the first page identifier.
7. The apparatus of claim 6, wherein the determining unit comprises:
a determining subunit, configured to determine that the first page identifier is at a first node of the target state transition diagram;
the determining subunit is further configured to determine that the second page identifier is at a second node of the target state transition diagram;
an acquisition subunit configured to acquire at least one path between the first node and the second node;
the determining subunit is further configured to determine a shortest path of the at least one path as the target path.
8. The apparatus of claim 6, wherein the apparatus further comprises:
the construction module is used for constructing a temporary state transition diagram based on the current page and the target page;
the path planning module is used for planning paths of the current page and the target page based on the temporary state transition diagram to obtain a first path;
The comparison module is used for comparing the first path with the target path to obtain a comparison result, wherein the comparison result is used for indicating whether the first path is smaller than the target path or not;
and the replacing module is used for replacing the target path in the target state transition diagram to be the first path in response to the comparison result that the first path is smaller than the target path.
9. The apparatus of claim 6, wherein the apparatus further comprises:
the acquisition module is used for responding to the test result that the current page is not successfully jumped to the target page, and acquiring preset nodes in the target path, wherein the preset nodes are nodes corresponding to the page which is not successfully jumped and passes through in the process that the current page is jumped to the target page;
the adding module is used for adding a preset program to a preset page corresponding to the preset node to obtain an adding result, wherein the preset program is a program which does not depend on a target control to jump to the preset page;
and the test module is used for testing the target path based on the addition result to obtain the test result.
10. The apparatus of claim 8, wherein,
the acquisition module is further used for acquiring a target test case and historical operation information, wherein the target test case is a skip relation between a third page and a fourth page which are pre-written and/or randomly generated, and the historical operation information is a skip relation between the third page and the fourth page in a historical operation process;
the building module is further used for building the target state transition diagram based on the target test case and/or the historical operation information.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210679735.6A CN115098362B (en) | 2022-06-16 | 2022-06-16 | Page test method, page test device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210679735.6A CN115098362B (en) | 2022-06-16 | 2022-06-16 | Page test method, page test device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115098362A CN115098362A (en) | 2022-09-23 |
CN115098362B true CN115098362B (en) | 2023-04-28 |
Family
ID=83291101
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210679735.6A Active CN115098362B (en) | 2022-06-16 | 2022-06-16 | Page test method, page test device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115098362B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116756233B (en) * | 2023-08-23 | 2023-11-07 | 博智安全科技股份有限公司 | Situation data processing method and device, electronic equipment and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113032268A (en) * | 2021-03-30 | 2021-06-25 | 深圳市腾讯信息技术有限公司 | Software testing method, device and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5107131B2 (en) * | 2008-04-28 | 2012-12-26 | 株式会社東芝 | Test case generation device, generation method thereof, and program for test case generation |
CN109558307B (en) * | 2017-09-26 | 2022-03-22 | 卓望数码技术(深圳)有限公司 | Game program testing method and system |
CN109542776A (en) * | 2018-11-07 | 2019-03-29 | 北京潘达互娱科技有限公司 | Page comparison method, device and equipment |
CN111694756B (en) * | 2020-07-31 | 2023-05-23 | 北京字节跳动网络技术有限公司 | Application program testing method and device |
-
2022
- 2022-06-16 CN CN202210679735.6A patent/CN115098362B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113032268A (en) * | 2021-03-30 | 2021-06-25 | 深圳市腾讯信息技术有限公司 | Software testing method, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115098362A (en) | 2022-09-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107909330B (en) | Workflow data processing method and device, storage medium and computer equipment | |
CN107622008B (en) | Traversal method and device for application page | |
US20150067650A1 (en) | Test script generation | |
CN108959059A (en) | A kind of test method and test platform | |
CN110928802A (en) | Test method, device, equipment and storage medium based on automatic generation of case | |
CN113656315B (en) | Data testing method and device, electronic equipment and storage medium | |
CN111859047A (en) | Fault solving method and device | |
CN115098362B (en) | Page test method, page test device, electronic equipment and storage medium | |
CN110019067A (en) | A kind of log analysis method and system | |
CN111782317A (en) | Page testing method and device, storage medium and electronic device | |
CN108399125B (en) | Automatic testing method and device, computer equipment and storage medium | |
CN113918437B (en) | User behavior data analysis method, device, computer equipment and storage medium | |
CN110908907A (en) | Web page testing method, device, equipment and storage medium | |
CN107784548B (en) | Order processing method and device | |
CN109560964B (en) | Equipment compliance checking method and device | |
CN116340172A (en) | Data collection method and device based on test scene and test case detection method | |
CN113093702B (en) | Fault data prediction method and device, electronic equipment and storage medium | |
CN110838338A (en) | System, method, storage medium, and electronic device for creating biological analysis item | |
CN111160583B (en) | Data processing method and device | |
US20230053344A1 (en) | Scenario generation apparatus, scenario generation method, and computer-readablerecording medium | |
CN113761005A (en) | Metadata configuration method and device, electronic equipment and storage medium | |
CN112380116A (en) | Browser comparison test method and device and browser data forwarding method | |
CN112540820A (en) | User interface updating method and device and electronic equipment | |
CN107704484B (en) | Webpage error information processing method and device, computer equipment and storage medium | |
CN114371866A (en) | Version reconfiguration test method, device and equipment of service system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |