CN113535587A - Target application detection method and device and computer equipment - Google Patents

Target application detection method and device and computer equipment Download PDF

Info

Publication number
CN113535587A
CN113535587A CN202110908077.9A CN202110908077A CN113535587A CN 113535587 A CN113535587 A CN 113535587A CN 202110908077 A CN202110908077 A CN 202110908077A CN 113535587 A CN113535587 A CN 113535587A
Authority
CN
China
Prior art keywords
test
target application
objects
task
identification information
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.)
Granted
Application number
CN202110908077.9A
Other languages
Chinese (zh)
Other versions
CN113535587B (en
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202110908077.9A priority Critical patent/CN113535587B/en
Publication of CN113535587A publication Critical patent/CN113535587A/en
Application granted granted Critical
Publication of CN113535587B publication Critical patent/CN113535587B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

After an object model of a target application is built, for different test tasks (such as a content submission function, a positioning text input box and the like) of the target application, test objects are determined in a targeted manner, namely the test objects aiming at the test tasks are screened from the objects contained in the object model, then the change of an application version is determined by using the change condition of attribute identification information of each test object, the change detection of the attribute identification information of a global object is not needed, the controllability and adjustability of detection granularity are realized, the consumption of storage space and computing resources of the computer equipment in the detection process is reduced, the performance of the computer equipment is ensured, and the detection efficiency and the accuracy are improved.

Description

Target application detection method and device and computer equipment
Technical Field
The present application relates to the field of software engineering technologies, and in particular, to a method and an apparatus for detecting a target application, and a computer device.
Background
In practical applications, various application programs on computer equipment such as mobile phones, computers, smart home equipment and the like are often released with corresponding new version applications at intervals, and function expansion, optimization or repair of the application programs is realized by upgrading the application versions.
With reference to the login page of the HR talent information entry system of different application versions of a certain enterprise management website shown in fig. 1a and 1b, version information such as display content of some application pages and an implementation path of a certain function may be changed along with the upgrade of the application version. Thus, when the application program needs to be structurally analyzed, a certain function test is performed, a fault is monitored, and other tasks, the change of the application version may cause the task script to fail to operate, which may cause great loss and overhead.
Disclosure of Invention
In view of the above, in order to solve the above technical problems, the present application provides the following technical solutions:
in one aspect, the present application provides a target application detection method, including:
acquiring an object model of a target application;
screening out a test object aiming at the test task of the target application from objects contained in the object model;
obtaining attribute identification information of the test object according to the dependency relationship among different test objects; the attribute identification information of any test object can represent the key attribute of the test object and the key attribute of the test object on which the test object depends;
and determining whether the target application has a version change or not based on the change detection result of the attribute identification information of the test object.
Optionally, the screening out a test object of the test task for the target application from the objects included in the object model includes:
acquiring a key test object configured for the test task of the target application; the key test object is at least one object in the object model;
according to the dependency relationship among different objects in the object model and the validity marks aiming at the test task of the different objects, pruning all the objects contained in the object model to obtain an application detection model aiming at the test task;
wherein the application detection model comprises test objects aiming at the test task, and a dependency relationship exists between different test objects.
Optionally, the object model is a document object model DOM tree, and the object is a node in the DOM tree; the pruning processing is performed on each object included in the object model according to the dependency relationship between different objects in the object model and the validity marks of the different objects for the test task to obtain an application detection model for the test task, and the method includes:
performing node pruning on each path contained in the DOM tree according to the dependency relationship of a father node in the DOM tree on the child nodes and the validity marks of each node aiming at the test task to obtain a target path containing the key test object;
forming a DOM sub-tree for the test task by the target path; and each node in the DOM subtree is a test object of the test task.
Optionally, the object model is a document object model DOM tree, and the object is a node in the DOM tree; the pruning processing is performed on each object included in the object model according to the dependency relationship between different objects in the object model and the validity marks of the different objects for the test task to obtain an application detection model for the test task, and the method includes:
obtaining validity marks of all nodes in the DOM tree aiming at the test tasks; the validity marks comprise invalid marks used for indicating that the corresponding nodes do not influence the normal operation of the test task, and valid marks used for indicating that the corresponding nodes influence the normal operation of the test task;
and according to the dependency relationship of the father node and the child nodes in the DOM tree, removing the nodes which have the invalid marks with the dependent child nodes in the DOM tree to obtain a DOM sub-tree in the DOM tree for the test task.
Optionally, the obtaining attribute identification information of the test object according to the dependency relationship between different test objects includes:
acquiring respective key attributes of different test objects;
detecting whether a second test object which depends on the first test object exists; the first test object is any one of the test objects;
if the first test object does not exist, generating attribute identification information of the first test object by using the key attribute of the first test object;
and if so, generating the attribute identification information of the first test object by using the key attribute of the first test object and the attribute identification information of the second test object.
Optionally, the determining whether the version of the target application is changed based on the change detection result of the attribute identification information of the test object includes:
acquiring original attribute identification information of different test objects; the original attribute identification information is obtained by the corresponding test object during the last running period of the target application;
detecting the attribute identification information of different test objects, and whether the attribute identification information is consistent with the original attribute identification information of the corresponding test object;
if the detection results are consistent, determining that the version of the target application is not changed, triggering the target application to execute the test task, and outputting the obtained task test result;
and if the inconsistent detection result exists, determining that the version of the target application is changed.
Optionally, the method further includes:
determining target configuration information influencing normal operation of the test task in the target application by using the test objects with inconsistent detection results;
and outputting application version change prompt information containing the target configuration information.
Optionally, the obtaining of the respective key attributes of the different test objects includes:
inquiring respective key attributes of different test objects from key attributes of each object in the pre-configured object model;
and the key attributes of each object in the object model are configured by responding to configuration operation input by a user for the test task or based on the logic function of each object in the object model in the target application.
In another aspect, the present application further provides a target application detection apparatus, including:
the object model acquisition module is used for acquiring an object model of the target application;
the test object screening module is used for screening out a test object of a test task aiming at the target application from objects contained in the object model;
the attribute identification information acquisition module is used for acquiring the attribute identification information of the test object according to the dependency relationship among different test objects; the attribute identification information of any test object can represent the key attribute of the test node and the key attribute of the test node on which the test node depends;
and the version change detection module is used for determining whether the target application has a version change or not based on the change detection result of the attribute identification information of the test object.
In yet another aspect, the present application further proposes a computer device, comprising: at least one memory and at least one processor, wherein:
the memory is used for storing the program of the target application detection method;
the processor is configured to load and execute the program of the memory to implement the target application detection method as described above.
Therefore, after an object model of a target application is constructed, for different test tasks (such as a content submission function, a positioning text input box and the like) of the target application, the method and the device for detecting the target application determine the test objects in a targeted manner, namely, the test objects aiming at the test tasks are screened from the objects contained in the object model, then, the change of the application version is determined by using the change condition of the attribute identification information of each test object, the change detection of the attribute identification information of the global object is not needed, the detection granularity is controllable and adjustable, the storage space and the consumption of computing resources of the computer equipment in the detection process are reduced, the performance of the computer equipment is ensured, and the detection efficiency and the accuracy are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1a is a schematic view of a page of a test task of an application;
FIG. 1b is a schematic view of a page of yet another test task for an application;
fig. 2 is a schematic hardware structure diagram of an alternative example of a computer device suitable for the target application detection method proposed in the present application;
fig. 3 is a schematic hardware configuration diagram of still another alternative example of a computer device suitable for the target application detection method proposed in the present application;
fig. 4 is a schematic flowchart of an alternative example of the target application detection method proposed in the present application;
fig. 5 is a schematic flowchart of yet another alternative example of the target application detection method proposed in the present application;
fig. 6 is a schematic flowchart of yet another alternative example of the target application detection method proposed in the present application;
fig. 7 is a schematic structural diagram of a DOM tree of a target application constructed in the target application detection method provided by the present application;
fig. 8 is a schematic view of a scene of a test task to be executed by a target application in the target application detection method provided in the present application;
FIG. 9 is a schematic structural diagram of a DOM sub-tree constructed for a test task in the target application detection method provided by the present application;
fig. 10 is a schematic flowchart of yet another alternative example of the target application detection method proposed in the present application;
fig. 11 is a schematic structural diagram of an alternative example of the target application detection apparatus proposed in the present application;
fig. 12 is a schematic structural diagram of yet another alternative example of the target application detection apparatus proposed in the present application.
Detailed Description
For the technical problems described in the background technology, the application proposes to detect whether the version of an application program (such as various types of websites and the like) is changed before the application program runs a certain test task, whether the change affects the normal running of the test task to cause the script running failure of the test task or reduce the accuracy of the test result of the test task, and the like, and the application program version is detected to determine that the version of the application program is not changed and the test task can be directly run; on the contrary, if the version of the application program is changed, whether the test task can be directly operated or not can be judged according to the change content represented by the detection result, if the problem occurs in the direct operation, technicians can adaptively adjust the script content of the test task to enable the script content to be adaptive to the application program of the current version, and therefore the reliability of the operation result of the test task is guaranteed.
For the version change detection method of the application program, the current source code of the application program and the source code of the application program which is operated last time can be compared and analyzed to determine whether the version of the application program is changed. However, the source code comparison method is prone to misjudgment of the detection result of the version change of the application program due to the change of a space, a comma and the like, and the consumption of the comparison method on the storage space and the computing capability of the computer device is large due to the large content of the source code.
In addition, in the running process of different test tasks, the test contents of the application program are often different, which means that the normal running of the test task is not interfered by any change content of the application program, but the monitoring granularity of the version change of the application program cannot be adjusted by the source code comparison mode, so that the individualized detection cannot be realized for different test tasks, and the detection efficiency is improved while the version change detection requirement is met.
In order to further solve the above problem, the present application proposes to analyze the influence of each object included in an object model of an application on different test tasks, that is, to obtain test objects required by the operation of different test tasks, so that the detection of the version change of the application can be implemented according to the test objects and the configuration information thereof, and more specifically, whether the application has a version change affecting the normal operation of the test task can be detected, and thus, according to the detection result, it is determined whether to directly operate the test task on the application, or to adjust the test task or the corresponding configuration information of the application, and the like.
Therefore, the method and the device can realize the change detection of the application program version before the application program runs the test task to avoid the version change from interfering the running of the test task and reduce the test result, and can realize targeted analysis on the test object in the application program aiming at different test tasks, namely, the thickness of the monitoring granularity of the application program version change can be adjusted, the dependence and consumption of the detection process on the storage space and the computing resources of the computer equipment are reduced, and the detection efficiency and the accuracy are improved.
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments, that is, for convenience of description, only the parts related to the related inventions are shown in the drawings, and the embodiments and features in the embodiments in the present application may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that "system", "apparatus", "unit" and/or "module" as used herein is a method for distinguishing different components, elements, parts or assemblies at different levels. However, other words may be substituted by other expressions if they accomplish the same purpose.
It should be noted that, as used herein, the terms "a," "an," "the," and/or "the" are not intended to be limiting, and include the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements. An element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two. The terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
Additionally, flow charts are used herein to illustrate operations performed by systems according to embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in the exact order in which they are performed. Rather, the various steps may be processed in reverse order or simultaneously. Meanwhile, other operations may be added to the processes, or a certain step or several steps of operations may be removed from the processes.
Referring to fig. 2, a schematic diagram of a hardware structure of an optional example of a computer device suitable for the target application detection method proposed in the present application is shown, where the computer device may be a terminal or a server, and the terminal may include, but is not limited to, a smart phone, a tablet computer, a wearable device, a smart watch, an Augmented Reality (AR) device, a Virtual Reality (VR) device, an in-vehicle device, a robot, a desktop computer, and the like; the server can be a single physical server, can also be a server cluster formed by a plurality of physical servers, can also be a cloud server capable of realizing cloud computing and the like.
As shown in fig. 2, the computer device in any application scenario may include: at least one memory 11 and at least one processor 12, wherein:
the memory 11 may be used to store a program for implementing the target application detection method proposed in the present application; the processor 12 may be configured to load and execute the program stored in the memory to implement the target application detection method according to the embodiment of the present application, and the specific implementation process may refer to, but is not limited to, the description of the corresponding part of the method embodiment below.
In the embodiment of the present application, the memory 11 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage devices. The processor 12 may be a Central Processing Unit (CPU), an application-specific integrated circuit (ASIC), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic device.
In one possible implementation, the memory 11 may include a program storage area and a data storage area, and the program storage area may store program codes supporting the operation of various application programs, programs implementing the target application detection method proposed in the present application, and the like; the data storage area may store data generated during the use of the computer device, such as various data generated by the running of an application program, relevant configuration information of a test task, and the like, as the case may be, and will not be described in detail herein.
It should be understood that the structure of the computer device shown in fig. 2 is not limited to the computer device in the embodiment of the present application, and in practical applications, the computer device may include more components than those shown in fig. 2, or some components may be combined. If the computer device is the terminal, as shown in fig. 3, the computer device may further include various communication interfaces, such as data interfaces of communication modules, such as a WIFI module, a 5G/6G (fifth generation mobile communication network/sixth generation mobile communication network) module, and a GPRS module, which can implement data interaction with other devices by using a wireless communication network, and data interfaces, such as a USB interface, a serial/parallel interface, and the like, which implement data interaction between internal components of the computer device.
In addition, the computer device may further include at least one input device such as a touch sensing unit for sensing a touch event on the touch display panel, a keyboard, a mouse, a camera, a sound pickup, and the like, at least one output device such as a display, a speaker, a vibration mechanism, a lamp, and the like, and a power management module, a sensor module including various sensors, an antenna, and the like, the computer device shown in fig. 3 does not show the input devices and the output devices listed in this embodiment, and the structural composition of the computer device is not limited to the components listed in this embodiment, and may be determined according to the device type and the function thereof, which is not listed in this application.
Referring to fig. 4, a schematic flowchart of an optional example of the target application detection method provided in the present application, where the method may be executed by the computer device, and a scenario in which a terminal executes the target application detection method in the embodiment of the present application is taken as an example, as shown in fig. 4, the method may include:
step S11, obtaining an object model of the target application;
in the embodiment of the present application, the target application may be any type of application program that can be installed and run by the computer device, and a Web application program (i.e., a Web application) that enters through a browser or the like, such as various types of websites and the like, and the type of the target application is not limited in the present application.
The present application is described by taking a web application as an example, in a general case, before the web application is loaded, a browser may parse HTML (Hyper Text Markup Language) into an Object Model (an Object Model, a data structure), that is, construct an Object Model of a target application, so as to specify various objects (such as various elements, documents, attributes, texts, etc. that constitute or support the operation of the target application) that constitute the target application, and association relationships between the various objects. The construction method and the representation form of the object model are not limited by the application and can be determined according to the situation.
Step S12, screening out the test object of the test task aiming at the target application from the objects contained in the object model;
in combination with the above description of the technical concept of the present application, the source code of the target application is directly compared and analyzed to determine whether the target application version is changed, and therefore, technical problems of low detection efficiency, high consumption of storage space and computing resources of the computer device, incapability of adjusting the monitoring granularity for different test tasks, and the like exist. Therefore, whether the version of the target application is changed or not can be determined by detecting whether the structure of the object model of the target application is changed or not, and compared with a source code comparison analysis method, the method reduces the calculation amount to a certain extent and improves the detection efficiency.
However, if the target application is a complex ultra-large web application, such as a treasure shopping website, a social network site, and the like, the structures of the object models are often complex, the number of objects included is large, and the comparison among the objects affects the performance of the computer device and reduces the detection efficiency; for the change of some objects which do not cause the failure of the test task (e.g., an end to end (web front end test) test task in an RPA (robot Process Automation) application, an automated E2E (e.g., an end to end) test task, etc.), for example, a comma is added in a title, the normal operation of the script of the test task is not disturbed.
In order to solve the above problems, the present application provides a detection method with adjustable and controllable target application monitoring granularity, that is, for different test tasks, whether each test object to be actually tested is changed during operation is considered, and objects irrelevant to the test process of the test task in an object model of the target application are ignored, so as to implement version change detection of the target application. The test objects in the object model applied by the target 9 corresponding to different test tasks are often different, and detailed description is not given in this application.
Based on the above analysis of the technical concept of the present application, after determining the test task for the target application, the present application may screen out a plurality of test objects that need to be run in the execution process of the test task from a plurality of objects included in the object model of the target application according to the test content of the test task, for example, the test task such as the content submission function of the test target application, the product display function of the test target application, and the like, and the screening implementation process is not described in detail in the present application.
It should be noted that, the present application does not limit the test content of the test task of the target application and the test object required by the operation thereof. Generally, for different types of applications, due to different functions, the number and content of test tasks that can be determined may also vary, and this application does not mention one.
Therefore, for the test tasks aiming at the target application, the test objects obtained by screening are different, and the controllability of the detection granularity of the target application is realized, namely, the functional test is realized in a targeted manner for different test tasks.
Step S13, obtaining attribute identification information of the test object according to the dependency relationship between different test objects;
in combination with the above description of the object model of the target application, some objects constituting the object model often have inter-dependency or indirect-dependency, and some objects may not have inter-dependency, which may include but is not limited to inclusion/dependency, upper and lower level relationships, and the like.
In addition, for any object in the object model, the attribute is usually determined according to the function of the object in the target application, and may be used to distinguish different objects of the same large class, for example, for an object of the class of input box, an account number input box, a password input box, a website input box, etc. in order to distinguish these objects, corresponding key attributes may be configured in the content of the object according to the function of the object, so as to accurately identify the required test object according to the following. Still taking these input boxes as examples, corresponding account numbers, passwords, websites and the like can be added to the object content of the input box, so that when a test object of a certain test task includes an account number input box, the test object of the account number input box can be accurately identified from a plurality of input box objects according to the key attributes of the input box object.
It should be noted that, the present application does not limit the content of the key attribute of each object included in the object model of the target application, and the content may be determined according to the circumstances. In practical application, the key attributes of the test object may be determined at the stage of constructing the object model, or may be configured after determining the test object of the test task, for example, determined by a developer of the target application or a user of the target application.
In combination with the above analysis, for any test object having a dependency relationship with other test objects, when the test object is executed in the running process of the target application, the abnormal operation of the test object may be caused by the abnormal operation of the test object itself or the abnormal operation of the test object depending on the test object. Therefore, in the application version change detection process, not only the change of the test object itself but also the change of the test object depending on the change need to be considered, so as to accurately position the change position.
Based on this, after determining a plurality of test objects corresponding to the current test task, the present application may obtain attribute identification information of each test object according to a dependency relationship between the plurality of test objects, where the attribute identification information may indicate a key attribute of the corresponding test object and a key attribute of the test object on which the test object depends, that is, for any test object, the attribute identification information of the test object may be determined according to the key attribute of the test object and the key attribute of the test object on which the test object depends, and therefore, the attribute identification information may be key attribute content, or may be data representing key attribute content obtained by performing calculation using a preset algorithm, and the present application does not limit the content of the attribute identification information.
Step S14, based on the change detection result of the attribute identification information of the test object, determines whether the version change occurs in the target application.
In order to detect whether the version of the target application is changed or not and affect the operation of the test task in combination with the above description of the attribute identification information of each test object, the embodiment of the present application may directly detect whether the attribute identification information of each of the plurality of test objects corresponding to the current test task is changed or not, for example, compare the attribute identification information of the corresponding test object obtained when the target application is operated last time, if the comparison result is inconsistent, it may be considered that the version of the target application is changed, otherwise, it may be considered that the version of the target application is not changed, more specifically, in the version information of the target application, the object information related to the current test task is not changed, and the test task may be operated in the target application, thereby avoiding the interference of the version change of the target application on the test task.
In summary, after the object model of the target application is constructed, for different test tasks (such as content submission function, positioning text input box, etc.) of the target application, the embodiment of the present application determines the test objects in a targeted manner, that is, the test objects for the test tasks are screened from the objects included in the object model, and then the change of the application version is determined by using the change condition of the attribute identification information of each test object, without performing change detection on the attribute identification information of the global object, so that the detection granularity is controllable and adjustable, and because the consumption of the storage space and the computing resources of the computer device in the detection process is reduced, the performance of the computer device is ensured, and the detection efficiency and the accuracy are improved.
Referring to fig. 5, a schematic flow chart of yet another optional example of the target application detection method proposed in the present application is shown, and the present embodiment may be an optional detailed implementation method of the target application detection method described above, but is not limited to the detailed implementation method described in the present embodiment. And the embodiment may be executed by the computer device, as shown in fig. 5, the method may include:
step S21, obtaining an object model of the target application;
step S22, screening out the test object of the test task aiming at the target application from the objects contained in the object model;
regarding the implementation processes of step S21 and step S22, reference may be made to the description of the corresponding parts in the above embodiments, which is not repeated in this embodiment.
Step S23, obtaining respective key attributes of different test objects;
as described in the corresponding part of the above embodiment, the key attribute of the test object itself may be determined according to the function of the test object in the target application, and may be configured by the target application user according to the actual requirement, such as the account name, the address, and the like.
It should be noted that the key attributes of different objects are often different, especially multiple objects belonging to the same category, so that the objects can be distinguished by their respective key attributes; the key attributes of the objects of different categories may be the same or different, which may be the case, and the application is not limited thereto.
Step S24, detecting whether the first test object has a dependent second test object, if not, entering step S25; if yes, go to step S26;
in this embodiment of the application, the first test object may be any one of a plurality of test objects corresponding to the test task, and the second test object refers to another test object depended on by the first test object. Through the detection in step S24, it can be determined whether there is a test object corresponding to a leaf node in the tree structure among the multiple test objects in the test task, and this can be implemented according to the dependency relationship among different test objects, and the detection process in step S24 is not described in detail in this application.
Step S25, generating attribute identification information of the first test object by using the key attribute information of the first test object;
step S26, generating attribute identification information of the first test object by using the key attribute of the first test object and the attribute identification information of the second test object;
after the above detection, it is determined that the first test object included in the test task has the dependent second test object, and then, in order to ensure the test reliability, the attribute identification information of the detected first test object is generated according to the key attribute of the first test object itself and the key attribute of the dependent second test object when detecting whether the first test object changes, and a specific generation method is not limited.
Optionally, in the present application, a hash function (hash function) may be used, and according to the above-described attribute identification information generation manner, hash values, i.e., decimal integers, of the test objects included in the test task are calculated, int hashCode () may be obtained by a hashCode () method of an Object class, and the obtained hash values of the test objects are stored in a hash table, so as to facilitate subsequent calling and comparison. It should be noted that the hash value obtained in the embodiment of the present application may be an address value of the corresponding test object in the memory, and may also be other data, which is not limited in the present application, and the attribute identification information of the object is not limited to the hash value.
Therefore, the method and the device can inquire the respective key attributes of different test objects from the key attributes of each object in the pre-configured object model; the key attributes of each object in the object model may be configured by responding to configuration operation input by a user for a test task, or based on a logic function of each object in the object model in a target application.
Step S27, acquiring original attribute identification information of different test objects;
in this embodiment of the present application, the original attribute identification information may be obtained by the corresponding test object during the last operation of the target application, and the obtaining method is similar to the obtaining method of the attribute identification information of the test object described above in this embodiment, which is not described in detail in this application.
It should be noted that, for the target application which is operated for the first time, no version change exists, and the test task can be directly operated; in the use process of the subsequent target application, according to the target application testing method described in the embodiment of the present application, before the target application executes the testing task, it is detected whether the target application is equivalent to the target application that has been run last time (i.e., the target application version on which the testing task is built) and has a version change.
Step S28, detecting the attribute identification information of different test objects, and if they are consistent with the original attribute identification information of the corresponding test object, entering step S29; if there is an inconsistent detection result, step S210 may be executed;
in the implementation process of determining whether the target application has a version change based on the change detection result of the attribute identification information of the test object, the change condition of the attribute identification information of each test object included in the test task may be directly detected to determine whether each test object included in the test task has a change, and if any test object has a change, the version of the target application is changed; otherwise, each test object is not changed, and it can be considered that the target application version is not changed, more specifically, the target application version is not changed to interfere with the running of the test task.
It should be noted that, the implementation method for determining whether the version change occurs in the target application based on the change detection result of the attribute identification information of the test object includes, but is not limited to, the detection manner described in this embodiment.
Step S29, determining that the version of the target application is not changed, triggering the target application to execute a test task, and outputting an obtained task test result;
the target application is determined to support the normal operation of the test task through the detection, the problem that version information which can interfere the operation of the test task is inconsistent does not exist, the target application can be directly triggered to execute the test task, and a corresponding task test result is output. Taking the content submission function test task as an example, the target application may be controlled to automatically execute the test script constructed for the test task, so that the target application executes the content submission function to determine whether the content submission function of the target application operates normally.
Therefore, the task test result can indicate whether the test of the target application on the test content of the test task is successful, and if the test fails, the test result can further include information such as reasons causing the failure.
In some embodiments provided by the application, in order to facilitate that a user who constructs a test task can timely know a task test result, a display screen of a computer device can directly display the task test result, and if the user is detected not to be near the computer device, the task test result or description information thereof can be sent to a preset terminal, such as output on a mobile phone carried by the user.
In still other embodiments, the detection result of whether the target application version changes may also be directly displayed on a display screen of the computer device or sent to a preset terminal carried by the user for output, so that the user executing the test task may trigger starting of the test task, and the computer device responds to the trigger instruction to control the target application to execute the test task; as described above, the computer device may also obtain the detection result that the target application version is not changed, and directly trigger the target application to execute the test task, and the implementation method of step S29 is not limited in the present application.
Step S210, determining that the version of the target application changes, and determining target configuration information influencing the normal operation of a test task in the target application by using a test object with inconsistent detection result;
step S211, outputting application version change prompt information containing the target configuration information.
According to the detection method described above, it is determined that the version of the target application is changed, but the test task is often constructed for the version information of the target application of the previous version, and if the test task is executed directly by the target application of the current version, it is likely that the script execution fails due to the change of the version.
Therefore, after detecting a test object with inconsistent attribute identification information of the current version and the previous version, the embodiment of the present application may determine, by using the test object, target configuration information that affects normal operation of the test task in the target application, such as the key attribute of the test object, the function implemented in the operation of the target application, the configuration information that implements the function, and the like.
For the detection result, compared with the detection result that only the target application version is changed, on this basis, the embodiment of the application further positions which module of the target application is changed, that is, determines the target configuration information in the target application, which affects the normal operation of the test task, and outputs the application version change prompt information including the target configuration information.
Similar to the output manner of the detection result described above, the application version change prompt message including the target configuration information constructed in the embodiment of the present application may also be directly displayed on a display screen of the computer device, for example, the application version change prompt message is output in a pop-up box, or the application version change prompt message is presented at a corresponding position in a target application version detection interface; certainly, the computer device can also send the application version change prompt message to the preset terminal, so that the user can not be beside the computer device any more, and the application version change prompt message can be checked in time through the preset terminal, and the working efficiency is improved.
In summary, after screening out test objects included in a test task from objects included in an object model of a target application, for a class of test objects without other test objects depended on, the embodiment of the present application directly utilizes the key attributes of the test object to generate attribute identification information of the test object; for another type of test object with other dependent test objects, generating attribute identification information by using the key attribute of the test object and the key attribute of the dependent test object, then determining whether the target application version is changed by detecting whether the attribute identification information of the test object is consistent with the original attribute identification information generated by the last running target application, if so, indicating that the target application version is not changed, and directly executing the test task; on the contrary, if there are inconsistent test objects, it is indicated that the target application version is changed, and it is very likely that the direct execution of the test task fails, the embodiment may determine, according to the detected inconsistent test objects, target configuration information that may affect the normal operation of the test task in the target application of the current version, so as to feed back the application version change information including the target configuration information to the user, remind the user to perform script adjustment first and then operate the test task in the target application of the current version, and avoid the occurrence of failure caused by the direct execution of the test task.
The whole detection process of the target application detection method does not need to compare the whole source code of the target application and each object contained in the object model, but compares the limited test objects required by different test tasks, namely, the detection granularity is pertinently refined, the calculated amount is greatly reduced, the consumption of storage space and calculation resources of computer equipment in the detection process is reduced, and the detection efficiency and the accuracy are improved.
Referring to fig. 6, a flowchart of yet another optional example of the target application detection method proposed in the present application is shown, and this embodiment may be a further optional detailed implementation method of the target application detection method described above, and this embodiment is described by taking a data structure in which an Object Model of the target application is a Document Object Model (DOM) tree as an example, but is not limited to this detailed implementation method described in this embodiment. As shown in fig. 6, the target application detection method executed by the computer device may include:
step S31, acquiring a DOM tree of the target application;
for a target application such as a web application, an HTML DOM defines a standard method for accessing and operating an HTML document, and the DOM expresses the HTML document as a tree structure, such as a structural diagram of a DOM tree shown in fig. 7, which may include various nodes such as document nodes, element nodes, text nodes, and attribute nodes, and can represent hierarchical relationships between different nodes, such as parent-child relationships, sibling relationships, and the like. In practical application, the browser loads a webpage application, and can use an HTML parser to parse a received HTML code to construct a DOM tree.
Step S32, acquiring key test nodes configured for the test task of the target application;
in combination with the above description of relevant portions of test objects (i.e. test nodes) of different test tasks, for different test tasks, the present application may obtain, according to the test content of the test task, a key test object configured for the test task of the target application, that is, at least one object (i.e. a node in the DOM tree) in the object model. Specifically, the computer device may analyze historical data generated when the target application executes a function corresponding to the test task by using an artificial intelligence technique, so as to determine a key test object corresponding to the corresponding test task, that is, a key test node in the DOM tree.
In another possible implementation manner, a user who constructs a test task may also configure a key test object that executes the test task during the process of constructing the test task according to information such as content of the test task, and after the configuration is completed, a detection button may be clicked, so that the computer device responds to an application version change detection instruction for the test task to obtain the key test object of the test task, and the like.
It should be understood that the obtained key test object may be at least one object in an object model (such as the DOM tree described above) of the target application, such as an account name, a password, and the like. In general, the determined key test objects are often different for different test tasks, and detailed description is not given in this application.
Step S33, according to the dependency relationship of the father node to the child nodes in the DOM tree and the validity marks of each node aiming at the test tasks, node pruning processing is carried out on each path contained in the DOM tree to obtain a target path containing a key test node;
step S34, composing DOM sub-tree for testing task by target path;
in the embodiment of the present application, after determining the key test object of the current test task, other test objects required for implementing the test task, that is, other objects having a dependency relationship with the key test object, that is, one or more objects whose content changes may interfere with the normal operation of the test task, may be further screened from the objects included in the object model according to the key test object.
In order to improve the screening efficiency and reliability of test objects of a test task, the method can determine in advance whether each object interferes with the normal operation of the test task for different test tasks, so that corresponding validity marks such as valid marks or invalid marks are configured for the object, the specific configuration method is not limited in the application, the validity marks can include 0 and 1, and can also be other two different characters, the valid marks and the invalid marks are respectively represented by the different characters, and the content of the validity marks is not limited in the application.
In order to determine whether the change of the object interferes with the normal operation of the current test task, the same object can be configured with corresponding validity marks aiming at different test tasks, that is, the validity marks corresponding to different test objects in the validity marks configured on the same object can be different, so that when the test object of any test task is obtained, the validity marks corresponding to the test task can be screened according to the validity marks in each object.
In combination with the above analysis, in order to completely obtain the test objects of the test task, the present application may prune each object included in the object model according to the dependency relationship between different objects in the object model referred by the target and the validity flags of the different objects for the test task, to obtain a plurality of test objects for the test task, and record the data structure formed by the plurality of test objects and the dependency relationship therebetween as the application detection model. As can be seen, the application detection model contains test objects for the test tasks, and there are dependencies between different test objects.
For example, a browser is used to render a document under a current URL (uniform resource locator, which may be referred to as a website) and construct a DOM tree of a webpage document corresponding to the website, as shown in fig. 7, but is not limited to the DOM tree structure shown in fig. 7, and the object models constructed for different target applications may be different, which is not listed in this application. If the test task is a test of a content submission function in the page as shown in fig. 8, and the page mainly has two element nodes of < input > and < button > as logic functions, that is, the key test objects of the test task are < input > and < button >.
Then, in the process of screening other test objects that affect the normal operation of the test task, the node pruning processing on the DOM tree may be implemented according to the dependency relationship between the parent node and the child node and the validity flag of each node, that is, for the current test task, whether each node is valid (configured with a valid flag) or invalid (configured with an invalid flag), in order to avoid omission, each path included in the DOM tree may be determined first, and then the node pruning processing is performed on each path according to the above manner, so as to obtain a target path formed by the test nodes (including the above-obtained key test object) of the test task.
In a possible implementation manner, because there is a dependency relationship between objects included in an object model of a target application, and an upper layer object may be a container of the upper layer object, that is, the upper layer object depends on a lower layer object, as shown in the DOM tree structure shown in fig. 7, a parent node in the DOM tree depends on a child node, if validity flags of the objects in the object model for the test task are determined in the manner described above, nodes of each path may be pruned according to a preset object pruning rule, so as to obtain a DOM subtree.
The object pruning rule can be constructed based on the dependency relationship among the objects in the object model and the configured validity flag, and the content of the object pruning rule is not limited in the application. Optionally, the object pruning rule may include that, for some objects configured with invalid marks, the objects are marked as invalid objects for the test task, and the invalid objects may be deleted; in still other embodiments, the object pruning rule may further include, before deleting the invalid object, further detecting whether an object on which the invalid object depends is configured with an invalid flag, and if the configured invalid flag indicates that the object on which the invalid object depends is also an invalid object for the test task, deleting the invalid object; on the contrary, if the object depended by the invalid object is the valid object, the invalid object can be used as a test object of the test task without deleting the invalid object.
Based on this, the object pruning conditions of the corresponding test tasks can be determined according to the respective key test objects of different test tasks and the object pruning rules described above, so that in the process of obtaining an application test model of a certain test task, such as a DOM subtree, the object pruning conditions of the test task can be directly called, node pruning processing is performed on the DOM tree according to the object pruning conditions to obtain the corresponding DOM subtree, and the implementation process of the present application is not described in detail.
Still taking the above DOM tree shown in fig. 7 as an object model of the target application, as an example, a scenario for testing the content submission function of the page shown in fig. 8, where key test objects include < input > and < button >, according to the pruning rule described above, a DOM subtree shown in fig. 9 can be obtained. It should be understood that for other test tasks, the composition structures of the obtained DOM subtrees may be different according to the node pruning processing manner, and this application does not make an enumeration.
Step S35, obtaining the key attribute of each node contained in the DOM sub-tree;
step S36, generating a hash value of the leaf node in the DOM sub-tree by using the key attribute of the leaf node;
step S37, generating hash value of father node by using respective key attribute of father node and child node in DOM sub-tree;
regarding the obtaining manner of the key attributes of each node in the DOM subtree, reference may be made to the obtaining process of the key attributes (which may be represented as data) of each object included in the object model in the above embodiment, which is not described herein again. In the embodiment of the application, the hash value of the node obtained by calculation is used as the attribute identification information of the node, so that the change detection of the target application version is realized.
Still taking the DOM subtree shown in fig. 9 as an example, in combination with the description of the above method for acquiring attribute identification information of each object, since the Hash value of each node is determined by the Hash value of the child node and the key attribute data of the node, in the process of acquiring the Hash tree of the DOM subtree, the Hash values of the leaf nodes < input > and < button > may be calculated first, for example, the Hash value of < input > Hash1_0 ═ Hash (data), and the Hash value of < button > Hash1_1 ═ Hash (data); then, the hash value of the parent node is calculated upwards layer by layer, as shown in fig. 9, the hash value hash2 of the node < div > at the second layer in the DOM subtree is hash (data, hash1_0, hash1_ 1); the hash value hash3 of the node < body > of the third layer is hash (data, hash 2); the hash value hash4 of the node < html > of the fourth layer is hash (data, hash 3); the hash value hash5 of the fifth layer root node < document > is hash (data, hash 4).
Step S38, comparing the hash value of the root node of the DOM sub-tree with the original hash value of the root node obtained by the last operation of the target application;
in combination with the above description of the process of acquiring the hash value of each node in the DOM subtree, the hash value of the upper node includes the hash value of the lower node, so that when detecting whether the target application version changes, the hash value of the root node can be directly retrieved from the hash table, and compared with the original hash value of the root node obtained by the last operation of the target application, whether the version of the target application changes critically or not is determined, that is, the change of normal operation of the test task is disturbed. If the comparison result is consistent, the target application version is not subjected to critical change, and the target application can be triggered to execute the test task; otherwise, the test task cannot be directly executed, and the user can be prompted to adjust the script file of the test task, so that the script file is suitable for the target application with the changed version to be executed again.
Therefore, the method for directly comparing the hash values of the root nodes determines the detection mode of whether the application version changes, and compared with the detection method of whether the application version changes or not by comparing the nodes contained in the source code or the object model, the method greatly reduces the calculation amount and improves the detection efficiency and accuracy.
Moreover, according to the method, the application detection models extracted from the object model of the target application are different in composition structure, namely different DOM subtrees, aiming at different test tasks, the number of subsequent detection and analysis objects is reduced, targeted detection is realized, and the technical problems that a user is still reminded to investigate changed contents and the workload of the user is increased due to the change under the condition that the normal operation of the test tasks is not influenced by the change of the target application version are solved.
Step S39, if the comparison result is not consistent, the hash values of other nodes in the DOM sub-tree are compared with the original hash values of the corresponding nodes;
step S310, according to the comparison result, obtaining the application version change prompt information of the nodes with inconsistent comparison result.
Through the comparison and detection process, if the hash value comparison result of the root node is inconsistent, it is indicated that the content of a certain node in the DOM subtree is changed, so that the hash value of the node is changed, and further the hash value of the root node is inconsistent. In order to avoid this situation, the present application may output the application version change prompting information to notify the detection result, and for the process of acquiring the application version change prompting information, reference may be made to the description of the corresponding part of the above embodiment, which is not described in detail in this embodiment.
Referring to fig. 10, which is a flowchart illustrating a further optional example of the target application detection method proposed in the present application, this embodiment may be a further optional detailed implementation method of the target application detection method described above, and is different from the further implementation manner, which is described in the above embodiment, of performing pruning processing on each object included in the object model according to a dependency relationship between different objects in the object model and validity flags, which are provided by different objects, for the test task to obtain the implementation method of the application detection model for the test task, where the method may be executed by a computer device, as shown in fig. 10, and the method may include:
step S41, acquiring a DOM tree of the target application and a key test node configured for the test task of the target application in the DOM tree;
regarding the implementation process of step S41, reference may be made to the description of the corresponding parts in the above embodiments, which is not described in detail in this embodiment. The key test node of this embodiment is the key test object in the above embodiments.
Step S42, obtaining validity marks of each node in the DOM tree aiming at the test task;
in conjunction with the description of the corresponding part of the above embodiment, the validity flag may include an invalid flag for indicating that the corresponding node does not affect the normal operation of the test task, and a valid flag for indicating that the corresponding node affects the normal operation of the test task, where the invalid node and the valid node may be different characters, and the specific content is not limited.
Step S43, according to the dependency relationship of the father node and the child nodes in the DOM tree, eliminating the nodes which have invalid marks with the dependent child nodes in the DOM tree, and obtaining a DOM sub-tree in the DOM tree for the test task;
still by taking the DOM tree shown in fig. 7 above and the test task shown in fig. 8 as an example, in combination with the above description on the node pruning rule, the key detection node < input > is not deleted, the leaf node < text content > of the key detection node < button > has an invalid flag, and the < text content > leaf node is deleted; the father node < div > of the two key detection nodes has effective marks, and dependent child nodes are effective nodes, and the node < div > is reserved; by such layer-by-layer detection, a DOM subtree as shown in fig. 9 can be finally obtained.
Step S44, according to the dependency relationship between the father node and the child nodes in the DOM sub-tree, obtaining the respective attribute identification information of different nodes;
in combination with the description of the corresponding part of the above embodiment, the attribute identification information may indicate the key attribute of the node itself and the key attribute of the child node that the node depends on, and as to the process of acquiring the attribute identification information, reference may be made to, but is not limited to, the description of the corresponding part of the above embodiment, which is not repeated in this embodiment.
Step S45, based on the change detection result of the attribute identification information of each node, determines whether the version change has occurred in the target application.
Regarding the implementation process of step S45, reference may be made to the description of the corresponding parts in the above embodiments, which is not described in detail in this embodiment.
Therefore, according to the method and the device, after the DOM tree of the target application is built, and the key test nodes of the current test task are determined, the DOM tree can be subjected to targeted node pruning according to whether the change of each node in the DOM tree interferes with the normal operation of the test task, so that the DOM subtree aiming at the test task is obtained, and compared with the structure composition of the DOM tree, the node number is greatly reduced.
Referring to fig. 11, a schematic structural diagram of an alternative example of the target application detection apparatus proposed in the present application is shown in fig. 11, where the apparatus may include:
an object model obtaining module 21, configured to obtain an object model of a target application;
a test object screening module 22, configured to screen out a test object of a test task for the target application from objects included in the object model;
an attribute identification information obtaining module 23, configured to obtain attribute identification information of the test object according to a dependency relationship between different test objects;
the attribute identification information of any test object can represent the key attribute of the test node and the key attribute of the test node on which the test node depends.
And the version change detection module 24 is configured to determine whether the version of the target application is changed based on a change detection result of the attribute identification information of the test object.
In some embodiments, as shown in fig. 12, the test object screening module 22 may include:
a key test object obtaining unit 221, configured to obtain a key test object configured for the test task of the target application; the key test object is at least one object in the object model;
a pruning processing unit 222, configured to perform pruning processing on each object included in the object model according to a dependency relationship between different objects in the object model and validity marks, which are possessed by different objects and are specific to the test task, to obtain an application detection model specific to the test task;
wherein the application detection model comprises test objects aiming at the test task, and a dependency relationship exists between different test objects.
In a possible implementation manner, in a case that the object model is a document object model DOM tree, and the object is a node in the DOM tree, the pruning processing unit 222 may include:
a target path obtaining unit, configured to perform node pruning on each path included in the DOM tree according to a dependency relationship between a parent node and a child node in the DOM tree and a validity flag of each node for the test task, so as to obtain a target path including the key test object;
the first building unit is used for forming a DOM sub-tree aiming at the test task by the target path; and each node in the DOM subtree is a test object of the test task.
In another possible implementation manner, when the object model is a document object model DOM tree, and the object is a node in the DOM tree, the pruning processing unit 222 may also include:
the validity mark acquisition unit is used for acquiring validity marks of all nodes in the DOM tree aiming at the test tasks; the validity marks comprise invalid marks used for indicating that the corresponding nodes do not influence the normal operation of the test task, and valid marks used for indicating that the corresponding nodes influence the normal operation of the test task;
and the second construction unit is used for eliminating the nodes which have the invalid marks simultaneously with the dependent child nodes in the DOM tree according to the dependency relationship of the father node and the child nodes in the DOM tree, so as to obtain a DOM sub-tree in the DOM tree for the test task.
In still other embodiments of the present application, as shown in fig. 12, the attribute identification information obtaining module 23 may include:
a key attribute obtaining unit 231, configured to obtain respective key attributes of different test objects;
optionally, the key attribute obtaining unit 231 may include:
the query subunit is configured to query respective key attributes of different test objects from the key attributes of each object in the preconfigured object model;
and the key attributes of each object in the object model are configured by responding to configuration operation input by a user for the test task or based on the logic function of each object in the object model in the target application.
A dependency detection unit 232, configured to detect whether there is a dependent second test object in the first test object; the first test object is any one of the test objects;
a first generating unit 233, configured to, if the detection result of the dependency detecting unit 232 is negative, generate attribute identification information of the first test object by using a key attribute of the first test object itself;
a second generating unit 234, configured to, if the detection result of the dependency detecting unit 232 is yes, generate the attribute identification information of the first test object by using the key attribute of the first test object itself and the attribute identification information of the second test object.
In still other embodiments of the present application, as shown in fig. 12, the version change detection module 24 may include:
an original attribute identification information obtaining unit 241, configured to obtain original attribute identification information of different test objects; the original attribute identification information is obtained by the corresponding test object during the last running period of the target application;
a consistency detection unit 242, configured to detect whether the attribute identification information of each of the different test objects is consistent with the original attribute identification information of the corresponding test object;
the task testing unit 243 is configured to determine that the version of the target application is not changed when the detection results of the consistency detecting unit 242 are all consistent, trigger the target application to execute the test task, and output an obtained task testing result;
a version change determining unit 244, configured to determine that the version of the target application is changed if the detection results of the consistency detecting unit 242 are all inconsistent.
Based on the above description of the embodiment, as shown in fig. 12, the apparatus may further include:
a target configuration information determining module 25, configured to determine, by using the test object with inconsistent detection result, target configuration information that affects normal operation of the test task in the target application;
and the prompt module 26 is used for outputting application version change prompt information containing the target configuration information.
It should be noted that, various modules, units, and the like in the embodiments of the foregoing apparatuses may be stored in the memory as program modules, and the processor executes the program modules stored in the memory to implement corresponding functions, and for the functions implemented by the program modules and their combinations and the achieved technical effects, reference may be made to the description of corresponding parts in the embodiments of the foregoing methods, which is not described in detail in this embodiment.
The present application further provides a readable storage medium, on which a computer program may be stored, where the computer program may be called and loaded by a processor to implement each step of the target application detection method described in the foregoing embodiments, and the implementation process may refer to the description of the corresponding part in the foregoing embodiments, which is not described in detail in this embodiment.
Finally, it should be noted that, in the present specification, the embodiments are described in a progressive or parallel manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device and the computer equipment disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is relatively simple, and the relevant points can be referred to the method part for description.
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.

Claims (10)

1. A target application detection method, the method comprising:
acquiring an object model of a target application;
screening out a test object aiming at the test task of the target application from objects contained in the object model;
obtaining attribute identification information of the test object according to the dependency relationship among different test objects; the attribute identification information of any test object can represent the key attribute of the test object and the key attribute of the test object on which the test object depends;
and determining whether the target application has a version change or not based on the change detection result of the attribute identification information of the test object.
2. The method of claim 1, wherein the screening out test objects for the test task of the target application from the objects included in the object model comprises:
acquiring a key test object configured for the test task of the target application; the key test object is at least one object in the object model;
according to the dependency relationship among different objects in the object model and the validity marks aiming at the test task of the different objects, pruning all the objects contained in the object model to obtain an application detection model aiming at the test task;
wherein the application detection model comprises test objects aiming at the test task, and a dependency relationship exists between different test objects.
3. The method of claim 2, the object model being a Document Object Model (DOM) tree, the objects being nodes in the DOM tree; the pruning processing is performed on each object included in the object model according to the dependency relationship between different objects in the object model and the validity marks of the different objects for the test task to obtain an application detection model for the test task, and the method includes:
performing node pruning on each path contained in the DOM tree according to the dependency relationship of a father node in the DOM tree on the child nodes and the validity marks of each node aiming at the test task to obtain a target path containing the key test object;
forming a DOM sub-tree for the test task by the target path; and each node in the DOM subtree is a test object of the test task.
4. The method of claim 2, the object model being a Document Object Model (DOM) tree, the objects being nodes in the DOM tree; the pruning processing is performed on each object included in the object model according to the dependency relationship between different objects in the object model and the validity marks of the different objects for the test task to obtain an application detection model for the test task, and the method includes:
obtaining validity marks of all nodes in the DOM tree aiming at the test tasks; the validity marks comprise invalid marks used for indicating that the corresponding nodes do not influence the normal operation of the test task, and valid marks used for indicating that the corresponding nodes influence the normal operation of the test task;
and according to the dependency relationship of the father node and the child nodes in the DOM tree, removing the nodes which have the invalid marks with the dependent child nodes in the DOM tree to obtain a DOM sub-tree in the DOM tree for the test task.
5. The method according to any one of claims 1 to 4, wherein the obtaining attribute identification information of the test object according to the dependency relationship between different test objects comprises:
acquiring respective key attributes of different test objects;
detecting whether a second test object which depends on the first test object exists; the first test object is any one of the test objects;
if the first test object does not exist, generating attribute identification information of the first test object by using the key attribute of the first test object;
and if so, generating the attribute identification information of the first test object by using the key attribute of the first test object and the attribute identification information of the second test object.
6. The method according to any one of claims 1 to 4, wherein the determining whether the target application has a version change based on a change detection result of the attribute identification information of the test object includes:
acquiring original attribute identification information of different test objects; the original attribute identification information is obtained by the corresponding test object during the last running period of the target application;
detecting the attribute identification information of different test objects, and whether the attribute identification information is consistent with the original attribute identification information of the corresponding test object;
if the detection results are consistent, determining that the version of the target application is not changed, triggering the target application to execute the test task, and outputting the obtained task test result;
and if the inconsistent detection result exists, determining that the version of the target application is changed.
7. The method of claim 6, further comprising:
determining target configuration information influencing normal operation of the test task in the target application by using the test objects with inconsistent detection results;
and outputting application version change prompt information containing the target configuration information.
8. The method of claim 5, wherein the obtaining respective key attributes of different test objects comprises:
inquiring respective key attributes of different test objects from key attributes of each object in the pre-configured object model;
and the key attributes of each object in the object model are configured by responding to configuration operation input by a user for the test task or based on the logic function of each object in the object model in the target application.
9. A target application detection apparatus, the apparatus comprising:
the object model acquisition module is used for acquiring an object model of the target application;
the test object screening module is used for screening out a test object of a test task aiming at the target application from objects contained in the object model;
the attribute identification information acquisition module is used for acquiring the attribute identification information of the test object according to the dependency relationship among different test objects; the attribute identification information of any test object can represent the key attribute of the test node and the key attribute of the test node on which the test node depends;
and the version change detection module is used for determining whether the target application has a version change or not based on the change detection result of the attribute identification information of the test object.
10. A computer device, the computer device comprising: at least one memory and at least one processor, wherein:
the memory, which is used for storing the program of the target application detection method according to any claim 1-8;
the processor is used for loading and executing the program of the memory to realize the target application detection method according to any one of claims 1 to 8.
CN202110908077.9A 2021-08-09 2021-08-09 Target application detection method and device and computer equipment Active CN113535587B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110908077.9A CN113535587B (en) 2021-08-09 2021-08-09 Target application detection method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110908077.9A CN113535587B (en) 2021-08-09 2021-08-09 Target application detection method and device and computer equipment

Publications (2)

Publication Number Publication Date
CN113535587A true CN113535587A (en) 2021-10-22
CN113535587B CN113535587B (en) 2024-05-24

Family

ID=78090806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110908077.9A Active CN113535587B (en) 2021-08-09 2021-08-09 Target application detection method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN113535587B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114528005A (en) * 2021-11-29 2022-05-24 深圳市千源互联网科技服务有限公司 Grab tag updating method, device, equipment and storage medium
CN117235167A (en) * 2023-11-14 2023-12-15 戎行技术有限公司 Task flow dynamic configuration method and system applied to ETL system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286119A (en) * 2008-05-27 2008-10-15 华耀环宇科技(北京)有限公司 Method for determining function point changing through code analysis
CN108710577A (en) * 2018-06-01 2018-10-26 平安普惠企业管理有限公司 Operation system test method, device, computer equipment and storage medium
CN109815134A (en) * 2018-12-29 2019-05-28 厦门网宿有限公司 The methods, devices and systems of combined data library auto Analysis test result
CN110765015A (en) * 2019-10-24 2020-02-07 北京云聚智慧科技有限公司 Method for testing application to be tested and electronic equipment
CN111782524A (en) * 2020-06-29 2020-10-16 京东数字科技控股有限公司 Application testing method and device, storage medium and electronic device
CN112799955A (en) * 2021-02-08 2021-05-14 腾讯科技(深圳)有限公司 Model change detection method and device, storage medium and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286119A (en) * 2008-05-27 2008-10-15 华耀环宇科技(北京)有限公司 Method for determining function point changing through code analysis
CN108710577A (en) * 2018-06-01 2018-10-26 平安普惠企业管理有限公司 Operation system test method, device, computer equipment and storage medium
CN109815134A (en) * 2018-12-29 2019-05-28 厦门网宿有限公司 The methods, devices and systems of combined data library auto Analysis test result
CN110765015A (en) * 2019-10-24 2020-02-07 北京云聚智慧科技有限公司 Method for testing application to be tested and electronic equipment
CN111782524A (en) * 2020-06-29 2020-10-16 京东数字科技控股有限公司 Application testing method and device, storage medium and electronic device
CN112799955A (en) * 2021-02-08 2021-05-14 腾讯科技(深圳)有限公司 Model change detection method and device, storage medium and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114528005A (en) * 2021-11-29 2022-05-24 深圳市千源互联网科技服务有限公司 Grab tag updating method, device, equipment and storage medium
CN117235167A (en) * 2023-11-14 2023-12-15 戎行技术有限公司 Task flow dynamic configuration method and system applied to ETL system
CN117235167B (en) * 2023-11-14 2024-01-30 戎行技术有限公司 Task flow dynamic configuration method and system applied to ETL system

Also Published As

Publication number Publication date
CN113535587B (en) 2024-05-24

Similar Documents

Publication Publication Date Title
US10565293B2 (en) Synchronizing DOM element references
US8983935B2 (en) Methods for utilizing a javascript emulator in a web content proxy server and devices thereof
US10908928B2 (en) Rules-based workflow messaging
US11720379B2 (en) Acquisition process of GUI elements using user input
JP2018045403A (en) Abnormality detection system and abnormality detection method
CN112817817B (en) Buried point information query method, buried point information query device, computer equipment and storage medium
US20150089415A1 (en) Method of processing big data, apparatus performing the same and storage media storing the same
CN113535587B (en) Target application detection method and device and computer equipment
CN109460546A (en) List generation method, device and electronic equipment
CN111651196B (en) Document issuing method, device and server
CN113268260A (en) Routing method and device for web front end
Rattanapoka et al. An MQTT-based IoT cloud platform with flow design by Node-RED
CN111679976A (en) Method and device for searching page object
CN114139503A (en) Document content processing method, device, equipment and storage medium
JP6505849B2 (en) Generation of element identifier
JP6763433B2 (en) Information gathering system, information gathering method, and program
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN103544271A (en) Picture processing window loading method and device for browsers
WO2020013724A1 (en) Method of managing website data
CN110708270B (en) Abnormal link detection method and device
CN111459802A (en) Method, device and equipment for testing WebView page of Android application program based on GUI
CN112765188B (en) Configuration information processing method, configuration management system, electronic device and storage medium
US11960560B1 (en) Methods for analyzing recurring accessibility issues with dynamic web site behavior and devices thereof
CN116415089B (en) Industrial equipment visual management method, computer equipment and storage medium
JP2014059700A (en) Screen control display system and screen control display program

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