CN110399063B - Method and device for viewing page element attributes - Google Patents

Method and device for viewing page element attributes Download PDF

Info

Publication number
CN110399063B
CN110399063B CN201910657533.XA CN201910657533A CN110399063B CN 110399063 B CN110399063 B CN 110399063B CN 201910657533 A CN201910657533 A CN 201910657533A CN 110399063 B CN110399063 B CN 110399063B
Authority
CN
China
Prior art keywords
view
target
sub
coordinate position
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910657533.XA
Other languages
Chinese (zh)
Other versions
CN110399063A (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.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai Information Technology 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 Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN201910657533.XA priority Critical patent/CN110399063B/en
Publication of CN110399063A publication Critical patent/CN110399063A/en
Application granted granted Critical
Publication of CN110399063B publication Critical patent/CN110399063B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for viewing page element attributes, wherein the method comprises the following steps: when a user operation event of a page is monitored, acquiring an operation coordinate position of the user operation event; traversing each view of the page, and searching a target view to which a page element corresponding to a user operation event belongs according to the operation coordinate position; acquiring element attribute information of a target view; generating a mask layer, and presenting element attribute information in the mask layer. The method provides an efficient viewing interaction scheme for the attribute information of the selected element, the target view selected by the user is determined by traversing the view of the page, and the element attribute information of the target view is presented in the mask layer, so that related personnel can quickly acquire the attribute information of the view to which the selected element belongs through simple page operation, the complexity of the operation can be reduced, and the development or test efficiency of an application program is improved.

Description

Method and device for viewing page element attributes
Technical Field
The invention relates to the technical field of page processing, in particular to a method and a device for viewing page element attributes.
Background
With the development of communication technology, more and more applications are included in the function list of the terminal, such as applications installed in a computer and applications installed in a smart phone. Applications mostly contain pages, such as web pages written based on the hypertext Markup Language (HTML). In some application scenarios, attribute information of a designated element of a page needs to be acquired, for example, in a development or test process, when attribute information such as element layout information, text content of a text box, text font of the text box, and the like in the page is abnormal, the page may display an abnormality. When the abnormal problem is solved, the attribute information of the elements in the page needs to be acquired.
The inventor discovers that in the process of implementing the invention: in a prior art (CN 1048666509 a), a path of a page element is obtained according to at least one of an identifier attribute, a custom attribute, and a class attribute of the page element, so as to realize positioning of a specified element, but a scheme for quickly viewing attribute information of a selected element is lacked, and a requirement for development or a tester to quickly obtain attribute information of an element cannot be met; in another prior art, a dedicated development tool is used to locate attribute information of a page element, such as a Debug view Hierarchy tool carried by an Xcode, but this approach requires installation of a corresponding development tool, which is inconvenient to use and inefficient, and requires high real-time performance. Therefore, a method for efficiently and accurately viewing attribute information of page elements is lacked in the prior art.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method and apparatus for viewing page element attributes that overcome or at least partially solve the above problems.
According to one aspect of the invention, a method for viewing page element attributes is provided, which comprises the following steps:
when a user operation event of a page is monitored, acquiring an operation coordinate position of the user operation event;
traversing each view of the page, and searching a target view to which a page element corresponding to a user operation event belongs according to the operation coordinate position;
acquiring element attribute information of a target view;
generating a mask layer, and presenting element attribute information in the mask layer.
Optionally, the searching for the target view to which the page element corresponding to the user operation event belongs according to the operation coordinate position further includes: searching a target view to enable the operation coordinate position to be located in a view area of the target view;
wherein the target view has no sub-view or the operation coordinate position is not located in the view area of any one of the sub-views of the target view.
Optionally, traversing each view of the page, and searching for a target view to which a page element corresponding to the user operation event belongs according to the operation coordinate position further includes:
step S0, adding the root view into the first view set;
step S1, extracting a view to be processed from the first view set, and deleting the view to be processed from the first view set after the extraction is finished;
step S2, traversing each sub-view of the view to be processed, and judging whether a sub-view with an operation coordinate position in the view area exists; if yes, go to step S3; if not, go to step S4;
step S3, adding the sub-view with the operation coordinate position in the view area to the first view set, and jumping to execute step S1;
step S4, judging whether the operation coordinate position is in the view area of the view to be processed; if yes, go to step S5; if not, go to step S6;
step S5, adding the view to be processed into the second view set;
step S6, judging whether the view quantity in the first view set is larger than zero; if yes, jumping to execute step S1; and if not, selecting a target view from the second view set.
Optionally, in step S2, before traversing each sub-view of the view to be processed, the method further includes:
judging whether the view to be processed has at least one sub-view; if yes, executing the step of traversing each sub-view of the view to be processed; if not, the process goes to step S4.
Optionally, selecting a target view from the second view set specifically includes: and selecting the last added view from the second view set as a target view.
Optionally, after searching for the target view to which the page element corresponding to the user operation event belongs according to the operation coordinate position, the method further includes:
and highlighting the view area of the target view.
Optionally, the highlighting the view area of the target view further comprises:
performing snapshot backup on the target view to generate a highlighted target view image;
after the mask layer is generated, the target view image is added to the mask layer according to the region coordinates of the target view.
Optionally, presenting the element attribute information in the mask layer further comprises:
and presenting the element attribute information of the target view in a mask layer in a text form.
Optionally, the element attribute information of the target view includes one or more of the following information:
element layout information, text box text content information, text box text font information, text box text color information, element transparency information.
According to another aspect of the present invention, there is provided a viewing apparatus for page element attributes, including:
the position acquisition module is suitable for acquiring the operation coordinate position of the user operation event when the user operation event of the page is monitored;
the searching module is suitable for traversing each view of the page and searching a target view to which a page element corresponding to the user operation event belongs according to the operation coordinate position;
the attribute acquisition module is suitable for acquiring element attribute information of the target view;
and the presentation module is suitable for generating the mask layer and presenting the element attribute information in the mask layer.
Optionally, the lookup module is further adapted to:
searching a target view to enable the operation coordinate position to be located in a view area of the target view;
wherein the target view has no sub-view or the operation coordinate position is not located in the view area of any one of the sub-views of the target view.
Optionally, the lookup module is further adapted to:
step S0, adding the root view into the first view set;
step S1, extracting a view to be processed from the first view set, and deleting the view to be processed from the first view set after the extraction is finished;
step S2, traversing each sub-view of the view to be processed, and judging whether a sub-view with an operation coordinate position in the view area exists; if yes, go to step S3; if not, go to step S4;
step S3, adding the sub-view with the operation coordinate position in the view area to the first view set, and jumping to execute step S1;
step S4, judging whether the operation coordinate position is in the view area of the view to be processed; if yes, go to step S5; if not, go to step S6;
step S5, adding the view to be processed into the second view set;
step S6, judging whether the view quantity in the first view set is larger than zero; if yes, jumping to execute step S1; and if not, selecting a target view from the second view set.
Optionally, the lookup module is further adapted to:
in step S2, before traversing each sub-view of the view to be processed, determining whether the view to be processed has at least one sub-view; if yes, executing the step of traversing each sub-view of the view to be processed; if not, the process goes to step S4.
Optionally, the lookup module is further adapted to: and selecting the last added view from the second view set as a target view.
Optionally, the presentation module is further adapted to:
and highlighting the view area of the target view.
Optionally, the presentation module is further adapted to:
performing snapshot backup on the target view to generate a highlighted target view image;
after the mask layer is generated, the target view image is added to the mask layer according to the region coordinates of the target view.
Optionally, the presentation module is further adapted to:
and presenting the element attribute information of the target view in a mask layer in a text form.
Optionally, the element attribute information of the target view includes one or more of the following information:
element layout information, text box text content information, text box text font information, text box text color information, element transparency information.
According to still another aspect of the present invention, there is provided an electronic apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the viewing method of the page element attribute.
According to still another aspect of the present invention, a computer storage medium is provided, where at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to perform an operation corresponding to the above-mentioned viewing method for page element attributes.
According to the method and the device for viewing the page element attributes, when the user operation event of the page is monitored, the operation coordinate position of the user operation event is obtained; traversing each view of the page, and searching a target view to which a page element corresponding to a user operation event belongs according to the operation coordinate position; acquiring element attribute information of a target view; generating a mask layer, and presenting element attribute information in the mask layer. The method provides an efficient viewing interaction scheme for the attribute information of the selected element, the target view selected by the user is determined by traversing the view of the page, and the element attribute information of the target view is presented in the mask layer, so that related personnel can quickly acquire the attribute information of the view to which the selected element belongs through simple page operation, the complexity of the operation can be reduced, and the development or test efficiency of an application program is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a flow diagram of a method of viewing page element attributes in accordance with one embodiment of the present invention;
FIG. 2 illustrates a flowchart of a method of viewing page element attributes according to another embodiment of the invention;
FIG. 3 is a diagram illustrating the sub-steps involved in step S202 in one embodiment of the present invention;
FIG. 4 is a diagram illustrating the effect of a method of viewing page element attributes in one example of the invention;
FIG. 5 illustrates a functional block diagram of a viewing apparatus for page element properties according to yet another embodiment of the present invention;
fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flowchart illustrating a method for viewing page element attributes according to an embodiment of the present invention, which is not limited in this respect. As shown in fig. 1, the method includes:
step S101, when a user operation event of a page is monitored, acquiring an operation coordinate position of the user operation event.
Wherein the page may be a Web page written based on HTML. The user can click or long-press or double-press the page to select the element in the page, and accordingly, the user operation event may refer to a user click event, a user long-press event, a user double-press event, and the like.
When the user operation event of the page is monitored, the operation coordinate position of the user operation event is obtained, and the operation coordinate position is the selected coordinate position. Taking the user click event as an example, the operation coordinate position of the user click event specifically refers to a coordinate position of a touch point of the user click event in a page coordinate system.
And S102, traversing each view of the page, and searching a target view to which a page element corresponding to the user operation event belongs according to the operation coordinate position.
This step is to determine the selected target view, specifically, to traverse each view of the page, match the operation coordinate position with the view area of each view, and determine in which target view the operation coordinate position is specifically located.
Step S103, acquiring element attribute information of the target view.
After the selected target view is determined, element attribute information of the target view, such as element layout information, text box text content information, text box word font information, text box text color information, element transparency information, and the like, is obtained.
In step S104, a mask layer is generated, and the element attribute information is displayed in the mask layer.
And adding a mask layer to the page, for example, generating a gray transparent mask layer arranged at the topmost layer of the page, and presenting the acquired element attribute information of the target view in the mask layer. So far, positioning the view of the selected element and presenting the attribute information of the view to which the selected element belongs are completed.
According to the method for viewing the page element attributes, when the user operation event of the page is monitored, the operation coordinate position of the user operation event is obtained; traversing each view of the page, and searching a target view to which a page element corresponding to a user operation event belongs according to the operation coordinate position; acquiring element attribute information of a target view; generating a mask layer, and presenting element attribute information in the mask layer. The method provides an efficient viewing interaction scheme for the attribute information of the selected element, the target view selected by the user is determined by traversing the view of the page, and the element attribute information of the target view is presented in the mask layer, so that related personnel can quickly acquire the attribute information of the view to which the selected element belongs through simple page operation, the complexity of the operation can be reduced, and the development or test efficiency of an application program is improved.
Fig. 2 is a flowchart illustrating a method for viewing page element attributes according to another embodiment of the present invention, where the method of this embodiment is executed on a client side, and certainly, when the method is implemented in detail, the method may also be executed on a server side, which is not limited by the present invention. As shown in fig. 2, the method includes:
step S201, when the user operation event of the page is monitored, the operation coordinate position of the user operation event is obtained.
The user operation event may refer to a user click event, a user long-press event, a user double-click event, and the like, and the specific form of the user operation event is not limited in the present invention. And when the user operation event of the page is monitored, acquiring the operation coordinate position of the user operation event.
The operation coordinate position specifically includes a coordinate position of a point selected by an operation event in a page coordinate system, for example, a coordinate position of a point selected by a user by clicking a page, a coordinate position of a point selected by a user by double clicking a page, a coordinate position of a point selected by a user by long-pressing a page, and the like.
Step S202, each view of the page is traversed, a target view is searched, and the operation coordinate position is located in the view area of the target view, and the target view does not have a sub-view or the operation coordinate position is not located in the view area of any sub-view of the target view.
The step is to determine the selected target view, traverse each view of the page, match the view area of each view of the page with the operation coordinate position, and determine in which target view the operation coordinate position is specifically located. The finally found target view does not have a sub-view or the operation coordinate position is not located in the view area of any one of the sub-views of the target view, that is, the target view is the view of the deepest layer in each view of which the view area includes the operation coordinate position.
Specifically, coordinate values of the operation coordinate position and coordinate values of the view area of each view are obtained, and the coordinate values of the operation coordinate position and the coordinate values of the view area of each view are compared to determine in which view area the operation coordinate position is located.
The coordinate values of the view area and the coordinate values of the operation coordinate position of the view may refer to coordinate values in the same coordinate system, for example, coordinate values in a coordinate system of a page. Alternatively, if coordinate values in different coordinate systems are referred to, then in the matching, it is necessary to convert the coordinate values of the view region and the coordinate values of the operation coordinate position of the view based on the coordinate system to which the coordinate values of the view region of each view are referred and the coordinate system to which the coordinate values of the operation coordinate position are referred, so that the converted coordinate values can be directly matched.
Fig. 3 shows a schematic diagram of the sub-steps included in step S202 in one embodiment of the present invention, and as shown in fig. 3, step S202 includes:
sub-step S0, add the root view to the first set of views.
The root views of the pages are added into the first view set, and each root view is a view to be processed, so that the processing efficiency can be improved. Of course, in practical applications, the root view, together with its child views and further views, may also be added to the first view set, which is not limited by the present invention.
And a substep S1, extracting a view to be processed from the first view set, and deleting the view to be processed from the first view set after the extraction is completed.
And extracting the views to be processed from the first view set according to a certain sequence, and deleting the views to be processed from the first view set after the extraction is finished.
Substep S2, traversing each sub-view of the view to be processed, and judging whether a sub-view with an operation coordinate position in the view area exists; if yes, go to substep S3; if not, then sub-step S4 is performed.
And respectively matching the coordinate values of the view areas of the sub-views of the view to be processed with the coordinate values of the operation coordinate positions, and judging whether the operation coordinate positions are positioned in the view areas of one of the sub-views.
Sub-step S3, add the sub-view with the operation coordinate position located in its view region to the first view set, and jump to execute sub-step S1.
If the operation coordinate position is judged to be located in the view area of a certain sub-view, the sub-view is added to the first view set, and the sub-step S1 is executed, and a view to be processed is continuously extracted from the first view set for processing.
Preferably, the position of the view to be processed extracted from the first view set corresponds to a position at which a sub-view having an operation coordinate position within its view area is added to the first view set. For example, the last view in the first view set is extracted as the view to be processed, and the sub-view having the operation coordinate position within its view area is also added to the last view in the first view set. In this way, a depth-first traversal algorithm is adopted, and once a view with an operation position located in a view area of the view is found, the view continues to be searched one level by one level to a deeper sub-view of the view, and whether the operation coordinate position is located in the view area of the deeper sub-view of the view is determined.
A substep S4 of judging whether the operation coordinate position is located in the view area of the view to be processed; if yes, go to substep S5; if not, then sub-step S6 is performed.
And if the operation coordinate position is not located in the view area of any one of the sub-views of the view to be processed, judging whether the operation coordinate position is located in the view area of the view to be processed.
And a sub-step S5 of adding the view to be processed to the second set of views.
If the operation coordinate position is not located in any one of the sub-views of the view to be processed but is located in the view area of the view to be processed, the view to be processed is added to the second view set.
A substep S6, determining whether the number of views in the first view set is greater than zero; if yes, jumping to execute the substep S1; if not, then sub-step S7 is performed.
And if the operation coordinate position is not positioned in any one of the sub-views of the view to be processed and is not positioned in the view area of the view area to be processed, judging whether an unprocessed view still exists in the first view set. If the first view set has unprocessed views, continuously extracting a view to be processed from the first view set, and repeatedly executing the steps.
And a sub-step S7 of selecting a target view from the second set of views.
And if the number of the views in the first view set is not more than zero, namely the first view set does not contain unprocessed views in total, selecting a target view from the second view set. And selecting the last added view from the second view set as a target view.
As can be seen from the above, for a view added to the second set of views, the operation coordinate position is located within its view area but not within the view area of any of its sub-views, or the view does not have a sub-view.
Optionally, in sub-step S2, before traversing each sub-view of the view to be processed, first determining whether the view to be processed has at least one sub-view; if yes, executing the step of traversing each sub-view of the view to be processed; if not, go to substep S4. It is easy to understand that whether the view to be processed has the sub-view or not is judged, and if the view to be processed has the sub-view, each sub-view is judged; if not, the view to be processed is directly judged.
The above step of finding the target view is explained below by way of an example, assuming that the root view of the page includes a and B, view a having sub-view a1, view a1 having sub-view a 2; view B has sub-view B1 and view B1 has sub-view B2. Firstly, adding the view A and the view B into a first view set, extracting the view A as a view to be processed, judging whether the operation coordinate position is located in the view area of the view A1, judging whether the operation coordinate position is located in the view area of the view A, judging that the operation coordinate position is not located in the view area of the view A, and not processing the view A any more. At this time, since there is also view B in the first view set, view B is extracted as a view to be processed, and if it is determined that the operation coordinate position is located in the view area of view B1, view B1 is added to the first view set. And extracting the view B1 as a view to be processed, judging whether the operation coordinate position is located in the view area of the view B2, judging that the operation coordinate position is located in the view area of the view B2, and adding the view B2 to the first view set. And extracting the view B2 from the first view set, judging that the view B2 does not have a sub-view, judging whether the operation coordinate position is located in the view area of the view B2, and adding the view B2 to the second view set if the operation coordinate position is located in the view area of the view B2. At this point, the number of views in the first view set is zero, and the view B2 in the second view set is the target view that is finally found.
Step 203, performing snapshot backup on the target view to generate a highlighted target view image.
Step S204, generating a mask layer, adding the target view image into the mask layer according to the area coordinates of the target view, and presenting the element attribute information of the target view in the mask layer in a text form.
Step S203 to step S204 are to highlight the selected target view and to display the element attribute information of the target view. Specifically, firstly, performing snapshot backup on a target view to generate a highlight target view image; then, a shade layer with transparent gray scale is added in the page, and the target view image is added to the corresponding position in the shade layer according to the position of the target view, so that the highlighting display processing of the view area of the target view is completed; then, according to the type of the element of the target View, such as Lable, ImageView, TableViewCell, View, etc., the element attribute information of the target View is displayed in the mask layer in the form of text, and since the element attribute information is displayed in the form of text, the text of the element attribute information can be directly copied. Optionally, a sharing function of the element attribute information may also be provided, for example, a corresponding sharing control is set, and the element attribute information is shared by one key, which further facilitates related people in a manner of providing a copying and sharing function for the presented attribute information.
Fig. 4 is a diagram illustrating the effect of the method for viewing page element attributes according to an example of the present invention, where the left side of the figure corresponds to a page before processing, and the right side of the figure corresponds to a page after processing. In a test or development scene, a user clicks and operates an area of a ' to-store coupon- [ great fortunes single meal ] K36 … ' falling into a page before processing, a client executes the method in any embodiment of the invention, locates and highlights a target view clicked by the user, acquires element attribute information of the target view for presentation, and finally, in the page presented, a view corresponding to the ' great fortunes single meal ' K36 … ' is highlighted, the element attribute information of the view is presented in a mask layer, and the element attribute information of the presented target view is as follows:
(big fortunes, fortune, single meal) K36 Strong overlord chicken fort + Wang dao jiao fragrant chicken leg + potato overlord + coca cola (middle)
font:14.4pt
textcolor:#333333
textAlignment:4
frame:{{0,0},{171,17.333333969116211}}…
The element attribute information of the target view presented in this example includes: element layout information, text box text content information, text box text font information, and text box text color information. Of course, the element attribute information described in the present invention includes, but is not limited to, the above listed items of information, and what information is specifically presented is determined according to actual situations.
According to the method for viewing the page element attributes, an efficient interactive viewing scheme for viewing the attribute information of the selected elements is provided, the view of the page is traversed according to the coordinates of the position selected by the user, the target view selected by the user is determined, the view area of the target view is highlighted, and the area range of the selected view is highlighted, so that related personnel can conveniently know which view is selected by the related personnel; and the element information of the target view is displayed in the mask layer, so that related personnel can quickly acquire the attribute information of the view to which the selected element belongs through simple page operation, the complexity of operation can be reduced, and the development or test efficiency of an application program can be improved.
Fig. 5 is a functional block diagram illustrating a viewing apparatus of page element attributes according to still another embodiment of the present invention, as shown in fig. 5, the apparatus including:
the position acquisition module 51 is suitable for acquiring the operation coordinate position of the user operation event when the user operation event of the page is monitored;
the searching module 52 is adapted to traverse each view of the page, and search a target view to which a page element corresponding to the user operation event belongs according to the operation coordinate position;
an attribute obtaining module 53 adapted to obtain element attribute information of the target view;
the rendering module 53 is adapted to generate a mask layer, and render the element attribute information in the mask layer.
Optionally, the lookup module 52 is further adapted to:
searching a target view to enable the operation coordinate position to be located in a view area of the target view;
wherein the target view has no sub-view or the operation coordinate position is not located in the view area of any one of the sub-views of the target view.
Optionally, the lookup module 52 is further adapted to:
step S0, adding the root view into the first view set;
step S1, extracting a view to be processed from the first view set, and deleting the view to be processed from the first view set after the extraction is finished;
step S2, traversing each sub-view of the view to be processed, and judging whether a sub-view with an operation coordinate position in the view area exists; if yes, go to step S3; if not, go to step S4;
step S3, adding the sub-view with the operation coordinate position in the view area to the first view set, and jumping to execute step S1;
step S4, judging whether the operation coordinate position is in the view area of the view to be processed; if yes, go to step S5; if not, go to step S6;
step S5, adding the view to be processed into the second view set;
step S6, judging whether the view quantity in the first view set is larger than zero; if yes, jumping to execute step S1; and if not, selecting a target view from the second view set.
Optionally, the lookup module 52 is further adapted to:
in step S2, before traversing each sub-view of the view to be processed, determining whether the view to be processed has at least one sub-view; if yes, executing the step of traversing each sub-view of the view to be processed; if not, the process goes to step S4.
Optionally, the lookup module 52 is further adapted to: and selecting the last added view from the second view set as a target view.
Optionally, the presentation module 54 is further adapted to:
and highlighting the view area of the target view.
Optionally, the presentation module 54 is further adapted to:
performing snapshot backup on the target view to generate a highlighted target view image;
after the mask layer is generated, the target view image is added to the mask layer according to the region coordinates of the target view.
Optionally, the presentation module 54 is further adapted to:
and presenting the element attribute information of the target view in a mask layer in a text form.
Optionally, the element attribute information of the target view includes one or more of the following information:
element layout information, text box text content information, text box text font information, text box text color information, element transparency information.
The embodiment of the application provides a non-volatile computer storage medium, wherein at least one executable instruction is stored in the computer storage medium, and the computer executable instruction can execute the viewing method of the page element attribute in any method embodiment.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 6, the electronic device may include: a processor (processor)602, a communication Interface 604, a memory 606, and a communication bus 608.
Wherein:
the processor 602, communication interface 604, and memory 606 communicate with one another via a communication bus 608.
A communication interface 604 for communicating with network elements of other devices, such as clients or other servers.
The processor 602 is configured to execute the program 610, and may specifically perform relevant steps in the above-described viewing method embodiment of the page element attribute.
In particular, program 610 may include program code comprising computer operating instructions.
The processor 602 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The electronic device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 606 for storing a program 610. Memory 606 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 610 may specifically be configured to cause the processor 602 to perform the following operations: when a user operation event of a page is monitored, acquiring an operation coordinate position of the user operation event; traversing each view of the page, and searching a target view to which a page element corresponding to a user operation event belongs according to the operation coordinate position; acquiring element attribute information of a target view; generating a mask layer, and presenting element attribute information in the mask layer.
In an optional manner, the program 610 may be specifically further configured to cause the processor 602 to perform the following operations: searching a target view to enable the operation coordinate position to be located in a view area of the target view; wherein the target view has no sub-view or the operation coordinate position is not located in the view area of any one of the sub-views of the target view.
In an optional manner, the program 610 may be specifically further configured to cause the processor 602 to perform the following operations: step S0, adding the root view into the first view set;
step S1, extracting a view to be processed from the first view set, and deleting the view to be processed from the first view set after the extraction is finished;
step S2, traversing each sub-view of the view to be processed, and judging whether a sub-view with an operation coordinate position in the view area exists; if yes, go to step S3; if not, go to step S4;
step S3, adding the sub-view with the operation coordinate position in the view area to the first view set, and jumping to execute step S1;
step S4, judging whether the operation coordinate position is in the view area of the view to be processed; if yes, go to step S5; if not, go to step S6;
step S5, adding the view to be processed into the second view set;
step S6, judging whether the view quantity in the first view set is larger than zero; if yes, jumping to execute step S1; and if not, selecting a target view from the second view set.
In an optional manner, the program 610 may be specifically further configured to cause the processor 602 to perform the following operations: in step S2, before traversing each sub-view of the view to be processed, determining whether the view to be processed has at least one sub-view; if yes, executing the step of traversing each sub-view of the view to be processed; if not, the process goes to step S4.
In an optional manner, the program 610 may be specifically further configured to cause the processor 602 to perform the following operations: and selecting the last added view from the second view set as a target view.
In an optional manner, the program 610 may be specifically further configured to cause the processor 602 to perform the following operations: and after searching a target view to which the page element corresponding to the user operation event belongs according to the operation coordinate position, highlighting the view area of the target view.
In an optional manner, the program 610 may be specifically further configured to cause the processor 602 to perform the following operations: performing snapshot backup on the target view to generate a highlighted target view image; after the mask layer is generated, the target view image is added to the mask layer according to the region coordinates of the target view.
In an optional manner, the program 610 may be specifically further configured to cause the processor 602 to perform the following operations: and presenting the element attribute information of the target view in a mask layer in a text form.
In an alternative, the text box text content information, the text box text font information, the text box text color information, the element transparency information.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an electronic device according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (18)

1. A method for viewing page element attributes, comprising:
when a user operation event of a page is monitored, acquiring an operation coordinate position of the user operation event;
traversing each view of the page, and searching a target view to which a page element corresponding to the user operation event belongs according to the operation coordinate position; which comprises the following steps: step S0, adding the root view into the first view set; step S1, extracting a view to be processed from the first view set, and deleting the view to be processed from the first view set after the extraction is finished; step S2, traversing each sub-view of the view to be processed, and judging whether a sub-view with the operation coordinate position in the view area exists; if yes, go to step S3; if not, go to step S4; step S3, adding the sub-view with the operation coordinate position in the view area to the first view set, and jumping to execute step S1; step S4, judging whether the operation coordinate position is located in the view area of the view to be processed; if yes, go to step S5; if not, go to step S6; step S5, adding the view to be processed into a second view set; step S6, determining whether the number of views in the first view set is greater than zero; if yes, jumping to execute step S1; if not, selecting a target view from the second view set;
acquiring element attribute information of the target view;
generating a mask layer, and presenting the element attribute information in the mask layer.
2. The method according to claim 1, wherein the finding of the target view to which the page element corresponding to the user operation event belongs according to the operation coordinate position further comprises: searching a target view to enable the operation coordinate position to be located in a view area of the target view;
wherein the target view has no sub-view or the operation coordinate position is not located within a view area of any one of the sub-views of the target view.
3. The method according to claim 1, wherein before traversing the sub-views of the view to be processed in step S2, the method further comprises:
judging whether the view to be processed has at least one sub-view; if yes, executing a step of traversing each sub-view of the view to be processed; if not, the process goes to step S4.
4. The method according to claim 3, wherein the selecting of the target view from the second view set specifically includes: and selecting the last added view from the second view set as a target view.
5. The method according to any one of claims 1-4, wherein after the finding of the target view to which the page element corresponding to the user operation event belongs according to the operation coordinate position, the method further comprises:
and highlighting the view area of the target view.
6. The method of claim 5, wherein said highlighting the view region of the target view further comprises:
performing snapshot backup on the target view to generate a highlighted target view image;
after generating a mask layer, the target view image is added to the mask layer according to the region coordinates of the target view.
7. The method of any of claims 1-4, wherein the presenting the element attribute information in a mask layer further comprises:
and presenting the element attribute information of the target view in a mask layer in a text form.
8. The method of claim 1, wherein the element attribute information of the target view comprises one or more of:
element layout information, text box text content information, text box text font information, text box text color information, element transparency information.
9. A viewing apparatus for page element attributes, comprising:
the position acquisition module is suitable for acquiring the operation coordinate position of a user operation event when the user operation event of a page is monitored;
the searching module is suitable for traversing each view of the page and searching a target view to which a page element corresponding to the user operation event belongs according to the operation coordinate position; which comprises the following steps: step S0, adding the root view into the first view set; step S1, extracting a view to be processed from the first view set, and deleting the view to be processed from the first view set after the extraction is finished; step S2, traversing each sub-view of the view to be processed, and judging whether a sub-view with the operation coordinate position in the view area exists; if yes, go to step S3; if not, go to step S4; step S3, adding the sub-view with the operation coordinate position in the view area to the first view set, and jumping to execute step S1; step S4, judging whether the operation coordinate position is located in the view area of the view to be processed; if yes, go to step S5; if not, go to step S6; step S5, adding the view to be processed into a second view set; step S6, determining whether the number of views in the first view set is greater than zero; if yes, jumping to execute step S1; if not, selecting a target view from the second view set;
the attribute acquisition module is suitable for acquiring element attribute information of the target view;
and the presentation module is suitable for generating a mask layer and presenting the element attribute information in the mask layer.
10. The apparatus of claim 9, wherein the lookup module is further adapted to:
searching a target view to enable the operation coordinate position to be located in a view area of the target view;
wherein the target view has no sub-view or the operation coordinate position is not located within a view area of any one of the sub-views of the target view.
11. The apparatus of claim 9, wherein the lookup module is further adapted to:
in step S2, before traversing each sub-view of the view to be processed, determining whether the view to be processed has at least one sub-view; if yes, executing a step of traversing each sub-view of the view to be processed; if not, the process goes to step S4.
12. The apparatus of claim 11, wherein the lookup module is further adapted to: and selecting the last added view from the second view set as a target view.
13. The apparatus of any of claims 9-12, wherein the presentation module is further adapted to:
and highlighting the view area of the target view.
14. The apparatus of claim 13, wherein the presentation module is further adapted to:
performing snapshot backup on the target view to generate a highlighted target view image;
after generating a mask layer, the target view image is added to the mask layer according to the region coordinates of the target view.
15. The apparatus of any of claims 9-12, wherein the presentation module is further adapted to:
and presenting the element attribute information of the target view in a mask layer in a text form.
16. The apparatus of claim 9, wherein the element attribute information of the target view comprises one or more of:
element layout information, text box text content information, text box text font information, text box text color information, element transparency information.
17. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the viewing method of the page element attribute as claimed in any one of claims 1-8.
18. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the method of viewing page element attributes of any of claims 1-8.
CN201910657533.XA 2019-07-19 2019-07-19 Method and device for viewing page element attributes Active CN110399063B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910657533.XA CN110399063B (en) 2019-07-19 2019-07-19 Method and device for viewing page element attributes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910657533.XA CN110399063B (en) 2019-07-19 2019-07-19 Method and device for viewing page element attributes

Publications (2)

Publication Number Publication Date
CN110399063A CN110399063A (en) 2019-11-01
CN110399063B true CN110399063B (en) 2021-01-15

Family

ID=68324781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910657533.XA Active CN110399063B (en) 2019-07-19 2019-07-19 Method and device for viewing page element attributes

Country Status (1)

Country Link
CN (1) CN110399063B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928628B (en) * 2019-11-22 2022-12-27 网易(杭州)网络有限公司 Game element processing method and device, storage medium and processor
CN112882933A (en) * 2021-02-09 2021-06-01 京东数科海益信息科技有限公司 Script recording method, device, equipment and storage medium
CN115033822B (en) * 2022-06-14 2024-05-17 壹沓科技(上海)有限公司 Element positioning method, device, equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778198A (en) * 2014-12-30 2015-07-15 北京奇虎科技有限公司 Method and device for viewing page information of mobile terminal
CN104898928A (en) * 2015-05-30 2015-09-09 广州华多网络科技有限公司 Graphic and text information display method and terminal
CN108803968A (en) * 2018-06-29 2018-11-13 掌阅科技股份有限公司 Multiview linkage method, computing device and the storage medium of user's display interface
CN110020337A (en) * 2017-08-03 2019-07-16 腾讯科技(深圳)有限公司 Web page processing method and Related product

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177096B (en) * 2013-03-15 2019-02-05 百度在线网络技术(北京)有限公司 Page elements localization method and equipment based on text attribute
CN104424087B (en) * 2013-08-21 2017-07-28 阿里巴巴集团控股有限公司 A kind of method of Web page surface element positioning, apparatus and system
WO2018109589A1 (en) * 2016-12-15 2018-06-21 Walkme Ltd. Updating data records by adding editing functions to non-editable display elements
CN109150641B (en) * 2017-06-15 2020-04-17 北京国双科技有限公司 Data acquisition and query method, device, storage medium and processor
CN109710369B (en) * 2018-12-29 2019-12-10 滨州建筑工程施工图审查中心 full-graphical user interface display method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778198A (en) * 2014-12-30 2015-07-15 北京奇虎科技有限公司 Method and device for viewing page information of mobile terminal
CN104898928A (en) * 2015-05-30 2015-09-09 广州华多网络科技有限公司 Graphic and text information display method and terminal
CN110020337A (en) * 2017-08-03 2019-07-16 腾讯科技(深圳)有限公司 Web page processing method and Related product
CN108803968A (en) * 2018-06-29 2018-11-13 掌阅科技股份有限公司 Multiview linkage method, computing device and the storage medium of user's display interface

Also Published As

Publication number Publication date
CN110399063A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
CN107729475B (en) Webpage element acquisition method, device, terminal and computer-readable storage medium
CN110399063B (en) Method and device for viewing page element attributes
CN104036011B (en) Webpage element display method and browser device
US9104775B2 (en) Method for presenting a web page
US8281246B2 (en) Travelogue-based contextual map generation
US20210103515A1 (en) Method of detecting user interface layout issues for web applications
CN102664925B (en) A kind of method of displaying searching result and device
CN106570750B (en) Browser plug-in-based automatic tax declaring method and system and browser plug-in
CN105446989A (en) Search method and device, and display device
CN103377128A (en) Method and system for race detection for Web applications
CN110851756A (en) Page loading method and device, computer readable storage medium and terminal equipment
CN106484726A (en) A kind of page display method and device
US20160328110A1 (en) Method, system, equipment and device for identifying image based on image
CN110619103A (en) Webpage image-text detection method and device and storage medium
CN110515631B (en) Method for generating application installation data packet, server and computer storage medium
US10120937B2 (en) Method and system for masking and filtering web contents and computer program product
CN114647409A (en) Large-screen visualization application creation platform, method, computing device and storage medium
US10289613B2 (en) Element identifier generation
CN107430614A (en) Application partial-depth to corresponding resource links
CN107391175B (en) Control data configuration method and computer readable storage medium
US10218767B2 (en) Method, system and browser for executing active object of browser
CN110909155B (en) Book order generation method, calculation device and computer storage medium
CN111538453B (en) Book detail page display method, terminal and computer storage medium
CN116795377A (en) Code data processing method and device
US10445290B1 (en) System and method for a smart configurable high performance interactive log file viewer

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