CN114020602A - Web element determination method and device, electronic equipment and storage medium - Google Patents

Web element determination method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114020602A
CN114020602A CN202111136053.2A CN202111136053A CN114020602A CN 114020602 A CN114020602 A CN 114020602A CN 202111136053 A CN202111136053 A CN 202111136053A CN 114020602 A CN114020602 A CN 114020602A
Authority
CN
China
Prior art keywords
information
web element
target
web
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111136053.2A
Other languages
Chinese (zh)
Inventor
苟明波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202111136053.2A priority Critical patent/CN114020602A/en
Publication of CN114020602A publication Critical patent/CN114020602A/en
Pending legal-status Critical Current

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/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a web element determination method, a web element determination device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining a current operation executed by the automated test program; determining target element information corresponding to the operation information of the current operation based on the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element; and determining the web element corresponding to the target element information as the target web element corresponding to the current operation. According to the method provided by the scheme, the target element information corresponding to the operation information of the current operation is determined according to the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element, so that the target web element operated by the current operation of the automatic test program is determined, the effect of monitoring the test process of the automatic test program is achieved, and a foundation is laid for improving the subsequent web interface maintenance efficiency.

Description

Web element determination method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for determining a web element, an electronic device, and a storage medium.
Background
With the continuous development of computer technology, the interactive design of the web interface is more and more complex in order to meet the requirements of users as much as possible. Therefore, in order to ensure the reliability of the web interface, how to perform software testing on the web interface becomes a hot research content.
In the prior art, since there are a lot of repeated steps in software testing, in order to save labor cost, research and development personnel usually develop an automated testing program to automatically test a Web interface by calling a corresponding testing script.
However, since the automated test program operates the page elements at a high speed during the test process, the specific operation elements corresponding to each test step cannot be determined.
Disclosure of Invention
The application provides a method and a device for determining web elements, electronic equipment and a storage medium, which are used for solving the defects that the specific operation elements corresponding to each test step in an automatic test cannot be determined in the prior art and the like.
A first aspect of the present application provides a web element determination method, including:
determining a current operation executed by the automated test program;
determining target element information corresponding to the operation information of the current operation based on the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element;
and determining the web element corresponding to the target element information as the target web element corresponding to the current operation.
Optionally, the method further includes:
acquiring attribute information of the target web element; the attribute information is used for representing the display area of the web element on the web interface;
and adding marks for the target web elements according to the attribute information of the target web elements.
Optionally, the operation table of the automated test program at least includes operation items corresponding to the operations of the automated test program one to one and web element items corresponding to the operation items one to one, where each operation item includes operation information of the operation, and each web element item includes operation information of the operation; then
The determining, based on a correspondence between operation information operated in an automated test program and element information of a web element, target element information corresponding to the operation information of the current operation includes:
positioning a target operation item in the operation table according to the operation information of the current operation;
and determining target element information corresponding to the operation information of the current operation according to the web element item corresponding to the target operation item.
Optionally, the adding a mark to the target web element according to the attribute information of the target web element includes:
generating a marking frame corresponding to the target web element according to the attribute information of the target web element;
and generating the label of the marking frame corresponding to the target web element according to the execution sequence of the current operation.
Optionally, the attribute information of the web element at least includes element coordinates and element size information; generating a marking frame corresponding to the target web element according to the attribute information of the target web element, wherein the marking frame comprises:
determining the coordinates of the marking frame according to the element coordinates of the target web element;
and determining the size of the marking frame according to the element size information of the target web element.
Optionally, the generating, according to the execution order of the current operation, a reference number of a markup box corresponding to the target web element includes:
determining a mark ordinal number corresponding to the target web element according to the execution sequence of the current operation;
and generating a label of a label frame corresponding to the target web element according to preset label attribute information and the label ordinal number corresponding to the target web element.
Optionally, the method further includes:
and monitoring the execution sequence corresponding to each operation executed by the automatic test program by using a preset counter.
A second aspect of the present application provides a web element determination apparatus, comprising:
the first determination module is used for determining the current operation executed by the automatic test program;
the second determination module is used for determining target element information corresponding to the operation information of the current operation based on the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element;
and a third determining module, configured to determine the web element corresponding to the target element information as the target web element corresponding to the current operation.
Optionally, the apparatus further comprises:
the marking module is used for acquiring the attribute information of the target web element; the attribute information is used for representing the display area of the web element on the web interface; and adding marks for the target web elements according to the attribute information of the target web elements.
Optionally, the operation table of the automated test program at least includes operation items corresponding to the operations of the automated test program one to one and web element items corresponding to the operation items one to one, where each operation item includes operation information of the operation, and each web element item includes operation information of the operation; then
The second determining module is specifically configured to:
positioning a target operation item in the operation table according to the operation information of the current operation;
and determining target element information corresponding to the operation information of the current operation according to the web element item corresponding to the target operation item.
Optionally, the marking module is specifically configured to:
generating a marking frame corresponding to the target web element according to the attribute information of the target web element;
and generating the label of the marking frame corresponding to the target web element according to the execution sequence of the current operation.
Optionally, the attribute information of the web element at least includes element coordinates and element size information; the marking module is specifically configured to:
determining the coordinates of the marking frame according to the element coordinates of the target web element;
and determining the size of the marking frame according to the element size information of the target web element.
Optionally, the marking module is specifically configured to:
determining a mark ordinal number corresponding to the target web element according to the execution sequence of the current operation;
and generating a label of a label frame corresponding to the target web element according to preset label attribute information and the label ordinal number corresponding to the target web element.
Optionally, the apparatus further comprises:
and the monitoring module is used for monitoring the execution sequence corresponding to each operation executed by the automatic test program by using a preset counter.
A third aspect of the present application provides an electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory to cause the at least one processor to perform the method as set forth in the first aspect above and in various possible designs of the first aspect.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, implement a method as set forth in the first aspect and various possible designs of the first aspect.
This application technical scheme has following advantage:
the application provides a web element determination method, a web element determination device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining a current operation executed by the automated test program; determining target element information corresponding to the operation information of the current operation based on the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element; and determining the web element corresponding to the target element information as the target web element corresponding to the current operation. According to the method provided by the scheme, the target element information corresponding to the operation information of the current operation is determined according to the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element, so that the target web element operated by the current operation of the automatic test program is determined, the effect of monitoring the test process of the automatic test program is achieved, and a foundation is laid for improving the subsequent web interface maintenance efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art according to these drawings.
FIG. 1 is a schematic structural diagram of a web element determination system based on an embodiment of the present application;
fig. 2 is a schematic flowchart of a web element determination method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an exemplary label generation process provided by an embodiment of the present application;
fig. 4 is a flowchart illustrating an exemplary web element determination method according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating another exemplary method for determining a web element according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a web element determination apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. 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 application.
Furthermore, the terms "first", "second", etc. 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. In the description of the following examples, "plurality" means two or more unless specifically limited otherwise.
In the prior art, since there are a lot of repeated steps in software testing, in order to save labor cost, research and development personnel usually develop an automated testing program to automatically test a Web UI by calling a corresponding testing script. However, since the automated test program operates the page elements at a high speed during the test process, the specific operation elements corresponding to each test step cannot be determined. Moreover, it is difficult for the operator to visually observe the specific test process, and the detailed test report cannot be recorded.
In view of the above problems, according to the web element determining method, the web element determining device, the electronic device, and the storage medium provided in the embodiments of the present application, the target element information corresponding to the currently operated operation information is determined according to the correspondence between the operation information operated in the automatic test program and the element information of the web element, and then the target web element operated by the currently operated automatic test program is determined, so that an effect of monitoring the test process of the automatic test program is achieved, and a foundation is laid for improving the subsequent web interface maintenance efficiency.
The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
First, the structure of the web element determination system on which the present application is based will be explained:
the web element determination method, the web element determination device, the electronic device and the storage medium are suitable for determining specific operation elements corresponding to each test step of an automatic test program in the automatic test process of a web interface. Fig. 1 is a schematic structural diagram of a web element marking system according to an embodiment of the present disclosure, which mainly includes a web interface, an automatic testing apparatus, and a web element determining apparatus, wherein a plurality of sets of automatic testing programs are packaged in the automatic testing apparatus. Specifically, in the process that the automatic testing device automatically tests the current web interface based on a certain set of automatic testing program, the web element determining device monitors the current automatic testing process and determines the target web elements corresponding to each testing step (operation) so as to record the whole testing process.
The embodiment of the application provides a web element determining method, which is used for determining specific operation elements corresponding to each testing step of an automatic testing program in the automatic testing process of a web interface. The execution subject of the embodiment of the application is an electronic device, such as a server, a desktop computer, a notebook computer, a tablet computer, and other electronic devices that can be used for marking web elements.
As shown in fig. 2, a schematic flow chart of a web element determination method provided in an embodiment of the present application is shown, where the method includes:
in step 201, the current operation executed by the automated test program is determined.
It should be noted that the automated testing program tests a certain service implementation condition of the current web interface (web UI), for example, if the current web interface is a network device management interface, the specific implementation conditions of services such as device addition, device deletion, device parameter configuration, and the like of the page may be detected.
Specifically, during the execution process of the automated testing program, a plurality of web elements in the page are continuously clicked or double-clicked, and the like. In order to record the whole execution process of the program, the program is firstly divided into operation steps, each operation is only guaranteed to operate one web element, and then according to the current operation step division situation, the current operation which is executed by the automatic test program is determined.
Step 202, based on the corresponding relationship between the operation information operated in the automated test program and the element information of the web element, determining the target element information corresponding to the operation information of the current operation.
The operation information of the operation may be an execution order of the operation, that is, the current operation is executed the next time in the automated test program, and the target element information may be information such as a name of the web element.
It should be noted that, since the automation test program already determines the target element corresponding to each operation in the development process, the correspondence between the operation information of the operation in the automation test program and the element information of the web element may be preset according to the program development information.
Specifically, during the execution of the automated test program, the corresponding target element information may be determined according to the currently operated operation information based on a preset correspondence between the operation information operated in the automated test program and the element information of the web element.
Step 203, determining the web element corresponding to the target element information as the target web element corresponding to the current operation.
Specifically, according to target element information, such as a name of a web element, in a source file of the web interface, a web element corresponding to the target element information may be determined, and the web element may be determined as a target web element corresponding to a current operation, that is, a web element operated by the current operation.
Specifically, in an embodiment, in order to facilitate management of correspondence between operation information of an operation in an automation test program and element information of a web element, an operation table of the automation test program may be created in advance, where the operation table of the automation test program includes at least an operation item corresponding to each operation of the automation test program in a one-to-one manner and a web element item corresponding to an operability item in a one-to-one manner, the operation item corresponding to each operation includes operation information of the operation, and each web element item includes operation information of the operation.
Correspondingly, determining target element information corresponding to the operation information of the current operation based on the corresponding relationship between the operation information of the operation in the automatic test program and the element information of the web element, including:
step 2021, positioning a target operation item in the operation table according to the operation information of the current operation;
step 2022, determining the target element information corresponding to the currently operated operation information according to the web element item corresponding to the target operation item.
It should be noted that, the target web element corresponding to each operation step of the automated test program is fixed, so the operation table of the automated test program may be constructed according to the fixed correspondence. Wherein the operation table is also a standard followed by the automated test program developer during program development. In order to accurately position the target web element operated by the current operation, the operation information (execution order) of the current operation in the whole automatic test flow can be monitored, the corresponding target element information is determined according to the operation table of the automatic test program and the execution order of the current operation, and then the corresponding target web element is determined according to the target element information.
It should be further noted that the operation table of the automated test program may be a 1 × n list, where n represents the total number of steps of the automated test program, that is, the operation table includes n operation items, and each operation item corresponds to one web element item.
For example, according to the execution order of the current operation, the sequence number of the target operation item corresponding to the current operation in the operation table may be determined, for example, the sequence number of the target operation item corresponding to the operation with the execution order of 1 in the operation table is 1, and then according to the web element item corresponding to the target operation item in the operation table, the target element information is determined, thereby determining the target web element operated by the current operation.
Specifically, test case information of the current automated test program may be obtained, where the test case information includes a specific operation process of any test case and a target web element corresponding to each operation step, and then an operation table of the current automated test program is constructed according to the test case information.
In order to enable a technician to visually monitor the testing process of the automated testing program on the web interface based on the foregoing embodiments, as an implementable manner, in an embodiment, the method further includes:
step 301, acquiring attribute information of a target web element; the attribute information is used for representing the display area of the web element on the web interface;
step 302, adding a mark to the target web element according to the attribute information of the target web element.
Specifically, in the process of collecting the web element attribute information, a mark may be added to the currently operated web element (target web element) according to the currently obtained attribute information of the target web element.
The added marks mainly comprise mark frames and marks, the mark frames are used for circling the web elements, and the marks are used for marking the execution sequence of the operation corresponding to the web elements and the operation sequence of the web elements.
On the basis of the foregoing embodiment, since the web interface originally includes more web elements, in order to avoid the newly added mark from blocking other elements in the web interface and to enable the newly added mark to be highlighted in the web interface, in an embodiment, adding a mark to a web element according to the attribute information of the web element and the execution order of the current operation includes:
step 3021, generating a mark frame corresponding to the target web element according to the attribute information of the target web element;
and step 3022, generating the label of the mark box corresponding to the target web element according to the execution sequence of the current operation.
It should be noted that some types of automated test programs may use the xpath or the element name in the background to perform element positioning during the test process, and usually each time a web element is operated, the specific operation content is displayed in the form of a text box on the front-end interface, for example: point-link ═ device view, with-xpath ═ p { text () } ═ delete device success ", etc. In this case, a mark may be directly added to the text box that is popped up, and specifically, the mark box of the text box may be generated and a corresponding mark number may be generated for the mark box.
Wherein the attribute information of the web element includes at least element coordinates and element size information.
Specifically, in an embodiment, the coordinates of the mark frame may be determined according to the element coordinates of the target web element; and determining the size of the marking frame according to the element size information of the target web element.
Specifically, the size of the mark frame to be generated is determined according to the element size information of the target web element, so that the generated mark frame can be ensured to wrap the whole target web element, and the effect of circling the target web element is achieved.
The color of the text box may be red, green, yellow, or the like, so that the display effect is prominent.
Accordingly, in an embodiment, a tag ordinal number corresponding to the target web element may be determined according to the execution order of the current operation; and generating a label of a label frame corresponding to the target web element according to the preset label attribute information and the label ordinal number corresponding to the target web element.
Note that the attribute information of the label includes information such as the font, font size, and color of the label.
Wherein the generated label is a span type web element. As shown in fig. 3, an exemplary label generation flow diagram provided in the embodiment of the present application is provided. Illustratively, before generating the label, first obtaining element coordinates of the target web element, then creating a span-type element in the web background based on JS, then updating the label of the web element by utilizing the interHTML of the span, and embedding the dynamically generated label into the web interface to be displayed in the interface. And because the number of test steps is large, the operation of the web elements is frequent, and in order to avoid the situation of label confusion, after the labels are generated, corresponding IDs can be added to the labels to ensure the uniqueness of each label, and finally, the attributes of the span elements are set according to preset label attribute information to realize the addition of the labels at the element coordinates of the target web elements.
On the basis of the foregoing embodiment, because the execution speed of the automatic test program is relatively high, in order to improve the monitoring efficiency of the automatic test program and further improve the marking efficiency of the web element, on the basis of the foregoing embodiment, in an embodiment, a preset counter may be used to monitor the execution order corresponding to each operation executed by the automatic test program.
Specifically, each time a web element operation occurs in the web interface, the counter is controlled to be incremented by one (count +1), so that the corresponding execution order can be determined according to the timing result of the counter corresponding to the currently operated web element.
To facilitate a person skilled in the art to better understand the web element determination method provided in the embodiment of the present application, as shown in fig. 4, a flowchart of an exemplary web element determination method provided in the embodiment of the present application is provided, and specifically, an execution flowchart of an automated test program whose keyword is an input text (input text) is provided.
Illustratively, after marking of a web element is completed, the specific text content (element content) to be input of the web element is saved into a record list { result }, wherein the record list { result } comprises two record items, namely a result judgment item { result (0) } and an error analysis item { result (1) }. If { result (0) } is PASS, it can be determined that the current element content has been input, otherwise, error analysis and processing are performed according to the error analysis item { result (1) }. Specifically, it is determined whether the load identifier (centerblock) is in the error analysis item { result (1) }, and if so, the keyword is re-executed, that is, it is determined again whether the load identifier (centerblock) is in the error analysis item { result (1) }, until the load is completed, that is, the load identifier (centerblock) is automatically eliminated in the error analysis item { result (1) }. Further, when the loading identifier (centerblock) is not in the error analysis item { result (1) }, whether error reporting information (stage element reference) is in the error analysis item { result (1) }, if so, it is determined that a text input error occurs currently, at this time, the text content (element content) may be re-input after waiting for 3s and 3s, if the text input can be completed within four times of operations, the current test result is "input success", otherwise, it is "input failure". If the error reporting information (the stable element reference) is not in the error analysis item { result (1) }, but the current text cannot be normally input, screenshot is carried out on the current web interface, so that a technician can process the fault according to the screenshot information.
As shown in fig. 5, a schematic flow chart of another exemplary web element determination method provided in the embodiment of the present application is specifically an execution flow chart of an automated test program whose keyword is a click element (click element).
For example, if { result (0) } is PASS, it may be determined that the operation of clicking the element is completed, otherwise, error analysis and processing are performed according to the error analysis term { result (1) }. Specifically, it is determined whether the load identifier (centerblock) is in the error analysis item { result (1) }, and if so, the keyword is re-executed, that is, it is determined again whether the load identifier (centerblock) is in the error analysis item { result (1) }, until the load is completed, that is, the load identifier (centerblock) is automatically eliminated in the error analysis item { result (1) }. Further, when the loading identifier (centerblock) is not in the error analysis item { result (1) }, whether error reporting information (stage element reference) is in the error analysis item { result (1) }, if yes, it is determined that an element click failure occurs currently, at this time, the current element can be clicked again after waiting for 3s and 3s, if the element click operation can be completed in four times of repeated operations, the current test result is "click success", otherwise, the current test result is "click failure". If the error information (stable element reference) is not in the error analysis item { result (1) }, but the current element is not clicked successfully, whether the element visible identifier (visible) is in the error analysis item { result (1) } or not can be judged, if yes, the element visible identifier (visible) is refreshed again, namely, the element visible operation (keyword) is executed until the page element is visible, namely, the element visible identifier (visible) is automatically eliminated in the error analysis item { result (1) }, and then the element is clicked again. Further, whether the html frame offset identifier (west-resizer) is in an error analysis item { result (1) } or not is judged, if yes, the target html frame (centerContentlframe) is reselected, the element is clicked again, then the test result is determined according to the implementation condition of the clicking operation of the element, and if not, the test result is determined to be 'clicking failure'.
Specifically, as can be seen from fig. 4 and 5, the web element determination method provided by the embodiment of the present application is performed before the actual test operation is performed on the web element, so that the overall test result is not affected, and intuitive element positioning can be provided in the test process. Specifically, the current operation content is input, each time one operation content is input, namely, each time the automatic test program performs one test operation, the counter is counted +1, then the target web element of the current operation is located, the execution sequence corresponding to the current operation is used as the label of the target web element, then the further edge-drawing operation is performed on the target web element, namely, a mark frame is generated for the target web element, and finally the current operation content is stored in the record list { result }.
According to the web element determining method provided by the embodiment of the application, the current operation executed by the automatic test program is determined; determining target element information corresponding to the operation information of the current operation based on the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element; and determining the web element corresponding to the target element information as the target web element corresponding to the current operation. The target element information corresponding to the operation information of the current operation is determined according to the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element, and then the target web element operated by the current operation of the automatic test program is determined, so that the effect of monitoring the test process of the automatic test program is achieved, and a foundation is laid for improving the subsequent web interface maintenance efficiency. And the marks are added to the operated web elements, so that the web interface can intuitively display the specific test process. And moreover, the marking efficiency of the web elements is guaranteed, so that the test efficiency of the automatic test program is prevented from being influenced.
The embodiment of the application provides a web element determining device, which is used for executing the web element determining method provided by the embodiment.
Fig. 6 is a schematic structural diagram of a web element determination apparatus according to an embodiment of the present application. The web element determination apparatus 60 comprises a first determination module 601, a second determination module 602, and a third determination module 603, wherein:
a first determining module 601, configured to determine a current operation performed by the automated testing program;
a second determining module 602, configured to determine, based on a correspondence between operation information operated in the automation test program and element information of the web element, target element information corresponding to the operation information of the current operation;
a third determining module 603, configured to determine the web element corresponding to the target element information as a target web element corresponding to the current operation.
Specifically, in one embodiment, the apparatus further comprises:
a marking module (not shown in the figure) for acquiring attribute information of the target web element; the attribute information is used for representing the display area of the web element on the web interface; and adding marks for the target web elements according to the attribute information of the target web elements.
Specifically, in an embodiment, the operation table of the automated test program at least includes operation items corresponding to the operations of the automated test program one to one and web element items corresponding to the operation items one to one, each operation item includes operation information of the operation, and each web element item includes operation information of the operation; then
The second determining module 602 is specifically configured to:
positioning a target operation item in an operation table according to the operation information of the current operation;
and determining target element information corresponding to the operation information of the current operation according to the web element item corresponding to the target operation item.
Specifically, in an embodiment, the marking module is specifically configured to:
generating a marking frame corresponding to the target web element according to the attribute information of the target web element;
and generating the label of the marking box corresponding to the target web element according to the execution order of the current operation.
Specifically, in one embodiment, the attribute information of the web element includes at least element coordinates and element size information; a marking module, specifically configured to:
determining the coordinates of the marking frame according to the element coordinates of the target web element;
and determining the size of the marking frame according to the element size information of the target web element.
Specifically, in an embodiment, the marking module is specifically configured to:
determining a mark ordinal number corresponding to the target web element according to the execution sequence of the current operation;
and generating a label of a label frame corresponding to the target web element according to the preset label attribute information and the label ordinal number corresponding to the target web element.
Specifically, in one embodiment, the apparatus further comprises:
and a monitoring module (not shown in the figure) for monitoring an execution sequence corresponding to each operation executed by the automated test program by using a preset counter.
With regard to the web element determination apparatus in the present embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The web element determining apparatus provided in the embodiment of the present application is configured to execute the web element determining method provided in the foregoing embodiment, and an implementation manner of the web element determining apparatus is the same as a principle, and is not described again.
The embodiment of the application provides electronic equipment for executing the web element determination method provided by the embodiment.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 70 includes: at least one processor 71 and memory 72;
the memory stores computer-executable instructions; the at least one processor executes computer-executable instructions stored by the memory to cause the at least one processor to perform the web element determination method provided by the above embodiments.
The electronic device provided in the embodiment of the present application is configured to execute the web element determining method provided in the foregoing embodiment, and an implementation manner of the electronic device is the same as a principle, which is not described again.
The embodiment of the application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the method for determining a web element provided in any one of the above embodiments is implemented.
The storage medium containing the computer-executable instructions of the embodiment of the present application may be used to store the computer-executable instructions of the web element determination method provided in the foregoing embodiment, and an implementation manner of the storage medium is the same as a principle, and is not described again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for web element determination, comprising:
determining a current operation executed by the automated test program;
determining target element information corresponding to the operation information of the current operation based on the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element;
and determining the web element corresponding to the target element information as the target web element corresponding to the current operation.
2. The method of claim 1, further comprising:
acquiring attribute information of the target web element; the attribute information is used for representing the display area of the web element on the web interface;
and adding marks for the target web elements according to the attribute information of the target web elements.
3. The method of claim 1, wherein the operation table of the automated test program at least comprises operation items corresponding to the operations of the automated test program one to one, and web element items corresponding to the operation items one to one, wherein each operation item corresponding to each operation comprises operation information of the operation, and each web element item comprises operation information of the operation; then
The determining, based on a correspondence between operation information operated in an automated test program and element information of a web element, target element information corresponding to the operation information of the current operation includes:
positioning a target operation item in the operation table according to the operation information of the current operation;
and determining target element information corresponding to the operation information of the current operation according to the web element item corresponding to the target operation item.
4. The method according to claim 2, wherein the adding a mark to the target web element according to the attribute information of the target web element comprises:
generating a marking frame corresponding to the target web element according to the attribute information of the target web element;
and generating the label of the marking frame corresponding to the target web element according to the execution sequence of the current operation.
5. The method according to claim 4, wherein the attribute information of the web element at least includes element coordinates and element size information, and the generating a mark frame corresponding to the target web element according to the attribute information of the target web element includes:
determining the coordinates of the marking frame according to the element coordinates of the target web element;
and determining the size of the marking frame according to the element size information of the target web element.
6. The method of claim 4, wherein the generating the label of the markup box corresponding to the target web element according to the execution order of the current operation comprises:
determining a mark ordinal number corresponding to the target web element according to the execution sequence of the current operation;
and generating a label of a label frame corresponding to the target web element according to preset label attribute information and the label ordinal number corresponding to the target web element.
7. The method of claim 3, further comprising:
and monitoring the execution sequence corresponding to each operation executed by the automatic test program by using a preset counter.
8. A web element determination apparatus, comprising:
the first determination module is used for determining the current operation executed by the automatic test program;
the second determination module is used for determining target element information corresponding to the operation information of the current operation based on the corresponding relation between the operation information of the operation in the automatic test program and the element information of the web element;
and a third determining module, configured to determine the web element corresponding to the target element information as the target web element corresponding to the current operation.
9. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any of claims 1-7.
10. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1 to 7.
CN202111136053.2A 2021-09-27 2021-09-27 Web element determination method and device, electronic equipment and storage medium Pending CN114020602A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111136053.2A CN114020602A (en) 2021-09-27 2021-09-27 Web element determination method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111136053.2A CN114020602A (en) 2021-09-27 2021-09-27 Web element determination method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114020602A true CN114020602A (en) 2022-02-08

Family

ID=80055043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111136053.2A Pending CN114020602A (en) 2021-09-27 2021-09-27 Web element determination method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114020602A (en)

Similar Documents

Publication Publication Date Title
CN108108297B (en) Method and device for automatic testing
CN107423048B (en) Data collection method, device, medium and computing equipment
US8612806B2 (en) Systems and methods for recording user interactions within a target application
US20200201699A1 (en) Unified error monitoring, alerting, and debugging of distributed systems
US9170873B2 (en) Diagnosing distributed applications using application logs and request processing paths
US7788540B2 (en) Tracking down elusive intermittent failures
CN102571403B (en) The implementation method of general data quality control adapter and device
US11550628B2 (en) Performing runbook operations for an application based on a runbook definition
CN110515679A (en) Collecting method, device, equipment and storage medium
CN112148606B (en) Buried point test method, buried point test device, buried point test equipment and computer readable medium
CN112187933A (en) Method and system for monitoring services in multi-architecture cloud platform
US20030191987A1 (en) Simple scenario builder
JP5989194B1 (en) Test management system and program
JP4928848B2 (en) Message converter in computer system integrated management environment.
CN109918354B (en) HDFS-based disk positioning method, device, equipment and medium
CN109800124B (en) CPU utilization monitoring method and device, electronic equipment and storage medium
CN113986749A (en) Display method and display device of front-end test information and electronic equipment
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN114020602A (en) Web element determination method and device, electronic equipment and storage medium
CN115481025A (en) Script recording method and device for automatic test, computer equipment and medium
CN111274143B (en) Buried point test method, buried point test device, buried point test equipment and storage medium
CN115599429A (en) Interface document management system, method, device and medium
CN112346994B (en) Test information association method, device, computer equipment and storage medium
US8347219B1 (en) Object-level display building
CN112162954B (en) User operation log generation and path positioning method, device, equipment and medium

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