CN113900950A - Page testing method, device, terminal and storage medium - Google Patents

Page testing method, device, terminal and storage medium Download PDF

Info

Publication number
CN113900950A
CN113900950A CN202111254258.0A CN202111254258A CN113900950A CN 113900950 A CN113900950 A CN 113900950A CN 202111254258 A CN202111254258 A CN 202111254258A CN 113900950 A CN113900950 A CN 113900950A
Authority
CN
China
Prior art keywords
page
elements
traversing
image
traversal
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
CN202111254258.0A
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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202111254258.0A priority Critical patent/CN113900950A/en
Publication of CN113900950A publication Critical patent/CN113900950A/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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Biomedical Technology (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The disclosure provides a page testing method and device, a terminal and a storage medium. The page testing method comprises the following steps: acquiring an image of a page; identifying, by a neural network, elements of a page in an image; traversing the elements of the page one by one, wherein traversing the elements of the page one by one comprises traversing the nodes of each level of the second element after traversing the nodes of each level of the first element in the page. By acquiring the image of the page and identifying the elements of the page in an artificial intelligence mode, important interactive elements in the page can be effectively identified, and the traversal efficiency in page testing is improved.

Description

Page testing method, device, terminal and storage medium
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to a page testing method and apparatus, a terminal, and a storage medium.
Background
During automated testing of some pages (e.g., applet pages), it is difficult for a conventional automation framework to automatically obtain pages at a user-visible layer, and thus, to uniformly obtain all elements of pages at a user-interactive layer. In addition, a large number of elements to be traversed can be generated based on the manner of obtaining elements such as android activity components or a dom tree structure in a page, and many elements are invalid elements (such as characters and non-clickable components), so that the traversal efficiency is low.
Disclosure of Invention
In order to solve the existing problems, the disclosure provides a page testing method and device, a terminal and a storage medium.
The present disclosure adopts the following technical solutions.
The embodiment of the disclosure provides a page testing method, which includes: acquiring an image of a page; identifying, by a neural network, elements of the page in the image; traversing the elements of the page one by one, wherein traversing the elements of the page one by one comprises traversing the nodes of each level of the second element after traversing the nodes of each level of the first element in the page.
Another embodiment of the present disclosure provides a page testing apparatus, including: the image acquisition module is configured to acquire an image of a page; an element identification module configured to identify elements of the page in the image through a neural network; a traversal module configured to traverse the elements of the page one by one, wherein traversing the elements of the page one by one includes performing traversal of the nodes of the respective levels of the second element after traversing the nodes of the respective levels of the first element in the page.
In some embodiments, the present disclosure provides a terminal comprising: at least one memory and at least one processor; the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory to execute the page test method.
In some embodiments, the present disclosure provides a storage medium for storing program code for performing the above-described page test method.
According to the embodiment of the disclosure, the image of the page is acquired, the elements of the page are identified in an artificial intelligence mode, important interactive elements in the page can be effectively identified, and the traversal efficiency in the page test is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
Fig. 1 is a flowchart of a page testing method of an embodiment of the present disclosure.
FIG. 2 illustrates a schematic diagram of a page traversal path, in accordance with some embodiments.
FIG. 3 illustrates a flow diagram of a page testing method according to some embodiments.
FIG. 4 is a partial block diagram of a page test apparatus for some embodiments of the present disclosure.
Fig. 5 is a schematic structural diagram of an electronic device of an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that various steps recited in method embodiments of the present disclosure may be performed in parallel and/or in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a" or "an" in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
In the automatic testing process of some pages (e.g., applet pages), the traditional automation framework is difficult to automatically acquire the pages of a user visible layer, so that all elements of the pages of a user interactive layer are difficult to uniformly acquire. In addition, a large number of elements to be traversed can be generated based on the manner of obtaining elements such as android activity components or a dom tree structure in a page, and many elements are invalid elements (such as characters and non-clickable components), so that the traversal efficiency is low. The method and the device can effectively distinguish important interactive elements in the page based on the element identification scheme, and improve the traversal efficiency.
FIG. 1 provides a flow chart of a page testing method of an embodiment of the present disclosure. The page testing method of the present disclosure may include step 101 of acquiring an image of a page. In some embodiments of the present disclosure, a page of an applet is illustrated as an example, but the present disclosure is not limited thereto. In some embodiments, the image of the page may be obtained by screenshot of the terminal device running the applet itself, or may be obtained by screenshot of other auxiliary devices.
In some embodiments, the method of the present disclosure may further include step 102 of identifying elements of the page in the image through a neural network. In some embodiments, after obtaining the image of the page, the image may be sent to a neural network (e.g., a convolutional neural network), with elements of the page in the image being identified by an artificial intelligence model in the neural network. In some embodiments, elements of a page may include text, icons, graphics, and the like.
In some embodiments, the method of the present disclosure may further include step 103, traversing the elements of the page one by one. In some embodiments, after the elements in the page are identified, the elements in the page may be traversed one by one. In some embodiments, traversing the elements of the page one-by-one includes traversing the nodes of the respective levels of the second element after traversing the nodes of the respective levels of the first element in the page. For example, after the first element is triggered by, for example, clicking or the like, the page corresponding to the child node may be entered, and multiple elements may also exist in the page corresponding to the child node, and the multiple elements also need to be traversed one by one. For example, a first element may correspond to multiple levels, e.g., 3 levels, 5 levels, or 10 levels, etc., each level may correspond to a node (e.g., a child node, a grandchild node, etc.), and there may be multiple elements in a page corresponding to each node, similar to the structure of a trunk, branches, and leaves.
As shown in fig. 2, the element composition of the page is schematically shown, and the click trigger is taken as an example for explanation. When one of the elements a of the ancestor page (e.g., the applet's home page) is triggered, the next level parent page is entered, the parent page having two elements a1 and a2, and if element a2 is clicked first, then the traversal of element a1 is performed after traversing the nodes of the various levels of element a2 (i.e., all elements including the children and grandchildren pages).
By acquiring the image of the page and identifying the elements of the page in an artificial intelligence mode, important interactive elements in the page can be effectively identified, and the traversal efficiency in page testing is improved. The page testing method disclosed by the invention can be applied to page abnormity testing of the small program, for example, the page testing method is applied to scenes such as online pre-regression scene page inspection, international language inspection, page performance testing and the like of a small program system.
In some embodiments, taking an applet as an example, before acquiring an image of a page, an applet link of the applet that needs to be traversed may be first input, then the applet home page is opened, for example, through an automated driving framework shoots, and then a screenshot may be performed, for example, to acquire the image of the page. In some embodiments, upon opening the top page, a preset time (e.g., 1s, 2s, 3s, etc.) may be waited to ensure that the top page load is complete. In some embodiments, whether the load is complete may be determined by taking multiple screenshots to determine if the page is changing. Generally, if the page loading is complete, the page screen shots before and after will not change.
In some embodiments, before traversing the elements of the page one by one, the page testing method further comprises: and classifying the identified elements, and acquiring the elements corresponding to the various classes and the positions of the corresponding elements. In some embodiments, the identified elements may be classified according to preset rules. In some embodiments, the preset rules may include, for example, base component elements, business component elements, and the like, although the disclosure is not so limited. In some embodiments, the base component elements are used more uniformly across most applets, e.g., the close symbol "x", the search symbol
Figure BDA0003323511910000041
Return symbol "<", etc. In some embodiments, business component elements include various applications, such as social software credits, taxi software credits, and the like. In some embodiments, business component elements can also include various controls, such as "submit," "view details," "query," "unused," "used," "know," and so forth. By classifying the elements, the elements can be conveniently identified, and the efficiency and the accuracy of element identification can be improved. In some embodiments, the results of the identification of each page (e.g., element categories) may be combinedThe location corresponding to the element of each category, etc.) is stored in Json format.
In some embodiments, the neural network of the present disclosure is a trained neural network. In some embodiments, page shots of multiple (e.g., 1000) different applets may be selected, manually labeled, the category, size, location, etc. of the elements of the page labeled. These training samples are then input to a neural network (e.g., a convolutional neural network) for training. In some embodiments, to enhance the accuracy of the neural network model, training of samples for non-characteristic region replacement, picture rotation, size scaling, image enhancement (e.g., gaussian blur), and the like may be performed. In embodiments of the present disclosure, various suitable neural network models may be employed.
In some embodiments, the naming of the various child nodes may be determined based on the identified locations and counts of the various elements. The naming mode is only convenient for quick and accurate recognition.
In some embodiments, during traversal of an element of the page, it is determined whether a similar element in the same location has been visited based on the trigger location and the corresponding local image obtained. In some embodiments, during the page test, the corresponding position of the trigger element is triggered (e.g., the corresponding position is clicked), and partial screenshots can be taken around the trigger position without acquiring an image of the entire page, which can reduce the data processing amount. From the partial image or partial screenshot, it can be identified whether similar elements of the location have been visited. In some embodiments, a similarity greater than a preset threshold (e.g., 90%) may be considered a similar element due to differences in the captured images or differences in the sharpness of the images. In some embodiments, if it is determined that similar elements in the same location have been visited, the element corresponding to the trigger location is skipped to avoid repeated visits. In some embodiments, if it is determined that similar elements of the same location have not been visited, the trigger location and the partial image are stored in the visit history information. By storing the trigger location and the partial image in the access history information, the access history information can be subsequently searched to facilitate confirmation of whether the location was previously accessed, preventing later repeated accesses.
In some embodiments, traversing the elements of the page includes: when the child node of the current node is traversed, comparing the image of the current node with the image of the child node, when the similarity between the image of the current node and the image of the child node is greater than a preset threshold value, ending the traversal of the child node, and stopping the page at the current node. In some embodiments, the preset threshold may be 85%, 90%, 95%, etc. In some embodiments, for example, when an element is clicked, if the similarity between the image before the click (current node) (e.g., screenshot) and the image after the click (child node) is too high, it indicates that the click is invalid, or that the element does not have a next level of child pages. Therefore, the traversal of the child node can be finished, the page is stopped at the current node, and the traversal of the rest elements in the page corresponding to the current node is performed.
In some embodiments, after all element traversals of the page corresponding to the current node are ended, it may be determined that the current node traversal is ended. At this point, the node immediately above or parent of the current node may be returned, e.g., to the left of the device. After returning to the parent node, screenshot comparison can be performed to obtain a comparison result. In some embodiments, the screenshot comparison result and the new access history are returned to the parent node for recording, and if the screenshot comparison result is not matched, the "needing to correct" state of the parent node is determined as "yes", and subsequent calibration is waited.
In some embodiments, during traversal of an element of a page, processing is performed by a preset operation when a preset element appears in the page. In some embodiments, the preset elements may include pop-up windows, drawer-type pop-ups (e.g., pop-ups of options that pop-up from the side that disappear when the non-pop-up area is clicked on, as a drawer is pulled out and then pushed back), and so on. When these predetermined elements are encountered, problems arise with conventional automated testing methods. The present disclosure can make the automated test smoothly performed by performing the preset operation on these preset elements.
In some embodiments, when the preset element is a popup, semantics in the popup are identified, and the popup is removed by triggering the preset control. In some embodiments, semantics in the pop-up window may be recognized by Optical Character Recognition (OCR), and then the pop-up window may be removed by triggering controls such as "cancel", "determine", and the like. In some embodiments, when the preset element is a drawer shell, the drawer shell is cancelled by triggering a non-shell position. By carrying out preset operation on the preset elements, the problem that the traditional test method cannot carry out test in sequence when meeting the preset elements is solved.
In some embodiments, the page structure may be stored using a tree structure, with each newly identified element as a child of the current node, and the elements of the same type numbered according to position in the page. For example: home [0] -info _ tabs [0] represents the page opened after clicking on the first info _ tab type element from the home page.
In some embodiments, traversing the elements of the page includes: after triggering the third element, if the page is not changed, skipping the third element, traversing the fourth element, and if the page is changed, traversing nodes of all levels of the third element. In some embodiments, if a page does not change after a third element in the page is triggered, indicating that the third element does not have a corresponding child node or child page, another element (e.g., a fourth element) that has not been traversed may be traversed. If the page changes after the third element is triggered, it indicates that the third element has a corresponding child node or child page, and then nodes of various levels of the third element need to be traversed. For example, as shown in FIG. 2, if A1 is the third element, then the page does not change after triggering A1, at which point the traversal of element A2 is performed. If A2 is the third element, after triggering A2, the page changes by entering a child page, at which point the nodes of the various levels of A2 are traversed, e.g., including the elements in the child and grandchild pages. In some embodiments, traversing the elements of the page includes: and after the element traversal of the page corresponding to the current node is finished, returning the page to the page corresponding to the parent node of the current node, and continuing the traversal of the element of the page corresponding to the parent node. It should be understood that the traversal of the present disclosure proceeds in a depth traversal fashion. As shown in fig. 2, after entering A2, the child page is entered, if a21 is traversed first, the grandchild page is further entered, after a211 and a212 of the grandchild page are traversed, the page is rolled back, the child page is returned, a22 and a23 are traversed, after the child page is traversed, the page is rolled back, the parent page is returned, if a1 has not traversed yet, a1 is traversed, then the ancestor page is returned, and if the ancestor page also has no unretraversed elements, the traversal is ended.
The embodiments of the present disclosure are further described below with reference to fig. 3 to better understand the technical solutions of the present disclosure. In some embodiments, the applink that needs to be traversed may be obtained first, and the applet is pulled up by the applink to unfold the traversal as the root node (or home page). And in the traversal of the new node, performing screenshot of the page to acquire an image of the page. Elements of a page are identified through a neural network. And then removing the preset elements of the floating window (or the pop window) and the drawer type pop layer. And if the node has an element which is not traversed or clicked, determining whether the click of the same coordinate and the local screenshot can be found, if so, indicating that the element has no child node, performing traversal of the next element, and after the traversal of the next element, returning again to determine whether the element which is not clicked exists. If the click of the same coordinate and the local screenshot cannot be found, the element is indicated to have a child node, the element can enter the child node by clicking, and the element of the child node is traversed. Likewise, during traversal of the elements of the child node, if a new node exists, the processing proceeds in the same manner as before, i.e., making a screenshot of the page of the new node, identifying the elements of the page, etc. In the absence of an unchecked element, traversal of the current node or current node may end, returning to a previous level node (e.g., parent). If the previous level node is the root node, the traversal ends. If the superordinate node is not the root node, it is determined whether there is an unchecked node. And thus, performing depth traversal until all elements are traversed.
In the embodiment of the disclosure, through screenshot comparison, whether each element has a sub-page or a sub-node is determined, and the quality and the efficiency of traversal are improved. In addition, when the previous-level node or page is returned, screenshot comparison is carried out, and therefore the quality and the efficiency of traversal are improved. On one hand, repeated traversal is avoided, and on the other hand, incomplete traversal caused by traversal omission is also prevented.
The embodiment of the present disclosure also provides a page testing device 600. The page testing apparatus 600 includes an image acquisition module 601, an element identification module 602, and a traversal module 603. In some embodiments, the image acquisition module 601 is configured to acquire an image of a page. In some embodiments, the element identification module 602 is configured to identify elements of a page in the image through a neural network. In some embodiments, traversal module 603 is configured to traverse the elements of the page one by one, wherein traversing the elements of the page one by one includes traversing the nodes of the respective levels of the second element after traversing the nodes of the respective levels of the first element in the page.
It should be understood that what is described with respect to the page test method is also applicable to the page test apparatus 600 herein, and for the sake of simplicity, will not be described in detail herein.
In some embodiments, the element identification module is further configured to classify the identified elements and obtain the elements corresponding to each class and the positions of the respective elements. In some embodiments, during traversal of an element of a page, it is determined whether a similar element in the same location has been visited, based on the trigger location and the corresponding local image obtained; if the similar elements at the same position are determined to be visited, skipping the elements corresponding to the trigger positions; if it is determined that the similar element of the same position has not been visited, the trigger position and the partial image are stored in the visit history information. In some embodiments, traversing the elements of the page includes: when the child node of the current node is traversed, comparing the image of the current node with the image of the child node, when the similarity between the image of the current node and the image of the child node is greater than a preset threshold value, ending the traversal of the child node, and stopping the page at the current node. In some embodiments, during traversal of an element of a page, processing is performed by a preset operation when a preset element appears in the page. In some embodiments, when a preset element appears in the page, the processing by the preset operation includes: when the preset element is a popup, identifying semantics in the popup, and removing the popup by triggering a preset control; and when the preset element is the drawer-type bullet layer, the drawer-type bullet layer is cancelled by triggering the position of the non-bullet layer. In some embodiments, traversing the elements of the page includes: after triggering the third element, if the page is not changed, skipping the third element, traversing the fourth element, and if the page is changed, traversing nodes of all levels of the third element. In some embodiments, traversing the elements of the page includes: and after the element traversal of the page corresponding to the current node is finished, returning the page to the page corresponding to the parent node of the current node, and continuing the traversal of the element of the page corresponding to the parent node.
In addition, the present disclosure also provides a terminal, including: at least one memory and at least one processor; the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory to execute the page test method.
In addition, the present disclosure also provides a computer storage medium, in which a program code is stored, and the program code is used for executing the page testing method.
The page testing method and device of the present disclosure are described above based on the embodiments and application examples. In addition, the present disclosure also provides a terminal and a storage medium, which are described below.
Referring now to fig. 5, a schematic diagram of an electronic device (e.g., a terminal device or server) 700 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 5 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods of the present disclosure as described above.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a page test method including: acquiring an image of a page; identifying, by a neural network, elements of the page in the image; traversing the elements of the page one by one, wherein traversing the elements of the page one by one comprises traversing the nodes of each level of the second element after traversing the nodes of each level of the first element in the page.
According to one or more embodiments of the present disclosure, before traversing elements of the page one by one, further comprising: and classifying the identified elements, and acquiring the elements corresponding to the various classes and the positions of the corresponding elements.
According to one or more embodiments of the present disclosure, during traversal of an element of the page, whether a similar element at the same position has been visited is determined according to a trigger position and a corresponding local image obtained; if the similar elements at the same position are determined to be visited, skipping the elements corresponding to the trigger position; if it is determined that similar elements of the same location have not been visited, the trigger location and the partial image are stored in the visit history information.
In accordance with one or more embodiments of the present disclosure, traversing the elements of the page comprises: when the child node of the current node is traversed, comparing the image of the current node with the image of the child node, and when the similarity between the image of the current node and the image of the child node is greater than a preset threshold value, ending the traversal of the child node, and stopping the page at the current node.
According to one or more embodiments of the present disclosure, during traversal of an element of the page, when a preset element occurs in the page, processing is performed by a preset operation.
According to one or more embodiments of the present disclosure, when a preset element appears in a page, the processing by a preset operation includes: when the preset element is a popup, identifying semantics in the popup, and removing the popup by triggering a preset control; and when the preset element is a drawer-type bullet layer, canceling the drawer-type bullet layer by triggering a non-bullet layer position.
In accordance with one or more embodiments of the present disclosure, traversing the elements of the page comprises: after triggering the third element, if the page is not changed, skipping the third element, traversing the fourth element, and if the page is changed, traversing nodes of all levels of the third element.
In accordance with one or more embodiments of the present disclosure, traversing the elements of the page comprises: and after the element traversal of the page corresponding to the current node is finished, returning the page to the page corresponding to the parent node of the current node, and continuing the traversal of the element of the page corresponding to the parent node.
According to one or more embodiments of the present disclosure, there is provided a page testing apparatus including: the image acquisition module is configured to acquire an image of a page; an element identification module configured to identify elements of the page in the image through a neural network; a traversal module configured to traverse the elements of the page one by one, wherein traversing the elements of the page one by one includes performing traversal of the nodes of the respective levels of the second element after traversing the nodes of the respective levels of the first element in the page.
According to one or more embodiments of the present disclosure, there is provided a terminal including: at least one memory and at least one processor; wherein the at least one memory is configured to store program code, and the at least one processor is configured to call the program code stored in the at least one memory to perform the method of any one of the above.
According to one or more embodiments of the present disclosure, there is provided a storage medium for storing program code for performing the above-described method.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (11)

1. A page testing method is characterized by comprising the following steps:
acquiring an image of a page;
identifying, by a neural network, elements of the page in the image;
traversing the elements of the page one by one, wherein traversing the elements of the page one by one comprises traversing the nodes of each level of the second element after traversing the nodes of each level of the first element in the page.
2. The page testing method of claim 1, prior to traversing elements of the page one by one, further comprising:
and classifying the identified elements, and acquiring the elements corresponding to the various classes and the positions of the corresponding elements.
3. The page testing method according to claim 1, wherein during traversal of an element of the page, it is determined whether a similar element of the same position has been visited, based on the trigger position and the corresponding local image obtained;
if the similar elements at the same position are determined to be visited, skipping the elements corresponding to the trigger position;
if it is determined that similar elements of the same location have not been visited, the trigger location and the partial image are stored in the visit history information.
4. The page testing method of claim 1, wherein traversing the elements of the page comprises:
when the child node of the current node is traversed, comparing the image of the current node with the image of the child node, and when the similarity between the image of the current node and the image of the child node is greater than a preset threshold value, ending the traversal of the child node, and stopping the page at the current node.
5. The page testing method according to claim 1, wherein, during traversal of the elements of the page, when a preset element appears in the page, processing is performed by a preset operation.
6. The page testing method according to claim 5, wherein when a preset element appears in the page, the processing by the preset operation includes:
when the preset element is a popup, identifying semantics in the popup, and removing the popup by triggering a preset control;
and when the preset element is a drawer-type bullet layer, canceling the drawer-type bullet layer by triggering a non-bullet layer position.
7. The page testing method of claim 1, wherein traversing the elements of the page comprises: after triggering the third element, if the page is not changed, skipping the third element, traversing the fourth element, and if the page is changed, traversing nodes of all levels of the third element.
8. The page testing method of claim 1, wherein traversing the elements of the page comprises: and after the element traversal of the page corresponding to the current node is finished, returning the page to the page corresponding to the parent node of the current node, and continuing the traversal of the element of the page corresponding to the parent node.
9. A page testing apparatus, comprising:
the image acquisition module is configured to acquire an image of a page;
an element identification module configured to identify elements of the page in the image through a neural network;
a traversal module configured to traverse the elements of the page one by one, wherein traversing the elements of the page one by one includes performing traversal of the nodes of the respective levels of the second element after traversing the nodes of the respective levels of the first element in the page.
10. A terminal, comprising:
at least one memory and at least one processor;
wherein the at least one memory is configured to store program code and the at least one processor is configured to call the program code stored in the at least one memory to perform the page test method of any of claims 1 to 8.
11. A storage medium for storing program code for performing the page testing method of any one of claims 1 to 8.
CN202111254258.0A 2021-10-27 2021-10-27 Page testing method, device, terminal and storage medium Pending CN113900950A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111254258.0A CN113900950A (en) 2021-10-27 2021-10-27 Page testing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111254258.0A CN113900950A (en) 2021-10-27 2021-10-27 Page testing method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN113900950A true CN113900950A (en) 2022-01-07

Family

ID=79027115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111254258.0A Pending CN113900950A (en) 2021-10-27 2021-10-27 Page testing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN113900950A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610580A (en) * 2022-03-17 2022-06-10 北京火山引擎科技有限公司 Page white screen monitoring method, device, equipment and medium
CN114968687A (en) * 2022-06-09 2022-08-30 腾讯科技(深圳)有限公司 Traversal testing method, device, electronic equipment, program product and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610580A (en) * 2022-03-17 2022-06-10 北京火山引擎科技有限公司 Page white screen monitoring method, device, equipment and medium
CN114968687A (en) * 2022-06-09 2022-08-30 腾讯科技(深圳)有限公司 Traversal testing method, device, electronic equipment, program product and storage medium

Similar Documents

Publication Publication Date Title
CN112184738B (en) Image segmentation method, device, equipment and storage medium
CN110298413B (en) Image feature extraction method and device, storage medium and electronic equipment
CN108920135B (en) User-defined service generation method and device, computer equipment and storage medium
CN110413742B (en) Resume information duplication checking method, device, equipment and storage medium
CN113900950A (en) Page testing method, device, terminal and storage medium
CN114422267B (en) Flow detection method, device, equipment and medium
CN110634049A (en) Page display content processing method and device, electronic equipment and readable medium
US10169053B2 (en) Loading a web page
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN112287206A (en) Information processing method and device and electronic equipment
CN114490395A (en) Test processing method, device, equipment and medium
CN112257478A (en) Code scanning method, device, terminal and storage medium
CN114721656A (en) Interface structure extraction method, device, medium and electronic equipment
CN114445754A (en) Video processing method and device, readable medium and electronic equipment
CN113011169B (en) Method, device, equipment and medium for processing conference summary
CN112712795A (en) Method, device, medium and electronic equipment for determining label data
CN113014853A (en) Interactive information processing method and device, electronic equipment and storage medium
CN110717126A (en) Page browsing method and device, electronic equipment and computer readable storage medium
CN113094286B (en) Page test method and device, storage medium and electronic equipment
CN113807056A (en) Method, device and equipment for correcting error of document name sequence number
CN114757146A (en) Text editing method and device, electronic equipment and storage medium
CN113221035A (en) Method, apparatus, device, medium, and program product for determining an abnormal web page
CN113051400A (en) Method and device for determining annotation data, readable medium and electronic equipment
CN113177176A (en) Feature construction method, content display method and related device
CN112597012A (en) Traversal method and device of application program, electronic equipment and storage 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