CN115934564A - User interface automation case generation method and related device - Google Patents

User interface automation case generation method and related device Download PDF

Info

Publication number
CN115934564A
CN115934564A CN202211683216.3A CN202211683216A CN115934564A CN 115934564 A CN115934564 A CN 115934564A CN 202211683216 A CN202211683216 A CN 202211683216A CN 115934564 A CN115934564 A CN 115934564A
Authority
CN
China
Prior art keywords
link
operation cycle
user
generating
user interface
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.)
Pending
Application number
CN202211683216.3A
Other languages
Chinese (zh)
Inventor
蒋灿
方鸿灏
黄赞群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Original Assignee
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hunan Happly Sunshine Interactive Entertainment Media Co Ltd filed Critical Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority to CN202211683216.3A priority Critical patent/CN115934564A/en
Publication of CN115934564A publication Critical patent/CN115934564A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

The invention discloses a method and a related device for generating an automatic user interface case, which are used for acquiring buried point data aiming at target application through a pre-constructed operation path buried point (SDK); generating the operation link corresponding to the operation cycle according to the data of each embedded point corresponding to the operation cycle and the operation link corresponding to the last operation cycle of the operation cycle aiming at any operation cycle after the first operation cycle of the user, wherein one operation cycle corresponds to one operation link; counting the occurrence frequency corresponding to each operation link, and determining the operation links with the occurrence frequency higher than a preset frequency threshold or with the occurrence frequency arranged at the top N bits; and generating a corresponding user interface automation case according to the determined data of each buried point corresponding to the operation link. The invention can automatically generate the user interface automatic use case without manual participation and has lower cost.

Description

User interface automation case generation method and related device
Technical Field
The invention relates to the field of front ends, in particular to a method and a related device for generating an automatic user interface case.
Background
In the field of software automation test, the current user interface automation case is mainly realized by manually positioning page elements and then manually compiling test scripts. This requires that the tester have programming capability, and the technical threshold for building user interface automation cases by writing codes is high, and the cost is high.
Disclosure of Invention
In view of the above, the present invention provides a method and related apparatus for generating a user interface automation use case, which overcomes or at least partially solves the above problems.
In a first aspect, a method for generating an automated use case for a user interface includes:
acquiring buried point data for a target application through a pre-constructed operation path buried point SDK, wherein the buried point data comprises data generated by a plurality of users performing corresponding user behaviors on the target application in a plurality of operation cycles, one user corresponds to at least one operation cycle, one operation cycle corresponds to a plurality of user behaviors, and one user behavior corresponds to one piece of buried point data;
aiming at a first operation period of any user, generating an operation link corresponding to the first operation period according to each buried point data corresponding to the first operation period;
generating the operation link corresponding to the operation cycle according to each buried point data corresponding to the operation cycle and the operation link corresponding to the last operation cycle of the operation cycle aiming at any operation cycle after the first operation cycle of the user, wherein one operation cycle corresponds to one operation link;
counting the occurrence frequency corresponding to each operation link, and determining the operation links with the occurrence frequency higher than a preset frequency threshold or the occurrence frequency arranged at the first N bits, wherein N is an integer greater than 1;
and generating a corresponding user interface automation case according to the determined data of each buried point corresponding to the operation link.
With reference to the first aspect, in some optional embodiments, after the root generates a corresponding user interface automation use case according to the determined data of each buried point corresponding to the operation link, the method further includes:
and saving the user interface automation use case to a use case library.
In combination with the previous embodiment, in some optional embodiments, after the saving the user interface automation use case to the use case library, the method further includes:
obtaining the user interface automation use case from the use case library;
analyzing the user interface automation case to obtain a corresponding executable script or data format;
executing the executable script or data format based on an automated test framework;
obtaining an execution result fed back by the automatic test framework;
and generating a test report corresponding to the user interface automation case according to the execution result.
With reference to the first aspect, in some optional implementations, the generating, for a first operation cycle of any one of the users, an operation link corresponding to the first operation cycle according to each buried point data corresponding to the first operation cycle includes:
and aiming at a first operation cycle of any user, generating a first shortest operation link corresponding to the first operation cycle according to parameters in each buried point data corresponding to the first operation cycle, wherein the first shortest operation link comprises a plurality of link nodes, one link node corresponds to one buried point data, each link node comprises a user behavior type parameter in the corresponding buried point data and a page element parameter in the corresponding buried point data, and the node sequence of each link node is matched with a user step bit sequence parameter in each corresponding buried point data.
With reference to the previous embodiment, in some optional embodiments, the generating, for any one of the operation cycles after the first operation cycle of the user, the operation link corresponding to the operation cycle according to each buried point data corresponding to the operation cycle and the operation link corresponding to the previous operation cycle of the operation cycle includes:
generating a second shortest operation link according to parameters in data of each embedded point corresponding to the operation cycle aiming at any operation cycle after the first operation cycle of the user;
and generating a complete third shortest operation link corresponding to the operation cycle according to the second shortest operation link and the operation link corresponding to the last operation cycle of the operation cycle.
With reference to the previous embodiment, in some optional embodiments, the generating, according to the second shortest operation link and the operation link corresponding to the last operation cycle of the operation cycle, a complete third shortest operation link corresponding to the operation cycle includes:
if a duplicate node exists in the link node included in the operation link corresponding to the previous operation cycle of the operation cycle and the link node included in the operation link included in the second shortest operation link, deleting the duplicate node from the second shortest operation link;
and splicing the second shortest operation link of which the repeated node is deleted and the operation link corresponding to the last operation cycle of the operation cycle to obtain a third shortest operation link.
With reference to the previous embodiment, in some optional embodiments, the generating a corresponding user interface automation use case according to the determined data of each buried point corresponding to the operation link includes:
and generating a corresponding user interface automation use case according to the determined buried point data corresponding to each link node included in the operation link, wherein the data structure of the user interface automation use case is consistent with the data structure of the buried point data.
In a second aspect, a user interface automation use case generating device includes: the device comprises a buried point data obtaining unit, a first link generating unit, a second link generating unit, a frequency counting unit and a use case generating unit;
the embedded point data obtaining unit is used for obtaining embedded point data for a target application through a pre-constructed operation path embedded point SDK, wherein the embedded point data comprises data generated by a plurality of users performing corresponding user behaviors on the target application in a plurality of operation cycles, one user corresponds to at least one operation cycle, one operation cycle corresponds to a plurality of user behaviors, and one user behavior corresponds to one embedded point data;
the first link generating unit is configured to generate, for a first operation cycle of any one of the users, an operation link corresponding to the first operation cycle according to the data of each embedded point corresponding to the first operation cycle;
the second link generation unit is configured to generate, for any one of the operation cycles after the first operation cycle of the user, the operation link corresponding to the operation cycle according to each buried point data corresponding to the operation cycle and the operation link corresponding to a previous operation cycle of the operation cycle, where one operation cycle corresponds to one operation link;
the frequency counting unit is used for counting the occurrence frequency corresponding to each operation link and determining the operation link with the occurrence frequency higher than a preset frequency threshold or the occurrence frequency arranged at the first N bits, wherein N is an integer greater than 1;
and the case generating unit is used for generating a corresponding user interface automation case according to the data of each buried point corresponding to the determined operation link.
In a third aspect, a computer-readable storage medium stores a program which, when executed by a processor, implements the method for generating a user interface automation use case of any one of the above.
In a fourth aspect, an electronic device comprises at least one processor, and at least one memory, bus, connected to the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke the program instructions in the memory to execute any of the above-described user interface automation use case generation methods.
By means of the technical scheme, the user interface automation use case generation method and the related device provided by the invention can obtain the buried point data for the target application through the pre-constructed operation path buried point SDK, wherein the buried point data comprises data generated by a plurality of users performing corresponding user behaviors on the target application in a plurality of operation cycles, one user corresponds to at least one operation cycle, one operation cycle corresponds to a plurality of user behaviors, and one user behavior corresponds to one piece of buried point data; aiming at a first operation period of any user, generating an operation link corresponding to the first operation period according to data of each buried point corresponding to the first operation period; generating the operation link corresponding to the operation cycle according to the data of each embedded point corresponding to the operation cycle and the operation link corresponding to the last operation cycle of the operation cycle aiming at any operation cycle after the first operation cycle of the user, wherein one operation cycle corresponds to one operation link; counting the occurrence frequency corresponding to each operation link, and determining the operation link with the occurrence frequency higher than a preset frequency threshold or the occurrence frequency arranged at the first N bits, wherein N is an integer greater than 1; and generating a corresponding user interface automation case according to the data of each buried point corresponding to the determined operation link. Therefore, the embedded point data can be obtained based on the operation path embedded point SDK, the embedded point data is analyzed to determine the operation link with frequent operation, and then the corresponding embedded point data is selected to construct the corresponding user interface automation case, so that manual participation is not needed, and the cost is low.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart of a method for generating a user interface automation use case provided by the invention;
FIG. 2 is a schematic diagram illustrating a data structure of buried point data provided by the present invention;
FIG. 3 is a flow diagram illustrating another method for automated use case generation for a user interface provided by the present invention;
FIG. 4 is a schematic structural diagram of a user interface automation use case generation apparatus provided in the present invention;
fig. 5 shows a schematic structural diagram of an electronic device provided by the invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
As shown in fig. 1, the present invention provides a method for generating an automated use case of a user interface, which includes: s100, S200, S300, S400, and S500;
s100, acquiring buried point data for a target application through a pre-constructed operation path buried point SDK, wherein the buried point data comprises data generated by a plurality of users performing corresponding user behaviors on the target application in a plurality of operation cycles, one user corresponds to at least one operation cycle, one operation cycle corresponds to a plurality of user behaviors, and one user behavior corresponds to one piece of buried point data;
optionally, the invention may pre-develop a general type native operation path embedded point SDK, and then access the SDK to the target application. After the target application is started, the SDK can report the current user operation to the execution main body of the invention through an interface, the execution main body of the invention can analyze reported massive buried point data through an intelligent algorithm, and select an operation path with the highest frequency of user operation as a core case in a UI automation case (user interface automation case).
It should be noted that: the native SDK provides a standardized interface for the target application, when user behaviors are generated in the target application, events are reported through the SDK native interface, corresponding parameters are obtained through event types by the native interface, and then an http interface is called internally to report data.
Optionally, the data format of the buried point data reported by the SDK is not specifically limited in the present invention. Generally speaking, the target application has a large number of users performing corresponding user actions thereon. Therefore, the invention can generate the unique corresponding user behavior ID when the user starts the target application. It should be noted that: the user behavior ID referred to in the present invention may include two parts, i.e., an ID prefix and an ID suffix. The generation rule of the user behavior ID is specifically as follows:
(1) The user starts the target application and generates a unique user behavior ID (the ID suffix at this time is null), which is unique throughout the target application lifecycle.
(2) When the user operates on the current page or operates on a lower-level page, the user behavior ID generated in the step (1) is transmitted and reported;
(3) When a user triggers a page returning operation for the first time, generating a new user behavior ID based on the user behavior ID generated in (1), namely, adding an ID suffix on the basis of the user behavior ID in (1) to obtain a user behavior ID such as "opening _1", wherein "opening" is the user behavior ID in (1) and "1" is the ID suffix added in (3);
(4) If the user starts the page returning operation again on the basis of (3), a user behavior ID such as "assistance _2" is generated, and the process is circulated. That is, the ID suffix matches the number of times the user triggers the page return operation, which is not limited by the present invention.
That is, the newly generated user behavior ID is returned with each user-triggered page return operation as the termination of the operation cycle. In the same starting period of the application, the newly generated user behavior ID uses the same ID prefix, and the purpose of this is to inherit the preorder steps after the target application is started, so as to analyze the independent and complete operation path. For example, the first operation procedure of the user is as follows: and starting the target application to the first page- > operating to the first-level page- > operating to the second-level page, assuming that the user behavior ID generated by starting the target application to the first page is "race", operating to the second-level page by the user on the premise of not triggering page return operation, wherein the user behavior IDs of the buried point data records corresponding to all the user behaviors are all "race". At this time, a complete operation path (corresponding to the user interface automation test case a) may be generated based on the buried point data of which all the user behavior IDs are "options". If the user executes the first page returning operation at this time, and returns the first page from the second page, the user behavior ID of the new embedded point data is "access _1", and at this time, another complete operation path (corresponding to the user interface automation test case B) can be generated from the embedded point data of which all the user behavior IDs are "access" and the user behavior ID is "access _1", which is not limited by the present invention.
S200, aiming at a first operation period of any user, generating an operation link corresponding to the first operation period according to data of each embedded point corresponding to the first operation period;
optionally, the first operation process (corresponding to the first operation cycle) of the user is: for example, when the target application is started to the first page- > operate to the first-level page- > operate to the second-level page, the link nodes of the generated operation link are: the link node of the target application to the first page, the link node operated to the first-level page, and the link node operated to the second-level page are started, which is not limited in the present invention.
In some optional embodiments, in combination with the embodiment shown in fig. 1, the S200 includes: step 1.1;
step 1.1, aiming at a first operation cycle of any user, generating a first shortest operation link corresponding to the first operation cycle according to parameters in each buried point data corresponding to the first operation cycle, wherein the first shortest operation link comprises a plurality of link nodes, one link node corresponds to one buried point data, each link node comprises a user behavior type parameter in the corresponding buried point data and a page element parameter in the corresponding buried point data, and the node sequence of each link node is matched with the user step bit sequence parameter in each corresponding buried point data.
Optionally, the buried point data in the present invention may include various parameters as shown in fig. 2, that is, include: user behavior ID, user behavior type, user step bit order, page element ID, page element Xpath, operation start coordinate, operation end coordinate, reserved extension field and other parameters. When the operation link is generated, the embedded data corresponding to each link node needs to be clarified, and then the user behavior type parameter, the user step bit sequence parameter and the page element parameter (page element ID or page element Xpath) of the corresponding embedded data are based on, wherein the sequence of each link node is set based on the user step bit sequence parameter, namely the sequence of each link node reflects the user step bit sequence parameter of the corresponding embedded data.
Based on the above, if two subsequent operation links are satisfied: 1. the number of link nodes is the same; 2. if the link nodes of the two operation links are consistent and the sequence is consistent, it may be determined that the two operation links are completely the same, that is, the number of occurrences of the operation link may be counted as 2 times.
S300, aiming at any operation period after the first operation period of the user, generating the operation link corresponding to the operation period according to each buried point data corresponding to the operation period and the operation link corresponding to the previous operation period of the operation period, wherein one operation period corresponds to one operation link;
optionally, the first operation process (corresponding to the first operation cycle) of the user is: launch target application to home page- > operate to level one page- > operate to level two page as an example. If the user triggers the page return operation on the second-level page, then the page return operation is performed to the first-level page, then the page return operation is performed to the second-level page, and then the page return operation is performed to the third-level page. That is, the second operation process (corresponding to the second operation cycle) executed by the user on the secondary page is as follows: return to level one page- > operate to level two page- > operate to level three page. At this time, the link nodes of the operation link generated for the second operation cycle are in turn: the starting target application is applied to the link node of the first page, the link node operated to the first-level page, the link node operated to the second-level page and the link node operated to the third-level page.
Similarly, for the operation link corresponding to the third operation cycle, it is also necessary to connect to the link node of the initial start-target application top page, thereby ensuring that each operation link starts from the link node of the start-target application top page.
That is, in combination with the previous embodiment, in some alternative embodiments, the S300 includes: step 2.1 and step 2.2;
2.1, aiming at any operation period after the first operation period of the user, generating a second shortest operation link according to parameters in data of each embedded point corresponding to the operation period;
alternatively, the link node included in the second shortest operation link described herein is established based on only the parameter of the buried point data of the operation cycle (for example, the second operation cycle). That is, the second shortest operation link is not started from the link node of the start target application to the top page, and therefore, a subsequent step needs to be performed to complete the concatenation of the operation links.
And 2.2, generating a complete third shortest operation link corresponding to the operation cycle according to the second shortest operation link and the operation link corresponding to the last operation cycle of the operation cycle.
In combination with the previous embodiment, in certain alternative embodiments, the step 2.2 includes: step 3.1 and step 3.2;
step 3.1, if a duplicate node exists in the link nodes included in the operation links corresponding to the link node included in the second shortest operation link and the last operation cycle of the operation cycle, deleting the duplicate node from the second shortest operation link;
optionally, as mentioned above, the different operation cycles are divided based on page return operation, and the page return operation is generally to return to a page that has been operated to before. That is, the buried point data for the subsequent operation cycle is generally overlapped with the buried point data for the previous operation cycle. Therefore, the operation link corresponding to the following operation cycle and the operation link corresponding to the previous operation cycle generally have repeated link nodes, and in order to obtain the shortest operation link, the present invention may reserve the shortest link of the previous operation cycle, and then splices a new link node in the present operation cycle, which is not limited by the present invention.
And 3.2, splicing the second shortest operation link with the deleted repeated node and the operation link corresponding to the last operation cycle of the operation cycle to obtain the third shortest operation link.
It should be noted that: and the link node corresponding to the page returning operation is not reflected in the shortest operation link in the corresponding life cycle. That is, the shortest operation link corresponding to each new operation cycle is the shortest operation link that inherits the last operation cycle, and after the node data corresponding to the page return operation is deleted, the shortest operation link of the current operation cycle is generated. For example, when the third shortest operation link is spliced, the link node corresponding to the page return operation is deleted, that is, there is no node data corresponding to the page return operation in the third shortest operation link.
S400, counting the occurrence frequency corresponding to each operation link, and determining the operation link with the occurrence frequency higher than a preset frequency threshold or the occurrence frequency arranged at the first N bits, wherein N is an integer greater than 1;
optionally, the present invention may count the occurrence frequency of the operation links in which the number of the link nodes is the same, the link nodes completely recur, and the sequence of the link nodes is completely consistent, or may directly count the occurrence frequency. And then selecting the operation link with higher frequency of occurrence or more frequency of occurrence as the operation link required by the subsequent generation of the user interface automation use case.
The preset frequency threshold and the preset frequency N are not particularly limited and can be set according to actual needs.
And S500, generating a corresponding user interface automation case according to the determined data of each buried point corresponding to the operation link.
Optionally, the method and the device can generate the corresponding user interface automation case based on the buried point data corresponding to each link node of the operation link. That is, in combination with the previous embodiment, in some alternative embodiments, the S500 includes: step 4.1;
and 4.1, generating a corresponding user interface automation case according to the determined buried data corresponding to each link node included in the operation link, wherein the data structure of the user interface automation case is consistent with that of the buried data.
Optionally, as described above, when an operation link is generated, sometimes a deduplication needs to be performed on a link node, and then buried data corresponding to each link node of the operation link is also buried data after the deduplication, so that user step bit sequence parameters in the buried data corresponding to each link node of the operation link may be discontinuous, and therefore, other parameters in the buried data are directly used in the present invention, but the user step bit sequence parameters in each buried data need to be adjusted to be continuous in a user interface automation case, which is not limited by the present invention.
Optionally, with reference to the embodiment shown in fig. 1, in some optional embodiments, after S500, the method further includes: step 5.1;
and 5.1, storing the user interface automation case to a case library.
Optionally, in combination with the previous embodiment, in certain optional embodiments, after the step 5.1, the method further includes: step 6.1, step 6.2, step 6.3, step 6.4 and step 6.5;
6.1, obtaining the user interface automation case from the case library;
optionally, the present invention may obtain the user interface automation use case from the use case library through the execution engine, which is not limited in this regard.
6.2, analyzing the user interface automation case to obtain a corresponding executable script or data format;
optionally, the execution engines of different automation frames have different conditions for running the user interface automation use case, so that the user interface automation use case can be analyzed to obtain a corresponding execution script or data format based on the automation frames of the execution engines. For example, for an execution engine integrated with an appium automation framework, the execution engine can run through set code setting after taking a user interface automation case without being converted into an additional executable script; for an execution engine integrated with a robotframe automation frame, after a user interface automation case is taken, the execution engine needs to be converted into an executable script driven by a keyword, and then a script file is executed through the frame.
6.3, executing the executable script or the data format based on an automatic test framework;
6.4, obtaining an execution result fed back by the automatic testing framework;
optionally, the invention may listen to the execution results of the automation framework through the report parser. For example, the report analyzer may synchronize the ui automation case and the execution result to the report analyzer every time the execution engine completes one ui automation case by providing a callback interface to the execution engine.
And 6.5, generating a test report corresponding to the user interface automation case according to the execution result.
Optionally, the report analyzer may analyze and display the data on the test report page through the data transmitted by the execution engine callback interface, and make a more concise and understandable analysis and display on the test report page with the result of the execution failure.
Optionally, for more clearly describing the above-mentioned scheme of the present invention, please refer to the execution flow shown in fig. 3, which is not described in detail herein.
As shown in fig. 4, the present invention provides a user interface automation use case generating device, including: a buried point data obtaining unit 100, a first link generating unit 200, a second link generating unit 300, a frequency statistics unit 400, and a use case generating unit 500;
the embedded point data obtaining unit 100 is configured to obtain embedded point data for a target application through a pre-constructed operation path embedded point SDK, where the embedded point data includes data generated by performing corresponding user behaviors on the target application in multiple operation cycles by multiple users, one user corresponds to at least one operation cycle, one operation cycle corresponds to multiple user behaviors, and one user behavior corresponds to one piece of embedded point data;
the first link generation unit 200 is configured to generate, for a first operation cycle of any one of the users, an operation link corresponding to the first operation cycle according to the data of each embedded point corresponding to the first operation cycle;
the second link generating unit 300 is configured to generate, for any one operation cycle after the first operation cycle of the user, the operation link corresponding to the operation cycle according to each buried point data corresponding to the operation cycle and the operation link corresponding to the previous operation cycle of the operation cycle, where one operation cycle corresponds to one operation link;
the frequency counting unit 400 is configured to count occurrence frequencies corresponding to the operation links, and determine an operation link of which the occurrence frequency is higher than a preset frequency threshold or is ranked at the first N bits of the occurrence frequency, where N is an integer greater than 1;
the use case generating unit 500 is configured to generate a corresponding user interface automation use case according to the determined data of each buried point corresponding to the operation link.
In some alternative embodiments, in combination with the embodiment shown in fig. 4, the apparatus further comprises: a use case storage unit;
and the case storage unit is used for storing the user interface automation case to a case library after generating a corresponding user interface automation case according to the determined data of each buried point corresponding to the operation link.
In combination with the above embodiment, in some optional embodiments, the apparatus further comprises: the device comprises a case obtaining unit, a case analyzing unit, a test executing unit, a result obtaining unit and a report generating unit;
the use case obtaining unit is used for obtaining the user interface automation use case from the use case library after the user interface automation use case is stored in the use case library;
the case analysis unit is used for analyzing the user interface automation case to obtain a corresponding executable script or data format;
the test execution unit is used for executing the executable script or the data format based on an automatic test framework;
the result obtaining unit is used for obtaining the execution result fed back by the automatic testing framework;
and the report generating unit is used for generating a test report corresponding to the user interface automation case according to the execution result.
In some optional embodiments, in combination with the embodiment shown in fig. 4, the first link generating unit 200 includes: a first link generation subunit;
the first link generation subunit is configured to generate, for a first operation cycle of any one of the users, a first shortest operation link corresponding to the first operation cycle according to a parameter in each embedded data corresponding to the first operation cycle, where the first shortest operation link includes multiple link nodes, one link node corresponds to one embedded data, each link node includes a user behavior type parameter in the embedded data and a page element parameter in the embedded data, and a node sequence of each link node matches a user step bit sequence parameter in each embedded data.
With reference to the previous embodiment, in some optional embodiments, the second link generating unit 300 includes: a second link generating subunit and a third link generating subunit;
the second link generation subunit is configured to generate, for any one of the operation cycles subsequent to the first operation cycle of the user, a second shortest operation link according to a parameter in each buried point data corresponding to the operation cycle;
and the third link generation subunit is configured to generate, according to the second shortest operation link and the operation link corresponding to the previous operation cycle of the operation cycle, a complete third shortest operation link corresponding to the operation cycle.
With reference to the previous embodiment, in some optional embodiments, the third link generation subunit includes: the node deleting subunit and the fourth link generating subunit;
the node deletion subunit is configured to delete a duplicate node from the second shortest operation link if the link node included in the second shortest operation link and the link node included in the operation link corresponding to the last operation cycle of the operation cycle have the duplicate node;
and the fourth link generation subunit is configured to splice the second shortest operation link from which the duplicate node is deleted and the operation link corresponding to the previous operation cycle of the operation cycle, to obtain the third shortest operation link.
With reference to the previous embodiment, in some optional embodiments, the use case generating unit 500 includes: a use case generating subunit;
the case generating subunit is configured to generate a corresponding user interface automation case according to the embedded data corresponding to each link node included in the determined operation link, where a data structure of the user interface automation case is consistent with a data structure of the embedded data.
The invention provides a computer readable storage medium, on which a program is stored, wherein the program is executed by a processor to realize the user interface automation case generation method.
As shown in fig. 5, the present invention provides an electronic device 70, wherein the electronic device 70 includes at least one processor 701, at least one memory 702 connected to the processor 701, and a bus 703; the processor 701 and the memory 702 complete communication with each other through the bus 703; the processor 701 is configured to call the program instructions in the memory 702 to execute any of the above-described methods for generating a user interface automation use case.
In the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A user interface automation use case generation method is characterized by comprising the following steps:
acquiring buried point data for a target application through a pre-constructed operation path buried point SDK, wherein the buried point data comprises data generated by a plurality of users performing corresponding user behaviors on the target application in a plurality of operation cycles, one user corresponds to at least one operation cycle, one operation cycle corresponds to a plurality of user behaviors, and one user behavior corresponds to one buried point data;
aiming at a first operation period of any user, generating an operation link corresponding to the first operation period according to each buried point data corresponding to the first operation period;
generating the operation link corresponding to the operation cycle according to each buried point data corresponding to the operation cycle and the operation link corresponding to the last operation cycle of the operation cycle aiming at any operation cycle after the first operation cycle of the user, wherein one operation cycle corresponds to one operation link;
counting the occurrence frequency corresponding to each operation link, and determining the operation link with the occurrence frequency higher than a preset frequency threshold or the occurrence frequency arranged at the first N bits, wherein N is an integer greater than 1;
and generating a corresponding user interface automation case according to the data of each buried point corresponding to the determined operation link.
2. The method of claim 1, wherein after the root generates the corresponding user interface automation use case according to the determined buried point data corresponding to the operation link, the method further comprises:
and saving the user interface automation use case to a use case library.
3. The method of claim 2, wherein after the saving the user interface automation use case to a use case library, the method further comprises:
obtaining the user interface automation use case from the use case library;
analyzing the user interface automation case to obtain a corresponding executable script or data format;
executing the executable script or data format based on an automated test framework;
obtaining an execution result fed back by the automatic test framework;
and generating a test report corresponding to the user interface automation case according to the execution result.
4. The method according to claim 1, wherein the generating an operation link corresponding to the first operation cycle according to the data of each buried point corresponding to the first operation cycle for the first operation cycle of any one of the users comprises:
and aiming at a first operation cycle of any user, generating a first shortest operation link corresponding to the first operation cycle according to parameters in each buried point data corresponding to the first operation cycle, wherein the first shortest operation link comprises a plurality of link nodes, one link node corresponds to one buried point data, each link node comprises a user behavior type parameter in the corresponding buried point data and a page element parameter in the corresponding buried point data, and the node sequence of each link node is matched with the user step bit sequence parameter in each corresponding buried point data.
5. The method according to claim 4, wherein the generating the operation link corresponding to the operation cycle according to each buried point data corresponding to the operation cycle and the operation link corresponding to the previous operation cycle of the operation cycle for any one of the operation cycles after the first operation cycle of the user comprises:
generating a second shortest operation link according to parameters in data of each embedded point corresponding to the operation cycle aiming at any operation cycle after the first operation cycle of the user;
and generating a complete third shortest operation link corresponding to the operation cycle according to the second shortest operation link and the operation link corresponding to the last operation cycle of the operation cycle.
6. The method according to claim 5, wherein the generating a complete third shortest operation link corresponding to the operation cycle according to the second shortest operation link and the operation link corresponding to the previous operation cycle of the operation cycle comprises:
if a duplicate node exists in the link node included in the operation link corresponding to the previous operation cycle of the operation cycle and the link node included in the operation link included in the second shortest operation link, deleting the duplicate node from the second shortest operation link;
and splicing the second shortest operation link with the deleted repeated node and the operation link corresponding to the last operation cycle of the operation cycle to obtain the third shortest operation link.
7. The method of claim 6, wherein the generating a corresponding user interface automation use case according to the determined buried point data corresponding to the operation link comprises:
and generating a corresponding user interface automation use case according to the determined buried point data corresponding to each link node included in the operation link, wherein the data structure of the user interface automation use case is consistent with the data structure of the buried point data.
8. A user interface automation use case generation apparatus, comprising: the device comprises a buried point data obtaining unit, a first link generating unit, a second link generating unit, a frequency counting unit and a use case generating unit;
the embedded point data obtaining unit is used for obtaining embedded point data for a target application through a pre-constructed operation path embedded point SDK, wherein the embedded point data comprises data generated by a plurality of users performing corresponding user behaviors on the target application in a plurality of operation cycles, one user corresponds to at least one operation cycle, one operation cycle corresponds to a plurality of user behaviors, and one user behavior corresponds to one embedded point data;
the first link generation unit is used for generating an operation link corresponding to a first operation period according to the data of each embedded point corresponding to the first operation period aiming at the first operation period of any user;
the second link generation unit is configured to generate, for any one of the operation cycles after the first operation cycle of the user, the operation link corresponding to the operation cycle according to each buried point data corresponding to the operation cycle and the operation link corresponding to a previous operation cycle of the operation cycle, where one operation cycle corresponds to one operation link;
the frequency counting unit is used for counting the occurrence frequency corresponding to each operation link and determining the operation link with the occurrence frequency higher than a preset frequency threshold or the occurrence frequency arranged at the first N bits, wherein N is an integer greater than 1;
and the case generating unit is used for generating a corresponding user interface automation case according to the data of each embedded point corresponding to the determined operation link.
9. A computer-readable storage medium on which a program is stored, the program, when executed by a processor, implementing a user interface automation use case generation method according to any one of claims 1 to 7.
10. An electronic device comprising at least one processor, and at least one memory, bus connected to the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform the user interface automation use case generation method of any of claims 1 to 7.
CN202211683216.3A 2022-12-27 2022-12-27 User interface automation case generation method and related device Pending CN115934564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211683216.3A CN115934564A (en) 2022-12-27 2022-12-27 User interface automation case generation method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211683216.3A CN115934564A (en) 2022-12-27 2022-12-27 User interface automation case generation method and related device

Publications (1)

Publication Number Publication Date
CN115934564A true CN115934564A (en) 2023-04-07

Family

ID=86652478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211683216.3A Pending CN115934564A (en) 2022-12-27 2022-12-27 User interface automation case generation method and related device

Country Status (1)

Country Link
CN (1) CN115934564A (en)

Similar Documents

Publication Publication Date Title
CN109388403B (en) Dependency injection method, device, equipment and storage medium
US20080120601A1 (en) Information processing apparatus, method and program for deciding priority of test case to be carried out in regression test background of the invention
CN109189469B (en) Reflection-based android application micro-servitization method and system
CN111061643B (en) SDK cluster compatibility detection method and device, electronic equipment and storage medium
CN109240666B (en) Function calling code generation method and system based on call stack and dependent path
CN107783766B (en) Method and device for cleaning files of application program
CN110543427B (en) Test case storage method and device, electronic equipment and storage medium
CN112154420A (en) Automatic intelligent cloud service testing tool
CN104679500B (en) Method and device for realizing automatic generation of entity class
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
CN111190573A (en) Application program point burying method and device and electronic equipment
CN107038117B (en) Web automatic testing method based on definition-reference between event processing functions
CN111679852A (en) Detection method and device for conflict dependency library
CN115934564A (en) User interface automation case generation method and related device
CN112084108A (en) Test script generation method and device and related components
CN109189468B (en) Examination and approval data source configuration access and XML mapping configuration system
CN116702668A (en) Regression testing method and device, electronic equipment and storage medium
Boucher et al. Transforming workflow models into automated end-to-end acceptance test cases
Dugerdil et al. Dynamic decision tree for legacy use-case recovery
CN112799673B (en) Network protocol data checking method and device
CN115454860A (en) Automatic testing method and device, storage medium and electronic equipment
CN115185535A (en) Dependency relationship display method and device, storage medium and electronic equipment
CN110032366B (en) Code positioning method and device
CN110738384B (en) Event sequence checking method and system
CN113326046A (en) Method and device for acquiring compiling time length

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