WO2015043352A1 - Method and apparatus for selecting test nodes on webpages - Google Patents

Method and apparatus for selecting test nodes on webpages Download PDF

Info

Publication number
WO2015043352A1
WO2015043352A1 PCT/CN2014/085252 CN2014085252W WO2015043352A1 WO 2015043352 A1 WO2015043352 A1 WO 2015043352A1 CN 2014085252 W CN2014085252 W CN 2014085252W WO 2015043352 A1 WO2015043352 A1 WO 2015043352A1
Authority
WO
WIPO (PCT)
Prior art keywords
webpage
component
similar
components
node
Prior art date
Application number
PCT/CN2014/085252
Other languages
French (fr)
Inventor
Yue Lin
Li Xu
Xiang Li
Original Assignee
Tencent Technology (Shenzhen) Company Limited
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 Tencent Technology (Shenzhen) Company Limited filed Critical Tencent Technology (Shenzhen) Company Limited
Publication of WO2015043352A1 publication Critical patent/WO2015043352A1/en

Links

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

Abstract

A method and an apparatus for facilitating automated webpage testing and debugging is disclosed. The method includes: at a device having one or more processors and memory: obtaining specification of a reference webpage component in a webpage; determining a path of the reference webpage component in the webpage; identifying in the webpage one or more similar webpage components for the reference webpage component, wherein the identifying comprises: searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage; and providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage.

Description

METHOD AND APPARATUS FOR SELECTING TEST NODES
ON WEBPAGES
RELATED APPLICATIONS
[0001] This application claims priority to Chinese Patent Application No.
201310452563.X, entitled "Method and Apparatus for Selecting Testing Nodes on
Webpages," filed on September 26, 2013, which is incorporated by reference in its entirety.
FIELD OF THE TECHNOLOGY
[0002] This application relates to the technical field of computer and Internet data processing, and in particular, to a method and an apparatus for selecting a test node in a webpage for automated testing and debugging of wepages.
BACKGROUND
[0003] Currently, many web automated test technologies emerge in the industry, and in these technical solutions, a web widget can be operated to simulate an operation such as input or click of a user, so as to implement a webpage automated test. A principle thereof is performing a test operation on a browser and a web test object by invoking a Component Object Model (COM) interface of the browser and a Document Object Model (DOM) of Hypertext Markup Language (HTML).
[0004] During an existing automated test, if there are multiple similar samples in a webpage under test, where the sample is a node or webpage component, there are usually two technical solutions in the following to obtain multiple test samples in an automated test:
[0005] In a first solution of a web automated test, a common tag attribute is injected into similar test samples in the webpage source code, so that an automated test program can identify these similar test samples by using the common tag attribute. FIG. 1 is a schematic diagram of injection of a class tag attribute into similar test samples in webpage source code. Referring to FIG. 1, for the similar test samples, in a webpage, a test sample may also be referred to as a test node, and the similar test nodes in FIG. 1 are 101 and 102. A common tag attribute class (e.g., class=test_bm_zan") is injected into both the test nodes 101 and 102; in this way, an automated test program can identify the similar test nodes according to these class tag attributes, so as to perform a subsequent test process. Obviously, the tag attribute is not limited to "class", and may also be another tag attribute.
[0006] In a second solution of a webpage automated test, a visualized tool is used in a webpage, and multiple test nodes are selected one by one by using a mouse. FIG. 2 is a schematic diagram of display and manual selection of a test node by using a visualized tool in a webpage. Referring to FIG. 2, a network node in a webpage under test can be displayed by using the visualization tool, and then, test personnel manually select similar test nodes under test by using a mouse, for example, the "Like" buttons therein, and submit the similar nodes to an automated test program after selection is completed; in this way, the automated test program can test these similar test nodes.
[0007] However, the prior art has the following defects:
[0008] 1) In both the first solution and the second solution, similar test nodes need to be manually tagged one by one, or similar test nodes are manually selected one by one, and when there are a great number of similar nodes, much time and labor are required, and efficiency is low.
[0009] 2) Due to a manual operation, a situation of misses in tagging or selection occurs easily, which lowers an accuracy rate of a test.
[0010] 3) The maintenance cost is high, and if a reference node needs to be modified, similar nodes further need to be manually modified one by one.
[0011] 4) When similar nodes in a webpage are dynamically generated, the tagging solution in the first solution is used, and because an generation manner is uncertain and the number of nodes is unknown, the solution cannot be normally used or the cost is high for implementation; and if the one-by-one manual selection solution in the second solution is used, because nodes may be dynamically generated by a script, they cannot be selected in advance, and the solution cannot be normally used either. SUMMARY
[0012] In some embodiments, a method of facilitating automated web page testing and debugging is performed at a device (e.g., test device 102, FIG. 3) with one or more processors and memory. The method includes: obtaining specification of a reference webpage component in a webpage; determining a path of the reference webpage component in the webpage; identifying in the webpage one or more similar webpage components for the reference webpage component, wherein the identifying comprises: searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage; and providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage.
[0013] In some embodiments, a computing device (e.g., test device 102 (FIG. 3) or a component thereof (e.g., plug-in 106, FIG. 3)) includes one or more processors and memory storing one or more programs for execution by the one or more processors, the one or more programs include instructions for performing, or controlling performance of, the operations of any of the methods described herein. In some embodiments, a non-transitory computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which, when executed by a computing device (e.g., test device 102 (FIG. 3) or a component thereof (e.g., plug-in 106, FIG. 3)) with one or more processors, cause the computing device to perform, or control performance of, the operations of any of the methods described herein. In some embodiments, a computing device (e.g., test device 102 (FIG. 3) or a component thereof (e.g., plug-in 106, FIG. 3)) includes means for performing, or controlling performance of, the operations of any of the methods described herein.
[0014] Various advantages of the present application are apparent in light of the descriptions below.
BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The aforementioned features and advantages of the invention as well as additional features and advantages thereof will be more clearly understood hereinafter as a result of a detailed description of preferred embodiments when taken in conjunction with the drawings.
[0016] FIG. 1 is a schematic diagram of injection of a class tag attribute into similar test samples in webpage code.
[0017] FIG. 2 is a schematic diagram of display and manual selection of a test node by using a visualized tool in a webpage.
[0018] FIG. 3 is a block diagram illustrating a representative test device in accordance with some embodiments.
[0019] FIGS. 4A-4C illustrate exemplary user interfaces for facilitating automated webpage testing and debugging in accordance with some embodiments.
[0020] FIG. 5 is a flowchart of a method for selecting a test node in a webpage according to some embodiments.
[0021] FIGS. 6A is a schematic diagram of a path of a representative webpage component (also referred to as a node) in a webpage.
[0022] FIG. 6B is a schematic diagram of paths of a representative webpage component and its similar webpage components in a webpage according to some embodiments.
[0023] FIGS. 7A-7B is a flowchart of a method for facilitating automated web page testing and debugging in accordance with some embodiments.
[0024] FIG. 8 is a schematic structural diagram of an apparatus for selecting a test node in a webpage in accordance with some embodiments.
[0025] Like reference numerals refer to corresponding parts throughout the several views of the drawings. DESCRIPTION OF EMBODIMENTS
[0026] Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the subject matter presented herein. But it will be apparent to one skilled in the art that the subject matter may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to
unnecessarily obscure aspects of the embodiments.
[0027] The following clearly and completely describes the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are merely a part rather than all of the embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0028] In accordance with some embodiments, a web browser is executed on a test device 102, and the web browser includes a plug-in 106 that facilitates the selection of nodes for automated testing. Examples of test device 102 include, but are not limited to, a handheld computer, a wearable computing device, a personal digital assistant (PDA), a tablet computer, a laptop computer, a desktop computer, a cellular telephone, a smart phone, an enhanced general packet radio service (EGPRS) mobile phone, a media player, a navigation device, a game console, a television, a remote control, or a combination of any two or more of these data processing devices or other data processing devices.
[0029] In some embodiments, plug-in 106 is a thin-client that provides only user- facing input and output processing functions, and delegates all other data processing functionalities to a backend server. In some embodiments, the automated webpage testing and debugging is performed entirely by plug-in 106 and test device 102 stores saved test flows, test cases, and test results. In some embodiments, the automated webpage testing and debugging is performed entirely by a server system and the server system stores saved test flows, test cases, and test results. In some embodiments, the automated webpage testing and debugging is performed by plug-in 106 and a server system stores saved test flows, test cases, and test results.
[0030] FIG. 3 is a block diagram illustrating a representative test device 102 in accordance with some embodiments. Test device 102, typically, includes one or more processing units (CPUs) 302, one or more network interfaces 304, memory 306, and one or more communication buses 308 for interconnecting these components (sometimes called a chipset). Test device 102 also includes a user interface 310. User interface 310 includes one or more output devices 312 that enable presentation of media content, including one or more speakers and/or one or more visual displays. User interface 310 also includes one or more input devices 314, including user interface components that facilitate user input such as a keyboard, a mouse, a voice-command input unit or microphone, a touch screen display, a touch- sensitive input pad, a gesture capturing camera, or other input buttons or controls. Furthermore, some test devices 102 use a microphone and voice recognition or a camera and gesture recognition to supplement or replace the keyboard. Memory 306 includes high-speed random access memory, such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; and, optionally, includes non-volatile memory, such as one or more magnetic disk storage devices, one or more optical disk storage devices, one or more flash memory devices, or one or more other non-volatile solid state storage devices. Memory 306, optionally, includes one or more storage devices remotely located from one or more processing units 302. Memory 306, or alternatively the non-volatile memory within memory 306, includes a non-transitory computer readable storage medium.
[0031] In some implementations, memory 306, or the non-transitory computer readable storage medium of memory 306, stores the following programs, modules, and data structures, or a subset or superset thereof: o operating system 316 including procedures for handling various basic system
services and for performing hardware dependent tasks; o network communication module 318 for connecting test device 102 to other
computing devices (e.g., a test server and web servers for webpages) connected to one or more networks 110 via one or more network interfaces 304 (wired or wireless); presentation module 320 for enabling presentation of information (e.g., a user interface for application(s) 326, widgets, websites and webpages thereof, and/or games, audio and/or video content, text, etc.) at test device 102 via one or more output devices 312 (e.g., displays, speakers, etc.) associated with user interface 310; input processing module 322 for detecting one or more user inputs or interactions from one of the one or more input devices 314 and interpreting the detected input or interaction; web browser module 324 for navigating, requesting (e.g., via HTTP), and displaying websites and webpages thereof; one or more applications 326 for execution by test device 102 (e.g., games, application marketplaces, payment platforms, and/or other web or non-web based applications); plug-in 106, which provides data processing and functionalities for the automated webpage testing and debugging application, including one or more of, but not limited to the following sub-modules:
• trigger detection module 330 for triggering plug-in 106 based on an input detected in web browser module 324;
• component identifying module 332 for identifying webpage components for a respective webpage displayed by web browser module 32 based on a selected representative webpage component;
• information extracting module 334 for extracting location information and configuration information for the identified webpage components;
• user interface (UI) displaying module 336 for displaying a first UI for
arranging a test flow, a second UI for arranging a test case, a third UI for causing execution of one or more test cases, and optionally a UI displaying test results; • generating module 338 for generating graphical representations for the identified webpage components that corresponding to test scripts for the identified webpage components;
• saving module 340 for saving test flows to test flow(s) library 362 and test cases to test case(s) library 364;
• expected results module 342 for obtaining expected results for a test flow or test case and optionally saving the expected results in expected results library 366;
• optional submitting module 344 for sending one or more test cases to a server system for execution;
• optional test results receiving module 346 for receiving test results from the server system and optionally saving the test results in test results library 368; and
• analyzing module 348 for analyzing the test results received from server system 108 (i.e., against the expected results); and client data 360 optionally storing data associated with the automated webpage testing and debugging application, including one or more of, but not limited to:
• test flow(s) library 362 storing test flows submitted by the user of test device 102;
• test case(s) library 364 storing test cases submitted by the user of test device 102;
• expected results library 366 storing expected results for test flows and/or test cases; and
• test results library 368 storing test results for executed test cases. [0032] Each of the above identified elements may be stored in one or more of the previously mentioned memory devices, and corresponds to a set of instructions for
performing a function described above. The above identified modules or programs (i.e., sets of instructions) need not be implemented as separate software programs, procedures, modules or data structures, and thus various subsets of these modules may be combined or otherwise re-arranged in various implementations. In some implementations, memory 306, optionally, stores a subset of the modules and data structures identified above. Furthermore, memory 306, optionally, stores additional modules and data structures not described above.
[0033] In some embodiments, at least some of the functions of plug-in 106 are performed by a server system, and the corresponding sub-modules of these functions may be located within the server system rather than plug-in 106. For example, the functions of generating module 338 and saving module 340 may be performed by the server system. In another example, the functions of test execution module 220, screenshot module 222, and test result analyzing module 224 are performed by plug-in 106. Test device 102 shown in FIG. 3 is merely illustrative, and different configurations of the modules for implementing the functions described herein are possible in various embodiments.
[0034] Attention is now directed towards embodiments of user interfaces and associated processes that may be implemented on a test device 102 with zero or more speakers, zero or more microphones, and a display. For example, the display is a touch screen (sometimes also herein called a "touch screen display") enabled to receive one or more contacts and display information (e.g., media content, websites and webpages thereof, and/or user interfaces for application(s) 326). FIGS. 4A-4C illustrate exemplary user interfaces for facilitating automated webpage testing and debugging in accordance with some embodiments.
[0035] Although some of the examples that follow will be given with reference to inputs on a touch screen (where the touch sensitive surface and the display are combined), in some embodiments, the device detects inputs on a touch- sensitive surface that is separate from the display. In some embodiments, the touch sensitive surface has a primary axis that corresponds to a primary axis on the display. In accordance with these embodiments, the device detects contacts with the touch-sensitive surface at locations that correspond to respective locations on the display. In this way, user inputs detected by the device on the touch- sensitive surface are used by the device to manipulate the user interface on the display of the device when the touch- sensitive surface is separate from the display. It should be understood that similar methods are, optionally, used for other user interfaces described herein.
[0036] Additionally, while the following examples are given primarily with reference to contacts (e.g., finger inputs such as finger contacts, finger tap gestures, finger swipe gestures, etc.), it should be understood that, in some embodiments, one or more of the contacts are replaced with input from another input device (e.g., a mouse-based, stylus-based, or physical button-based input). For example, a swipe gesture is, optionally, replaced with a mouse click (e.g., instead of a contact) followed by movement of the cursor along the path of the swipe (e.g., instead of movement of the contact). As another example, a tap gesture is, optionally, replaced with a mouse click while the cursor is located over the location of the tap gesture (e.g., instead of detection of the contact followed by ceasing to detect the contact) or depression of a physical button. Similarly, when multiple user inputs are simultaneously detected, it should be understood that multiple computer mice are, optionally, used simultaneously, or a mouse and finger contacts are, optionally, used simultaneously.
[0037] FIGS. 4A-4C show user interface 404 displayed on test device 102 (e.g., a mobile phone); however, one skilled in the art will appreciate that the user interfaces shown in FIGS. 4A-4C may be implemented on other similar computing devices. The user interfaces in FIGS. 4A-4C are used to illustrate the processes described herein, including the process described with respect to FIGS. 5 and 7A-7B.
[0038] FIG. 4A illustrates test device 102 executing a web browser (e.g., web browser module 324, FIG. 3). In FIG. 4A, the web browser is displaying a landing page (or any accessible page) for a website (e.g., a news aggregation outlet). In FIG. 4A, the web browser includes a web address bar 406 showing a URL for the landing page of the website as the current web address, refresh affordance 408 for reloading the current webpage, back navigation affordance 410-A for displaying the last webpage, and forward navigation affordance 410-B for displaying the next webpage. In FIG. 4A, the web browser also includes plug-in affordance 402, which, when activated (e.g., with a tap gesture), causes execution of a plug-in (e.g., plug-in 106, FIG. 3) associated with an automated webpage testing and debugging application.
[0039] In FIG. 4A, the landing page for the website includes a plurality of webpage components, such as a logo picture 412 associated with the website, a search field 414 for searching the website, and advertisements 434- A and 434-B. In FIG. 4A, the landing page for the website also includes other webpage components, such as a first content section corresponding to "Today's Top News Story" 416 with a snippet or preview 418 of the news top story, a bookmark affordance 420 for bookmarking the top news story, and a comment entry field 422 for entering a comment related to the top news story. In FIG. 4A, the landing page for the website further includes other webpage components, such as a second content section corresponding to "Today's Top Sports Story" 424 with a snippet or preview 426 of the top sports story, a bookmark affordance 428 for bookmarking the top sports story, a user comments section 430 with user comments related to the top new story, and a comment entry field 432 for entering a comment related to the top sports story. The webpage components shown in FIG. 4A are merely exemplary, many other webpage components may be included in a given webpage for testing.
[0040] FIG. 4A further illustrates test device 102 detecting contact 436 at a location corresponding to plug-in affordance 402. In some embodiments, in response to detecting selection of plug-in affordance 402, plug-in 106 is activated, and starts the functions and interfaces for selecting test nodes and construction test cases for automated webpage testing and debugging.
[0041] As shown in FIG. 4B, while plug-in 106 is active, the browser interface detects contact 438 at a location corresponding to a reference webpage component, e.g., comment entry field 422. Note that while the plug-in 106 is active, the input on the displayed webpage does not trigger the operations associated with the invoked webpage component; instead, the input is used to select the webpage component as the reference webpage component for identifying one or more additional similar webpage components in the webpage. In this particular example, while the plug-in 1106 is active, the contact 438 on the comment entry field 422 does not cause a text input cursor to appear in the comment entry field, instead, the contact 438 causes the comment entry field 422 to be selected as the reference webpage component by the plug-in 106 for identifying one or more other webpage components in the webpage that are similar to the comment entry field 422, such as comment entry field 432 in the webpage.
[0042] As shown in FIG. 4C, after the user has selected the reference webpage component from the browser interface while the plug-in is active, a user interface 440 for arranging a test flow is displayed. In some embodiments, user interface 440 includes a first region 439 with a plurality of graphical representations corresponding to the web page components on the web page displayed in FIG. 4A. In some embodiments, each one of the graphical representations is associated with a test script corresponding to a web page component.
[0043] As shown in FIG. 4C, plug-in 106 has identified one similar webpage component (e.g., comment entry field 432) as the selected reference webpage component (e.g., comment entry field 422) in the webpage, and displays a respective representation (e.g., representations 452 and 460, respectively) for the selected reference webpage component and the identified similar webpage component for the reference webpage component. If there are more than one similar webpage component to the reference webpage component in the webpage, all of the similar webpage components will be displayed in the region 439. In some embodiments, if the user selects one of the similar webpage component, the plug-in designates the selected webpage component as the new reference webpage component, and optionally searches and finds one or more additional similar webpage components for the new reference webpage component. The additional similar webpage components, and the previously identified similar webpage components can all be displayed in the region 439 with the original reference webpage component. In some embodiments, the selection of new reference webpage component and the search and presentation of additional similar webpage components can be continued until all webpage components that are similar to one another are identified and displayed in the region 439.
[0044] In some embodiments, as shown in FIG. 4C, the user interface 440 also includes second region 465 for arranging a test flow. For example, the user of client device 102 arranges a test flow in second region 465 of user interface 440 by dragging graphical representations (e.g., contact 442 dragging the graphical representation 460) from first region 439 into second region 465 where the user may further reorder the sequence of graphical representations and/or remove graphical representations from the sequence.
[0045] In FIG. 4C, user interface 440 further includes "Record Expected Results" affordance 461, which, when activated (e.g., with a tap gesture), causes the plug-in to display a user interface that prompts the user of client device 102 to perform actions indicating the expected results for the test flow. In FIG 4C, user interface 440 further includes "Submit Test Flow" affordance 462, which, when activated (e.g., with a tap gesture), causes the plug- in to submit the test flow by locally saving the test flow arranged in second region 465 in test flow(s) library 362 and/or remotely saving the test flow arranged in second region 465 in test flow/case library on a server. In FilG. 4C, user interface 440 further includes "Other
Options" affordance 463, which, when activated (e.g., with a tap gesture), causes the plug-in to display a user interface that enables the user of client device 102 to view previously saved test flows and test cases (e.g., in a second user interface for arranging a test case), and to submit test case(s) for execution cases (e.g., in a third user interface for executing test case(s)).
[0046] In some embodiments, each graphical representation in the second region 465 optionally displays an options panel in response to selection of a graphical representation for a webpage component. The options panel allows the user of client device 102 to edit options associated with the webpage component for the test flow. For example, for the graphical representation of the comment entry field 422, the options panel may include an "Enter Test Text" affordance, which, when activated (e.g., with a tap gesture), causes client device 102 to display a virtual keyboard for entering test text for executing the test script corresponding to comment field representation 460. The options panel may also include a "Remove from Test Flow" affordance, which, when activated (e.g., with a tap gesture), causes plug-in 106 to remove the graphical representation of the webpage component from the test flow. The options panel may further include an "Other Options" affordance which, when activated (e.g., with a tap gesture), causes client device 102 to display a set of options for adjusting and/or manipulating the test script corresponding to graphical representation of the webpage component. In some embodiments, the plug-in 106 determines at least some of the options available for each webpage component based on the configuration information associated with the webpage component. In one example, if the webpage component is a text input field, one of the options available to the graphical representation of the text input field is for collecting a text input test pattern from the user. In another example, if the webpage component is a drop down menu, the options available to the graphical representation of the drop-down menu is for collecting a selection input for the drop down menu. In some embodiments, one of the options provided for a graphical representation is for the user to identify a storage location where the required test input for the corresponding web page component may be found.
[0047] In some embodiments, after arranging the graphical representations of the webpage components in the second region 465 and configuring the test options for the test scripts associated with the graphical representations in the second region 465, the user can submit the test flow by tapping the "Submit Test Flow" affordance 462. For example, in response to selection of "Submit Test Flow" affordance 462, plug-in 106 submits the test flow by locally saving the test flow arranged in second region 465 to test flow(s) library 362 (Figure 3) and/or submitting the test flow to a server system where the test flow arranged in second region 465 is saved remotely in test flow/case library. The test flows can be selected later to construct more complex test cases or executed through operation of the plug-in 106.
[0048] Although the discussion above makes reference to a plug-in installed on a web browser application, in some embodiments, the functions of the plug-in 106 can be implemented in a standalone software application that is configured to display a webpage to be tested in a browser component, and provides the user interfaces for selecting reference webpage component and constructing test flows based on the selected reference webpage component and one or more similar webpage components identified by the standalone software application in accordance with the technique disclosed herein.
[0049] FIG. 5 is a flowchart of a method for selecting test nodes in a webpage in accordance with some embodiments. Referring to FIG. 5, the procedure includes:
[0050] Step 501: Obtain a reference node in a webpage.
[0051] The reference node (also referred as a reference webpage component) is a node selected by test personnel, and subsequent steps are performed by using the node as a reference, so as to find similar nodes of the reference node. A feature of the similar nodes may be defined by the test personnel, and a search condition in subsequent steps may be set by using the feature. For example, in a preferred implementation manner, the similar nodes refer to nodes having similar functions and similar positions in the webpage, and a quantitative index of the similar nodes is that: nodes with only one node sequence number being different in their paths are similar nodes to each other; that is, only one node sequence number in the path of a similar node of the reference node is different from the corresponding node sequence numbers in the path of the reference node. For example, all "Like" buttons in FIG. 2 are similar nodes to each other, and all "+TA Glory" buttons are also similar nodes to each other.
[0052] In some embodiments, the obtaining a reference node in a webpage may be selecting one node by using a visualized selection tool in an existing webpage automated test tool. Specifically, a webpage to test is opened in a browser, the visualized selection tool in the webpage automated test tool is started, for example, a webpage in FIG. 2 may be presented, and then, the test personnel selects one node in the webpage as the reference node by using a mouse. In some embodiments, after a click instruction for a node is received from the user, it is determined that the reference node in the webpage is obtained.
[0053] Step 502: Obtain a path of the reference node in the webpage.
[0054] The path of the reference node in the webpage represents a hierarchical structure and a position of the reference node in the webpage. FIG. 6A is a schematic diagram of a path of a node in a webpage. The path of the node in the webpage is generally represented by using an Extensible Markup Language (XML) path language (XPath), a Finder path, or another representation manner having an equivalent meaning.
[0055] The XPath is a language used for determining a position of a part in an XML document, "/html/body /div[2]/table[3]/tr[4]/td[5]" represents a 5th td tag in a 4th tr in a 3rd table in a 2nd div in a body tag, as shown by the shaded part in FIG. 6A.
[0056] The Finder path represents a unique path of a node in the entire page and can be identified by a JavaScript language, and a jQuery function library is used in the following example.
[0057] A example representation of the finder path is as follows: [0058] "$(''body' hildren(''div' .eq ^
ildren("td").eq(4)"
[0059] The above representation represents the 5th td tag in the 4th tr in the 3rd table in the 2nd div in the body tag, as shown by the shaded part in FIG. 6A.
[0060] Step 503: Search the webpage, starting from the reference node, for a similar node of the reference node level by level according to a respective level of the path of the reference node. This is done to find all similar nodes on each level below the respective level of the reference node.
[0061] In this step, the searching for similar nodes, starting from the reference node, level by level up the upper- level structures of the path, specifically includes:
[0062] A: using the reference node as a current node, and performing the following steps:
[0063] B: determining a parent node of the current node;
[0064] C: determining all child nodes of the parent node, removing a child node in which the current node is located from all the child nodes to obtain remaining child nodes;
[0065] D: traversing the remaining child nodes, and searching the remaining child nodes for similar nodes of the reference node; and
[0066] E: determining whether the parent node is a "body" node, if yes, ending the procedure of searching for the similar nodes, and otherwise, using the parent node as the current node, where the process returns to Step B.
[0067] In some embodiments, the searching for similar nodes of the reference node specifically is that: only one node sequence number in a path of the similar node is different from the corresponding node sequence numbers in the path of the reference node.
[0068] In some embodiments, Step D specifically includes: traversing the remaining child nodes; for each remaining node, obtaining a path of the remaining child node, comparing the path of the remaining child node and the path of the reference node, and when only one node sequence number in the path of the remaining child node is different from the corresponding node sequence numbers in the path of the reference node, determining that the remaining child node is the similar node of the reference node.
[0069] In some embodiments, to facilitate a search for the similar node of the reference node, a search condition may be set, and an initial value of the search condition is set to null. Step D specifically includes: traversing the remaining child nodes, searching the remaining child nodes for a remaining node matching the search condition, and using the matched remaining node as the similar node of the reference node. Step E specifically includes: if the parent node is not a body node, obtaining a differential path by subtracting a path of the parent node from the path of the reference node, setting the search condition to the differential path, and using the parent node as the current node, where the process returns to Step B.
[0070] Step 504: Submit the found reference node and the similar nodes of the reference node for use in construction a test flow.
[0071] In some embodiments, the submitted reference node and similar nodes of the reference node may be used as test nodes for tests.
[0072] In some embodiments, the submitted reference node and the similar nodes of the reference node may also be used as candidate test nodes and presented to the test personnel for the test personnel to perform further filtering. In some embodiments, after the found reference node and the similar nodes of the reference node are submitted, the method further includes: presenting the reference node and the similar nodes of the reference node, and after a selection instruction for a reference node or a similar node is received, automatically selecting a similar node of the reference node, or automatically selecting a reference node of the similar node and another similar node of the reference node. As shown in FIG. 2, when a user selects one "Like" button, all other "Like" buttons in the current webpage are also selected, so that when one reference node or similar node is selected, a program can automatically select all similar nodes of the reference node or similar node, thereby achieving the effect of intelligently selecting similar nodes without the need of manual designation. [0073] In addition, in some embodiments, when multiple nodes have similar nodes
(for example, a node a has similar nodes al, a2, and a3; and a node b has similar nodes bl, b2, and b3) in a test example, and there are two following requirements in the test example:
suppose that the nodes a and b need to have the same number of similar nodes, the similar nodes of the node a need to correspond to the similar nodes of the node b one by one, and al needs to match bl, and a2 needs to match b2. In this case, in both the first solution in the prior art and the second solution in the prior art, matching is extremely difficult.
[0074] Meanwhile, in accordance with the present technique, the foregoing matching problem may be addressed. In some embodiments, the number of the obtained reference nodes may also be at least two; for each reference node, the method of the present technique can be used to select a similar node of each of the reference nodes. After the found reference node and the similar nodes of the reference node are submitted, the method may further include: presenting the reference node and the similar nodes of the reference node, after a selection instruction for a reference node or a similar node is received, determining a page unit in which the reference node or the similar node is located, and automatically selecting other reference nodes or similar nodes in the page unit. For example, as shown in FIG. 2, the "Like" button is a reference node, and the "+TA Glory" button is also a reference node.
When a user selects a "Like" button 201, a "+TA Glory" button 202 in a same page unit as the button 201 is also automatically selected, so that the effect of intelligently matching multiple examples can be achieved when there are multiple groups of similar nodes in a webpage under test.
[0075] In addition, in some embodiments, the method may further include: recording a node level according to the path of the reference node, and recording a similar node of the reference node that corresponds to each level equal or below the node level. In this way, the similar nodes may be grouped according to level, making it easy for the test personnel to implement grouped and classified test examples.
[0076] To sum up, the present solution can implement intelligent search for similar nodes, and all similar nodes can be found as long as one reference node is selected by using an automated test system, so that there is no miss in node selection, efficiency is high, and precision is also high; and multiple groups of similar nodes can be intelligently matched one by one without needing manual designation. In addition, because the present solution can be automatically performed by a program according to the steps, when a webpage is
dynamically generated, all similar nodes of one reference node can also be selected as long as one reference node is selected, which is very applicable to the dynamically generated webpage; in addition, the maintenance cost of the present invention is also very low, and if a reference node needs to be modified, similar nodes are automatically replaced without needing one-by-one modification. In addition, according to the present solution, after similar nodes are selected, the similar nodes are presented to test personnel for secondary selection, and a visualized operation can be implemented, so that the operation is simple, and the determination is clear.
[0077] The technical solutions disclosed herein are further described below by using a more specific example.
[0078] FIG. 6B is a schematic diagram of paths of a reference node and its similar nodes in a webpage in accordance with some embodiments. Referring to FIG. 6B,
[0079] 1) It is assumed that a selected reference node is node 602. A feature of an html structure thereof is that: a path of a 2nd span in a 1st li in a 1st ul in a 1st div in a body is described, by using an XPath, as: /html/body/div[l]/ul[l]/li[l]/a[l]/span[2].
[0080] A similar node of the reference node specifically is that: only one node sequence number in the path of the similar node is different from the corresponding node sequence numbers in a path of the reference node, and then, according to this requirement, a similar node at each level of the reference node is as follows:
[0081] 2) Similar nodes at a first level of the reference node 502 (e.g., similar nodes at the same level as the node 502) are a node 601 and a node 603, and XPaths thereof respectively are:
[0082] Node 601: /html/body/div[l]/ul[l]/li[l]/a[l]/span[l]; and
[0083] Node 603: /html/body/div[l]/ul[l]/li[l]/a[l]/span[3]
[0084] Nodes 601 and 603 's paths differ from the path of the reference node 602 by the node sequence number at the level corresponding to span. [0085] 3) Similar node(s) at a second level of the reference node 602 (e.g., similar nodes one level below the node level of the reference node 602) is a node 605, and an XPath thereof is:
[0086] Node 605: /html/body/div[l]/ul[l]/li[l]/a[2]span[2]
[0087] Node 605 's path differ from the path of the reference node 602 by the node sequence number at the level corresponding to a.
[0088] 4) Similar node(s) at a third level of the reference node 602 (e.g., similar nodes two levels below the node level of the reference node 602) is a node 608, and an XPath thereof is:
[0089] Node 608: /html/body/div[l]/ul[l]/li[2]/a[l]/span[2]
[0090] Node 608 's path differ from the path of the reference node 602 by the node sequence number at the level corresponding to li.
[0091] 5) Similar node(s) at a fourth level of the reference node 602 (e.g., similar nodes three levels below the node level of the reference node 602) is a node 612, and an XPath thereof is:
[0092] Node 612: /html/body/div[l]/ul[3]/li[l]/a[l]/span[2]
[0093] Node 612's path differ from the path of the reference node 602 by the node sequence number at the level corresponding to ul.
[0094] 6) Similar node(s) at a fifth level of the reference node 602 (e.g., similar nodes three levels below the node level of the reference node 602) are node 617 and node 619, and XPaths thereof respectively are:
[0095] Node 617: /html/body/div[3]/ul[l]/li[l]/a[l]/span[2]; and
[0096] Node 619: /html/body/div[4]/ul[l]/li[l]/a[l]/span[2]
[0097] Nodes 617 and 619's paths differ from the path of the reference node 602 by the node sequence number at the level corresponding to div. [0098] Specific steps of selecting the similar node(s) at each level of the reference node 602 by using the method of the present technique can be described in detail as below:
[0099] Step 601: Open a project page in a browser, and start a visualized webpage automated test tool.
[00100] Step 602: Select a reference node from a webpage by using a visualized selection tool; for example, the node 502 is selected herein.
[00101] Step 603: Obtain a level hierarchy structure of the reference node in the webpage; for example, calculate a path of the reference node by using JavaScript; for example, the path is an XPath path herein, store the path as a variable XPATH, and set a path of a current node as an xpath, where xpath = XPATH, and the path of the reference node is, for example, as follows:
[00102] Var XPATH = : /html/body/div[l]/ul[l]/li[l]/a[l]/span[2]
[00103] Step 604: Set a search condition to null, and represent it as a variable seach; and set the number of levels to 1, and represent it as a variable level as follows:
[00104] var seach = ' '; and
[00105] var level = 1;
[00106] Step 605: Obtain a node type of the xpath, and store it as a variable tagName, for example, as follows:
[00107] var tagName =span;
[00108] Step 606: Obtain a sequence of the tagName in the xpath, and store it as a variable index, which is, for example:
[00109] var index = 2;
[00110] Step 607: Obtain a path of a parent node of the xpath as a variable parent as follows:
[00111] var parent = : /html/body/div[l]/ul[l]/li[l]/a[l]; [00112] Step 608: Obtain all child nodes of the parent that have the current tagName, and remove the (index)t child node to obtain an array nodeList, for example, as follows:
[00113] var nodeList = { span[l], span[3] };
[00114] Step 609: iteratively traverse all nodes in the nodeList, determine whether each node includes any corresponding nodes matching seach, and if the matched nodes can be found, the nodes are similar nodes at a (level)t level of the reference node. If the value of the variable seach is null, a search for similar nodes is not performed, and all the nodes in the nodeList are similar nodes of the reference node by default.
[00115] For example, suppose seach is null at the present time, and similar nodes found at the first level are the node 601 and the node 603. The XPath paths respectively are:
[00116] Node 601: /html/body/div[l]/ul[l]/li[l]/a[l]/span[l]; and
[00117] Node 603: /html/body/div[l]/ul[l]/li[l]/a[l]/span[3]
[00118] Step 6010: Store all the similar nodes at the (level)t level into a two- dimensional array similarity [level], that is, the similar nodes at the (level)t level of the reference node can be represented in a form of a two-dimensional array.
[00119] Step 6011: Subtract the path parent of the parent node from the path XPATH of the reference node, set a differential path to a new search condition seach, and then, set the path parent of the current parent node to a new xpath, where the level is automatically increased by 1, for example, as follows:
[00120] Seach =XPATH - parent
= /span[2]; xpath = parent; level ++;
Step 6012: Return to Step 605 until the value of tagName becomes the tag [00122] A process of searching for similar nodes after the process returns to Step 605 is described below by using a process of searching for similar nodes at the second level as an example, and a process of searching for a similar node at another level can be deduced accordingly.
[00123] Following Step 6012 in the foregoing, when the process returns to Step 605:
[00124] seach =XPATH -parent
= /span[2]; xpath = parent = : /html/body/div[l]/ul[l]/li[l]/a[l]; level = 2;
[00125] Therefore, the process of searching for a similar node at the second level is as follows:
Step 605: Obtain a node type of the xpath, and store it as a variable tagName
[00127] var tagName = a;
[00128] Step 606: Obtain a sequence number of the tagName in the xpath, and store it as a variable index, which is:
[00129] var index = 1 ;
[00130] Step 607: Obtain a path of a parent node of the xpath as a variable parent as follows:
[00131] var parent = : /html/body /div[l]/ul[l]/li[l];
[00132] Step 608: Obtain the child nodes of the parent that have the current value of tagName, and remove an (index)t child node to obtain an array nodeList as follows:
[00133] var nodeList = {a[2], a[3] }; [00134] Step 609: Iteratively traverse all nodes in the nodeList, determine whether each node includes a corresponding node matching seach, and if a matched node can be found, the node is a similar node at the (level)t level of the reference node.
[00135] For example, when seach = /span[2] at this time, the similar node found at the second level is the node 605, and the XPath thereof is:
/html/body/div[ 1 ]/ul[ 1 ]/li[ 1 ]/a[2] span[2] .
[00136] Step 6010: Store all the similar nodes (that is, the node 605) at the (level)t level into a two-dimensional array similarity [level], that is, the similar nodes at the (level)t level of the reference node can be represented in a form of a two-dimensional array; in this way, the similar nodes can be grouped according to a level, making it easy for test personnel to implement grouped and classified test examples.
[00137] Step 6011 : Subtract the path parent of the parent node from the path XPATH of the reference node, set a differential path to a new search condition seach, and then, set the path parent of the current parent node to a new xpath, where the level is automatically increased by 1, as follows:
[00138] seach =XPATH -parent
= a[l]/span[2]; xpath = parent = : /html/body/div[l]/ul[l]/li[l] level =3;
[00139] Step 6012: The process returns to Step 605, and search for similar nodes at the third level of the reference node until the value of tagName becomes the tag body.
[00140] By using the method in Step 605 to Step 6012, similar nodes at the third level, the fourth level, and the fifth level of the reference node 602 can be found one by one until the value of the tagName becomes body. At this time, all the similar nodes at each level of the reference node 602, that is, nodes 601, 603, 605, 608, 612, 617, and 619, are found. [00141] Finally, these similar nodes can be output to an automated test program, so as to complete a test on the webpage.
[00142] FIGS. 7A-7B illustrates a flowchart diagram of a method 700 of providing automated web testing in accordance with some embodiments. In some embodiments, operations of method 700 are performed by a test device with one or more processors and memory. For example, in some embodiments, the operations are performed by the test device 102 (FIG. 3) or a component thereof (e.g., plug-in 106, FIG. 3). In some
embodiments, method 700 is governed by instructions that are stored in a non-transitory computer readable storage medium of the test device.
[00143] In some embodiments, at the device having one or more processors and memory: specification of a reference webpage component in a webpage is obtained (702). In some embodiments, obtaining the specification of the reference webpage component in the webpage further includes (704): while displaying the webpage in a web browser executed on the device, activating a plug-in associated with webpage testing and debugging; and detecting a user input selecting the reference webpage component in the webpage through the activated plug-in associated with webpage testing and debugging. This is illustrated in FIGS. 4A-4B, for example. In some embodiments, obtaining the specification of the reference webpage component in the webpage further includes (706): displaying the webpage in a browser component of test software executed on the device; and detecting a user input selecting the reference webpage component in the webpage through the browser component.
[00144] In some embodiments, the test device determines (708) a path of the reference webpage component in the webpage. For example, the path of the reference webpage component can be a Finder path, such as ": /html/body/div[l]/ul[l]/li[l]/a[l]/span[2]". The path can be obtained using a js script.
[00145] In some embodiments, the test device identifies (710) in the webpage one or more similar webpage components for the reference webpage component. In some embodiments, the identifying includes (712): searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage. In some embodiments, searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage further comprises (714): determining a node level of the reference webpage component in the webpage in accordance with the path of the reference webpage component; for each respective level at or below the node level of the reference webpage component: searching for all webpage components having respective paths that are identical to the path of the reference webpage component except for a component at the respective level; and designating the webpage components identified through the searching as similar webpage components for the reference component at the respective level. In some embodiments, the search is performed in accordance with the method described with respect to FIGS. 5 and 6A-6B above.
[00146] In some embodiments, the test device provides (716) the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage.
[00147] In some embodiments, providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage further includes (718): displaying respective graphical representations of the reference webpage component and each of the one or more similar webpage components in a selection window. This is shown in FIG. 4C, for example.
[00148] In some embodiments, the test device receives (720) user input dragging two or more of the respective graphical representations of the reference webpage component and the one or more similar webpage components from the selection window to a test case construction window. The test device constructs (722) a test case for automated testing of the webpage based on the two or more webpage components in the test case construction window.
[00149] In some embodiments, the test device receives (724) user input selecting one or more of the respective graphical representations of the reference webpage component and the one or more similar webpage components from the selection window. In response to the user input: the test device searches (726) for additional similar webpage components of the selected one or more webpage components in accordance with the similarity criterion based on the path of the selected one or more webpage components; and displays respective graphical representations of the selected webpage components and similar webpage components thereof identified through the searching in the selection window. [00150] It should be understood that the particular order in which the operations in
Figures 7A-7B have been described is merely exemplary and is not intended to indicate that the described order is the only order in which the operations could be performed. One of ordinary skill in the art would recognize various ways to reorder the operations described herein. Additionally, it should be noted that details of other processes described herein with respect to other methods described herein are also applicable in an analogous manner to method 700 described above with respect to Figures 7A-7B.
[00151] Corresponding to the foregoing processes, an apparatus for selecting test nodes in a webpage, which is used to execute the foregoing methods are disclosed. FIG. 8 is a schematic structural diagram of an apparatus for selecting test nodes in a webpage according to some embodiments. Referring to FIG. 8, the selection apparatus specifically includes: a reference node module 821, used to obtain a reference node in a webpage; a path module 822, used to obtain a path of the reference node in the webpage; a search module 823, used to search the webpage, starting from the reference node, for similar nodes of the reference node level by level according to a node level of the path of the reference node. A similar node of the reference node specifically is a node with only one node sequence number in a path being different from the corresponding node sequence numbers in the path of the reference node. The apparatus further includes a submission module 824, used to submit the found reference node and the similar node of the reference node.
[00152] In some embodiments, the search module 823 specifically includes: a first unit, used to use the reference node as a current node; a second unit, used to determine a parent node of the current node; a third unit, used to determine all child nodes of the parent node, remove a child node in which the current node is located from all the child nodes to obtain remaining child nodes; a fourth unit, used to traverse the remaining child nodes and search the remaining child nodes for a similar node of the reference node; and a fifth unit, used to determine whether the parent node is a body node, if yes, end the process, and otherwise, use the parent node as the current node, where the process returns to the second unit.
[00153] In some embodiments, the fourth unit is specifically used to: traverse the remaining child nodes, for each remaining node, obtain a path of the remaining child node, compare the path of the remaining child node and the path of the reference node, and when only one node sequence number in the path of the remaining child node is different from the node sequence number in the path of the reference node, determine that the remaining child node is the similar node of the reference node.
[00154] In some embodiments, the search module may further include a search condition unit, used to set a search condition, where an initial value of the search condition is null. In some embodiments, the fourth unit is specifically used to: traverse the remaining child nodes, and search the remaining child nodes for a remaining node matching the search condition, and use the matched remaining node as the similar node of the reference node; and
[00155] In some embodiments, the apparatus further includes a fifth unit. The fifth unit is specifically used to: if the parent node is not a body node, obtain a differential path by subtracting a path of the parent node from the path of the reference node, set the search condition to the differential path, and use the parent node as the current node, and where the process returns to the second unit.
[00156] In some embodiments, the apparatus includes a level recording module 625, used to record a level according to the path of the reference node, and record the similar node(s) of the reference node that corresponds to each level at or below the node level of the reference node.
[00157] In some embodiments, in addition to the submission module 824, the apparatus further includes a first filtering module 826, used to: present the reference node and the similar node(s) of the reference node, and after a selection instruction for a reference node or a similar node is received, automatically select one or more similar node(s) of the reference node, or automatically select a reference node of the selected similar node and one or more other similar node(s) of the reference node.
[00158] In some embodiments, in addition to the submission module 824, the apparatus further includes a second filtering module 827, used to: present the reference node and the similar node of the reference node, after a selection instruction for a reference node or a similar node is received, determine a page unit in which the reference node or the similar node is located, and automatically select another reference node or similar node in the page unit. [00159] In some embodiments, the selection apparatus may include both the first filtering module 826 and the second filtering module 827, or may include either.
[00160] In addition, the functional modules in the various embodiments may be integrated into one processing unit, or each of the modules may exist alone physically, or two or more modules may be integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software functional unit. The functional modules in the embodiments may be located in a terminal or a network node, or may be distributed to multiple terminals or network nodes.
[00161] While particular embodiments are described above, it will be understood it is not intended to limit the application to these particular embodiments. On the contrary, the application includes alternatives, modifications and equivalents that are within the spirit and scope of the appended claims. Numerous specific details are set forth in order to provide a thorough understanding of the subject matter presented herein. But it will be apparent to one of ordinary skill in the art that the subject matter may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the embodiments.

Claims

1. A method of facilitating automated webpage testing and debugging, comprising:
at a device having one or more processors and memory:
obtaining specification of a reference webpage component in a webpage; determining a path of the reference webpage component in the webpage;
identifying in the webpage one or more similar webpage components for the reference webpage component, wherein the identifying comprises:
searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage; and
providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage.
2. The method of claim 1, wherein obtaining the specification of the reference webpage component in the webpage further includes:
while displaying the webpage in a web browser executed on the device, activating a plug-in associated with webpage testing and debugging; and
detecting a user input selecting the reference webpage component in the webpage through the activated plug-in associated with webpage testing and debugging.
3. The method of claim 1, wherein obtaining the specification of the reference webpage component in the webpage further includes:
displaying the webpage in a browser component of test software executed on the device; and
detecting a user input selecting the reference webpage component in the webpage through the browser component.
4. The method of claim 1, wherein searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage further comprises:
determining a node level of the reference webpage component in the webpage in accordance with the path of the reference webpage component;
for each respective level at or below the node level of the reference webpage component:
searching for all webpage components having respective paths that are identical to the path of the reference webpage component except for a component at the respective level; and
designating the webpage components identified through the searching as similar webpage components for the reference component at the respective level.
5. The method of claim 1, wherein providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage further comprises:
displaying respective graphical representations of the reference webpage component and each of the one or more similar webpage components in a selection window.
6. The method of claim 5, further comprising:
receiving user input dragging two or more of the respective graphical representations of the reference webpage component and the one or more similar webpage components from the selection window to a test case construction window; and
constructing a test case for automated testing of the webpage based on the two or more webpage components in the test case construction window.
7. The method of claim 5, further comprising:
receiving user input selecting one or more of the respective graphical representations of the reference webpage component and the one or more similar webpage components from the selection window;
in response to the user input:
searching for additional similar webpage components of the selected one or more webpage components in accordance with the similarity criterion based on the path of the selected one or more webpage components; and
displaying respective graphical representations of the selected webpage components and similar webpage components thereof identified through the searching in the selection window.
8. A system for facilitating automated webpage testing and debugging, comprising: one or more processors; and
memory having instructions stored thereon, the instructions, when executed by the one or more processors, cause the processors to perform operations comprising:
obtaining specification of a reference webpage component in a webpage; determining a path of the reference webpage component in the webpage;
identifying in the webpage one or more similar webpage components for the reference webpage component, wherein the identifying comprises:
searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage; and
providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage.
9. The system of claim 8, wherein obtaining the specification of the reference webpage component in the webpage further includes:
while displaying the webpage in a web browser executed on the device, activating a plug-in associated with webpage testing and debugging; and
detecting a user input selecting the reference webpage component in the webpage through the activated plug-in associated with webpage testing and debugging.
10. The system of claim 8, wherein obtaining the specification of the reference webpage component in the webpage further includes:
displaying the webpage in a browser component of test software executed on the device; and
detecting a user input selecting the reference webpage component in the webpage through the browser component.
11. The system of claim 8, wherein searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage further comprises:
determining a node level of the reference webpage component in the webpage in accordance with the path of the reference webpage component; for each respective level at or below the node level of the reference webpage component:
searching for all webpage components having respective paths that are identical to the path of the reference webpage component except for a component at the respective level; and
designating the webpage components identified through the searching as similar webpage components for the reference component at the respective level.
12. The system of claim 8, wherein providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage further comprises:
displaying respective graphical representations of the reference webpage component and each of the one or more similar webpage components in a selection window.
13. The system of claim 12, wherein the operations further comprise:
receiving user input dragging two or more of the respective graphical representations of the reference webpage component and the one or more similar webpage components from the selection window to a test case construction window; and
constructing a test case for automated testing of the webpage based on the two or more webpage components in the test case construction window.
14. The system of claim 12, wherein the operations further comprise:
receiving user input selecting one or more of the respective graphical representations of the reference webpage component and the one or more similar webpage components from the selection window;
in response to the user input:
searching for additional similar webpage components of the selected one or more webpage components in accordance with the similarity criterion based on the path of the selected one or more webpage components; and
displaying respective graphical representations of the selected webpage components and similar webpage components thereof identified through the searching in the selection window.
15. A non-transitory computer-readable medium having instructions stored thereon, the instructions, when executed by one or more processors, cause the processors to perform operations comprising:
obtaining specification of a reference webpage component in a webpage;
determining a path of the reference webpage component in the webpage;
identifying in the webpage one or more similar webpage components for the reference webpage component, wherein the identifying comprises:
searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage; and
providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage.
16. The computer-readable medium of claim 15, wherein obtaining the specification of the reference webpage component in the webpage further includes:
while displaying the webpage in a web browser executed on the device, activating a plug-in associated with webpage testing and debugging; and
detecting a user input selecting the reference webpage component in the webpage through the activated plug-in associated with webpage testing and debugging.
17. The computer-readable medium of claim 15, wherein obtaining the specification of the reference webpage component in the webpage further includes:
displaying the webpage in a browser component of test software executed on the device; and
detecting a user input selecting the reference webpage component in the webpage through the browser component.
18. The computer-readable medium of claim 15, wherein searching for the one or more similar webpage components in accordance with a similarity criterion based on the path of the reference webpage component in the webpage further comprises:
determining a node level of the reference webpage component in the webpage in accordance with the path of the reference webpage component;
for each respective level at or below the node level of the reference webpage component:
searching for all webpage components having respective paths that are identical to the path of the reference webpage component except for a component at the respective level; and
designating the webpage components identified through the searching as similar webpage components for the reference component at the respective level.
19. The computer-readable medium of claim 15, wherein providing the identified one or more similar webpage components and the reference webpage component for constructing one or more test cases for automated testing of the webpage further comprises:
displaying respective graphical representations of the reference webpage component and each of the one or more similar webpage components in a selection window.
20. The computer-readable medium of claim 19, wherein the operations further comprise: receiving user input dragging two or more of the respective graphical representations of the reference webpage component and the one or more similar webpage components from the selection window to a test case construction window; and
constructing a test case for automated testing of the webpage based on the two or more webpage components in the test case construction window.
PCT/CN2014/085252 2013-09-26 2014-08-27 Method and apparatus for selecting test nodes on webpages WO2015043352A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310452563.X 2013-09-26
CN201310452563.XA CN104516813B (en) 2013-09-26 2013-09-26 The choosing method and device of the test node of Webpage

Publications (1)

Publication Number Publication Date
WO2015043352A1 true WO2015043352A1 (en) 2015-04-02

Family

ID=52742012

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/085252 WO2015043352A1 (en) 2013-09-26 2014-08-27 Method and apparatus for selecting test nodes on webpages

Country Status (2)

Country Link
CN (1) CN104516813B (en)
WO (1) WO2015043352A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488544A (en) * 2020-03-31 2020-08-04 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for determining similar sub-elements of webpage
CN111966600A (en) * 2020-08-31 2020-11-20 平安健康保险股份有限公司 Webpage testing method and device, computer equipment and computer readable storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109814957B (en) * 2017-11-20 2022-06-07 北京京东尚科信息技术有限公司 Label adding method and device for IOS (input/output system)
CN108845925B (en) * 2018-03-30 2022-02-11 新华三技术有限公司 Web page testing method and device, electronic equipment and computer readable medium
CN110554950B (en) * 2018-05-30 2024-02-02 广州腾讯科技有限公司 Interface debugging method and device and storage medium
CN112527621A (en) * 2019-09-17 2021-03-19 中移动信息技术有限公司 Test path construction method, device, equipment and storage medium
CN115543927B (en) * 2022-10-31 2023-06-30 永道工程咨询有限公司 Method and device for extracting field information of cost file, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6804634B1 (en) * 2000-02-17 2004-10-12 Lucent Technologies Inc. Automatic generation and regeneration of a covering test case set from a model
CN101593184A (en) * 2008-05-29 2009-12-02 国际商业机器公司 The system and method for self-adaptively locating dynamic web page elements
US20120054552A1 (en) * 2010-09-01 2012-03-01 International Business Machines Corporation Fault localization using directed test generation
WO2012119267A1 (en) * 2011-03-08 2012-09-13 Hewlett-Packard Development Comany, L.P. Creating a test case

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103268226B (en) * 2013-05-17 2016-07-06 瑞斯康达科技发展股份有限公司 A kind of test script file generates method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6804634B1 (en) * 2000-02-17 2004-10-12 Lucent Technologies Inc. Automatic generation and regeneration of a covering test case set from a model
CN101593184A (en) * 2008-05-29 2009-12-02 国际商业机器公司 The system and method for self-adaptively locating dynamic web page elements
US20120054552A1 (en) * 2010-09-01 2012-03-01 International Business Machines Corporation Fault localization using directed test generation
WO2012119267A1 (en) * 2011-03-08 2012-09-13 Hewlett-Packard Development Comany, L.P. Creating a test case

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488544A (en) * 2020-03-31 2020-08-04 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for determining similar sub-elements of webpage
CN111488544B (en) * 2020-03-31 2023-02-24 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for determining similar sub-elements of webpage
CN111966600A (en) * 2020-08-31 2020-11-20 平安健康保险股份有限公司 Webpage testing method and device, computer equipment and computer readable storage medium
CN111966600B (en) * 2020-08-31 2023-08-04 平安健康保险股份有限公司 Webpage testing method, webpage testing device, computer equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN104516813B (en) 2018-07-27
CN104516813A (en) 2015-04-15

Similar Documents

Publication Publication Date Title
WO2015039566A1 (en) Method and system for facilitating automated web page testing
US10324828B2 (en) Generating annotated screenshots based on automated tests
US9152529B2 (en) Systems and methods for dynamically altering a user interface based on user interface actions
US9507519B2 (en) Methods and apparatus for dynamically adapting a virtual keyboard
WO2015043352A1 (en) Method and apparatus for selecting test nodes on webpages
CN103810089B (en) Automatically testing gesture-based applications
US9424167B2 (en) Automated testing of an application system
US9703462B2 (en) Display-independent recognition of graphical user interface control
US20210011595A1 (en) Terminal and method for determining type of input method editor
US10073766B2 (en) Building signatures of application flows
US10296175B2 (en) Visual presentation of multiple internet pages
US9317257B2 (en) Folded views in development environment
US20190303269A1 (en) Methods and systems for testing visual aspects of a web page
US11748557B2 (en) Personalization of content suggestions for document creation
US20120110459A1 (en) Automated adjustment of input configuration
WO2016095689A1 (en) Recognition and searching method and system based on repeated touch-control operations on terminal interface
US10353721B2 (en) Systems and methods for guided live help
US10067667B2 (en) Method and apparatus for touch gestures
US20150106723A1 (en) Tools for locating, curating, editing, and using content of an online library
US9223455B2 (en) User preference analysis method and device
CN102385475B (en) Electronic device and interactive method thereof
US9588678B2 (en) Method of operating electronic handwriting and electronic device for supporting the same
WO2020232900A1 (en) System test method and apparatus, computer device and storage medium
JP2018181294A (en) Method and system for providing camera-based graphical user interface, computer system, and program
US20150058774A1 (en) Gesture-based visualization of financial data

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14848718

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14848718

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.08.2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14848718

Country of ref document: EP

Kind code of ref document: A1