CN107402882B - Web page testing method and device - Google Patents

Web page testing method and device Download PDF

Info

Publication number
CN107402882B
CN107402882B CN201710599194.5A CN201710599194A CN107402882B CN 107402882 B CN107402882 B CN 107402882B CN 201710599194 A CN201710599194 A CN 201710599194A CN 107402882 B CN107402882 B CN 107402882B
Authority
CN
China
Prior art keywords
node
level
tested
expansion
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710599194.5A
Other languages
Chinese (zh)
Other versions
CN107402882A (en
Inventor
张晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201710599194.5A priority Critical patent/CN107402882B/en
Publication of CN107402882A publication Critical patent/CN107402882A/en
Application granted granted Critical
Publication of CN107402882B publication Critical patent/CN107402882B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

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

Abstract

The application provides a Web page testing method and a Web page testing device, which comprise the following steps: receiving a test instruction, wherein the test instruction carries the name of a tested node; determining an i-level father node of a node to be tested based on a tree menu, and judging whether the i-level father node is in an expansion state or not; wherein i is a natural number greater than 0, and the initial value is 1; when the i-level father node is in an expansion state, executing expansion operation on the father node smaller than the i-level to display the node to be tested, and testing a Web page corresponding to the node to be tested; and when the i-level father node is in a folded state, judging whether the i + 1-level father node of the tested node is in an unfolded state. According to the technical scheme, the code amount of the test script can be reduced, so that the error probability and the maintenance cost of the test script are reduced, and the test efficiency of the Web page is improved.

Description

Web page testing method and device
Technical Field
The present application relates to the field of software testing, and in particular, to a method and an apparatus for testing a Web page.
Background
The tree menu is a common structure in a Web page, and is a navigation menu adopted for conveniently searching each node. In the tree menu, a user can display or hide the subordinate child nodes by expanding or folding the parent node, and can enter the corresponding Web page by clicking the child nodes.
As shown in fig. 1, is an example of a tree menu. In the Tree menu shown in fig. 1, Tree Node 2-1-1 is a child Node, which can be clicked to enter a corresponding Web page, Tree Node 2-1 is a primary parent Node of Tree Node 2-1-1, Tree Node 2 is a secondary parent Node of Tree Node 2-1-1, and Tree Root1 is a Root Node of the Tree menu, and can also be regarded as a tertiary parent Node of Tree Node 2-1-1. Typically, the root node of the tree menu is in an expanded state by default. The tree menu shown in fig. 1 is a four-level tree menu.
When a Web page containing a tree menu is tested, a test script can be written to simulate manual operations of a user, such as: expand parent nodes, click child nodes, etc. If the Web page corresponding to a certain child node needs to be tested, clicking operation can be performed on the child node to enter the corresponding Web page, and then the Web page can be tested. However, if the child node is in a hidden state, it will cause a click failure, resulting in a test failure.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for testing a Web page. Specifically, the method is realized through the following technical scheme:
in a first aspect, the present application provides a Web page testing method, where the method includes:
receiving a test instruction, wherein the test instruction carries the name of a tested node;
determining an i-level father node of a node to be tested based on a tree menu, and judging whether the i-level father node is in an expansion state or not; wherein i is a natural number greater than 0, and the initial value is 1;
when the i-level father node is in an expansion state, executing expansion operation on the father node smaller than the i-level to display the node to be tested, and testing a Web page corresponding to the node to be tested;
and when the i-level father node is in a folded state, judging whether the i + 1-level father node of the tested node is in an unfolded state.
In a second aspect, the present application provides a Web page testing apparatus, including:
the receiving unit is used for receiving a test instruction, and the test instruction carries the name of a tested node;
the first judgment unit is used for determining an i-level father node of a node to be tested based on a tree menu and judging whether the i-level father node is in an expansion state or not; wherein i is a natural number greater than 0, and the initial value is 1;
the first expansion unit is used for executing expansion operation on the father node smaller than the i level when the i level father node is in an expansion state so as to display the tested node and test the Web page corresponding to the tested node;
the first judging unit is further configured to judge whether an i + 1-level father node of the node to be tested is in an unfolded state when the i-level father node is in a folded state.
By analyzing the technical scheme, the tested node and all levels of father nodes of the tested node do not need to be positioned, and different operation functions do not need to be compiled aiming at different nodes to execute corresponding operations, so that the code quantity of the test script is reduced, the error probability and the maintenance cost of the test script are further reduced, and the test efficiency of the Web page is also improved.
Drawings
FIG. 1 is an example of a tree menu;
FIG. 2 is a flow chart illustrating a method for Web page testing in accordance with an exemplary embodiment of the present application;
FIG. 3 is a flow chart illustrating another method of testing a Web page in accordance with an exemplary embodiment of the present application;
fig. 4 is a hardware structure diagram of a device in which a Web page testing apparatus according to an exemplary embodiment of the present application is located;
fig. 5 is a block diagram of a Web page testing apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the related technology, if a user needs to test a Web page corresponding to a child node in a tree menu, the child node and all levels of parent nodes of the child node can be found in the tree menu manually, then the child node and all levels of parent nodes of the child node are positioned by using an element positioning tool, finally an operation function is written in a test script to judge the expansion state/folding state of all levels of parent nodes of the child node, the expansion operation is performed on the parent node in the folding state, and the click operation is performed on the child node after all levels of parent nodes of the child node are expanded to display the child node, so that the corresponding Web page can be tested.
By adopting the mode, if the Web pages corresponding to different child nodes need to be frequently accessed for testing, a large number of child nodes and father nodes thereof need to be positioned, and meanwhile, because the operation functions written aiming at different nodes are different, a large number of operation functions also need to be written, so that the code amount of the test script is increased, the error probability and the maintenance cost of the test script are further improved, and the test efficiency of the Web pages is also reduced.
Referring to fig. 2, a flowchart of a Web page testing method according to an exemplary embodiment of the present application is shown, where the method may be applied to a terminal device, a server, and other testing devices, and includes the following steps:
step 201: and receiving a test instruction, wherein the test instruction carries the name of the tested node.
Step 202: determining an i-level father node of a node to be tested based on a tree menu, and judging whether the i-level father node is in an expansion state or not; wherein i is a natural number greater than 0, and the initial value is 1.
Step 203: and when the i-level father node is in an expansion state, executing expansion operation on the father node smaller than the i-level to display the tested node, and testing the Web page corresponding to the tested node.
Step 204: and when the i-level father node is in a folded state, judging whether the i + 1-level father node of the tested node is in an unfolded state.
In this embodiment, for a main Web page containing a tree menu, if a user wants to enter a node Web page corresponding to a certain child node in the tree menu for testing, a test instruction may be input through a test page provided by a test device to specify a name of a node to be tested. The name of the node to be tested is the name of the child node corresponding to the node Web page which the user wants to test in the tree menu.
Continuing with the Tree menu shown in FIG. 1 as an example, assume that clicking on the child Node Tree Node 2-1-1 can enter Web page 1. If the user wants to test the Web page 1, a test instruction comprising the name of the tested Node Tree Node 2-1-1 can be input through a test page provided by the test equipment.
In this embodiment, after receiving a test instruction input by a user, the name of the node to be tested in the test instruction can be obtained. Subsequently, all child nodes in the tree menu may be searched, and the child node having the same node name as the measured node name is determined as the measured node. In general, for a main Web page based on HTML (HyperText Markup Language), all child nodes in its tree menu have similar class attribute or name attribute. Therefore, all nodes in the tree menu can be traversed, child nodes in the tree menu can be found according to the class attribute or the name attribute and other node attributes, and meanwhile whether the node name of each child node is the name of the tested node can be judged. When the node name of a certain child node is the name of the node to be tested, the child node can be determined as the node to be tested.
After the node to be tested is determined, each level of parent nodes of the node to be tested may be determined based on the tree menu, for example: in a test script written by JavaScript language, a 'parentNode' can be used for obtaining a direct father node of a certain node in a tree menu, and then for the node to be tested, the direct father node can be obtained firstly as a primary father node of the node to be tested; then acquiring a direct father node of the primary father node as a secondary father node of the node to be detected; by parity of reasoning, all levels of father nodes of the tested node can be obtained.
In this embodiment, first, a primary parent node of the node under test may be determined, and whether the primary parent node is in an expanded state may be determined. Specifically, in the node attribute of each node, the expansion identifier of the node is stored. When the expansion mark is expanded, the node is in an expansion state; and when the unfolding mark is folded, the node is in a folded state. Based on the detection, the node attribute of the primary parent node can be detected to judge whether the expansion identifier in the primary parent node is expansion.
Based on the judgment result, if the expansion mark of the primary father node is expansion, the primary father node is in an expansion state at the moment. And when the primary father node is in the unfolding state, the tested node is in the display state. Therefore, the click operation executed on the node to be tested can be simulated by running the test script, so as to enter the Web page corresponding to the node to be tested for testing.
If the expansion mark of the primary father node is folding, the primary father node is in a folding state at the moment. In this case, the secondary parent node of the node under test may be determined continuously, and whether the secondary parent node is in the expanded state may be determined.
Based on the judgment result, if the expansion mark of the secondary father node is expansion, the secondary father node is in an expansion state at the moment. Therefore, at this time, only the expansion operation needs to be performed on the primary parent node of the node under test, for example: and by running the test script, simulating and clicking an expansion button corresponding to the primary parent node to display the tested node. Subsequently, the click operation executed on the node to be tested can be simulated by running the test script, so that the Web page corresponding to the node to be tested is entered for testing.
If the expansion mark of the secondary father node is folding, the secondary father node is in a folding state at the moment. In this case, the determination of the tertiary parent node of the node under test may be continued, and it may be determined whether the tertiary parent node is in the expanded state.
Based on the above determination result, if the expansion flag of the above three-level father node is expanded, it indicates that the three-level father node is in an expanded state at this time, and further indicates that the three-level and above father nodes of the above node to be tested are also in an expanded state. At this time, the expansion operation can be executed on the parent node of the tested node which is less than three levels. Specifically, the expansion operations may be performed on the parent nodes less than three levels of the node under test in order from the parent node level up to the parent node level down, that is: and firstly, carrying out unfolding operation on the secondary father node of the tested node, and then carrying out unfolding operation on the primary father node of the tested node, so that all levels of father nodes of the tested node are in an unfolded state to display the tested node. Subsequently, the click operation executed on the node to be tested can be simulated by running the test script, so that the Web page corresponding to the node to be tested is entered for testing.
If the expansion mark of the three-level father node is folding, the three-level father node is in a folding state at the moment. In this case, the four-level parent node of the node under test may be determined and whether the four-level parent node is in the expanded state may be determined.
And by analogy, until the i-level father node of the tested node is judged to be in the expansion state, the expansion operation can be sequentially executed on the father nodes smaller than the i-level of the tested node according to the ascending order of the father node levels, so that all levels of father nodes of the tested node can be in the expansion state to display the tested node. Subsequently, the click operation executed on the node to be tested can be simulated by running the test script, so that the Web page corresponding to the node to be tested is entered for testing.
The root node of the tree menu is usually in an expanded state, that is, when all father nodes except the root node of the tested node are in a folded state, or when the root node is judged to be in the expanded state, the expansion operation is sequentially executed on all the father nodes except the root node of the tested node according to the descending order of the father node levels so as to display the tested node, and the Web page corresponding to the tested node is tested. However, in some special cases, the root node of the tree menu may be in a collapsed state, and in order to avoid performing unnecessary further determination when determining that the root node is in the collapsed state, it may be determined whether the root node of the tree menu is in an expanded state. If yes, determining all levels of father nodes of the tested node based on the tree menu continuously, and judging whether all levels of father nodes are in an expansion state; otherwise, the root node of the tree menu may be expanded, and then all levels of father nodes of the tested node are determined based on the tree menu, and whether all levels of father nodes are in an expanded state is judged.
In another example, after determining the i-level parent node of the node under test based on the tree menu, it may be determined whether the parent node is the root node of the tree menu. If the father node is not the root node of the tree-shaped menu, when the father node is judged to be in a folded state, further judgment can be carried out, namely whether the i + 1-level father node of the node to be detected is in an unfolded state or not is judged; if the father node is the root node of the tree-shaped menu, when the root node is judged to be in a folded state, the further judgment is not needed, and only the expansion operation is needed to be executed on all father nodes including the root node of the tested node so as to display the tested node and test the Web page corresponding to the tested node.
Referring to the flowchart of the Web testing method shown in fig. 3, taking the Tree menu shown in fig. 1 as an example, after receiving a test instruction including the name Tree Node 2-1-1 of the tested Node, it may be determined that the tested Node is the Tree Node 2-1-1. Subsequently, based on the Tree-shaped menu, the primary father Node of the Tree Node 2-1-1 is determined to be the Tree Node 2-1, and whether the Tree Node 2-1 is in the expansion state is judged.
If the Tree Node 2-1 is in the expansion state, click operation can be executed on the Tree Node 2-1-1 so as to enter the Web page 1 for testing.
If the Tree Node 2-1 is in the folding state, the secondary father Node of the Tree Node 2-1-1 can be further determined to be the Tree Node 2, and whether the Tree Node 2 is in the unfolding state or not is judged.
If the Tree Node 2 is in the expansion state, the expansion operation can be executed on the Tree Node 2-1, and then the click operation is executed on the Tree Node 2-1-1, so as to enter the Web page 1 for testing.
If the Tree Node 2 is in the folded state, the three-level father Node of the Tree Node 2-1-1 can be further determined to be the Tree Root1, and whether the Tree Root1 is in the expanded state or not is judged. Because the Tree menu is a four-level Tree menu, the three-level father Node Tree Root1 of the child Node Tree Node 2-1-1 can be determined to be the Root Node of the Tree menu.
Usually, the Root Node of the Tree-shaped menu is in an expansion state by default, that is, the Tree Root1 is in the expansion state by default, so that the expansion operation can be sequentially executed on the secondary father Node and the primary father Node of the Tree Node 2-1-1 according to the sequence of the father Node levels from large to small, that is, the expansion operation is executed on the Tree Node 2 first, then the expansion operation is executed on the Tree Node 2-1, and finally the click operation can be executed on the Tree Node 2-1-1 to enter the Web page 1 for testing.
However, if the Tree Node 1 is in the folded state, because the Tree Node 1 is already the Root Node of the Tree menu, no further judgment is needed, and only the parent Node levels are required to be in the descending order, the expansion operation is sequentially performed on the parent nodes at all levels of the Tree Node 2-1-1, namely, the expansion operation is performed on the Tree Node 1, then the expansion operation is performed on the Tree Node 2-1, and finally the click operation can be performed on the Tree Node 2-1-1 to enter the Web page 1 for testing.
Of course, after the detected Node is determined to be the Tree Node 2-1-1, it may be determined whether the Root Node Tree Root1 of the Tree menu is in the expanded state. If yes, the primary father Node of the Tree Node 2-1-1 can be continuously determined to be the Tree Node 2-1, and whether the Tree Node 2-1 is in the expansion state is judged; otherwise, the expansion operation can be executed on the Tree Root1 first, then the primary parent Node of the Tree Node 2-1-1 is determined to be the Tree Node 2-1 continuously, and whether the TreeNode 2-1 is in the expansion state is judged.
According to the embodiment, the tested node and all levels of father nodes of the tested node do not need to be positioned, and different operation functions do not need to be compiled aiming at different nodes to execute corresponding operations, so that the code quantity of the test script is reduced, the error probability and the maintenance cost of the test script are further reduced, and the test efficiency of the Web page is also improved.
Corresponding to the embodiment of the Web page testing method, the application also provides an embodiment of a Web page testing device.
The embodiment of the Web page testing device can be applied to testing equipment such as terminal equipment and servers. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a device in a logical sense, the device is formed by reading a corresponding computer program instruction in a nonvolatile memory into an internal memory through a processor of a testing device where the device is located to operate. From a hardware aspect, as shown in fig. 4, the present application is a hardware structure diagram of a testing device where the Web page testing apparatus is located, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, the testing device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the Web page test, which is not described again.
Referring to fig. 5, a block diagram of a Web page testing apparatus according to an exemplary embodiment of the present application is shown. The apparatus 500 can be applied to the testing device shown in fig. 4, and includes:
a receiving unit 501, configured to receive a test instruction, where the test instruction carries a name of a node to be tested;
a first judging unit 502, configured to determine an i-level parent node of a node to be tested based on a tree menu, and judge whether the i-level parent node is in an expanded state; wherein i is a natural number greater than 0, and the initial value is 1;
a first expansion unit 503, configured to, when the i-level parent node is in an expanded state, perform expansion operation on a parent node smaller than the i-level parent node to display a node to be tested, and test a Web page corresponding to the node to be tested;
the first determining unit 502 may be further configured to determine whether the i + 1-level parent node of the node under test is in an expanded state when the i-level parent node is in a collapsed state.
In an optional embodiment, the first determining unit 502 may include:
a node searching subunit 5021, configured to search all child nodes in the tree menu based on the node attribute;
a first determining subunit 5022, configured to determine a child node with a node name that is the same as the name of the node to be tested as the node to be tested;
a second determining subunit 5023, configured to determine an i-level parent node of the node under test based on the tree menu.
In another alternative embodiment, the first determining unit 502 may include:
an identifier determining subunit 5024, configured to determine whether an expansion identifier of the i-level parent node is expanded; wherein the expansion identifier is stored in the node attribute of the i-level parent node;
a third determining subunit 5025, configured to determine that the i-level parent node is in an expanded state when the expanded flag is expanded;
the third determining subunit 5025 may be further configured to determine that the i-level parent node is in a collapsed state when the expanded flag is collapsed.
In another alternative embodiment, the first unfolding unit 503 may include:
a sequential expansion sub-unit 5031, configured to perform expansion operations on the parent nodes smaller than the i level in sequence from the parent node level high to the parent node level low.
In another alternative embodiment, the apparatus 500 may further include:
a second judging unit 504, configured to judge whether a root node of a tree menu is in an expanded state before determining an i-level parent node of a node to be tested based on the tree menu and judging whether the i-level parent node is in the expanded state;
the first determining unit 502 may be configured to determine, when the root node is in an expanded state, an i-level parent node of a node under test based on the tree menu, and determine whether the i-level parent node is in the expanded state;
the first determining unit 502 may be further configured to, when the root node is in a folded state, perform an unfolding operation on the root node, determine an i-level parent node of a node to be tested based on the tree menu, and then determine whether the i-level parent node is in an unfolded state.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (8)

1. A Web page testing method is characterized by comprising the following steps:
receiving a test instruction, wherein the test instruction carries the name of a tested node;
searching all child nodes in the tree menu based on the node attributes, and determining the child nodes with the same node names as the tested nodes;
determining an i-level father node of a tested node based on the tree menu, and judging whether the i-level father node is in an expansion state; wherein i is a natural number greater than 0, and the initial value is 1;
when the i-level father node is in an expansion state, executing expansion operation on the father node smaller than the i-level to display the node to be tested, and testing a Web page corresponding to the node to be tested;
and when the i-level father node is in a folded state, judging whether the i + 1-level father node of the tested node is in an unfolded state.
2. The method of claim 1, wherein the determining whether the i-level parent node is in an expanded state comprises:
judging whether the expansion identification of the i-level father node is expanded or not; wherein the expansion identifier is stored in the node attribute of the i-level parent node;
when the expansion identification is expansion, determining that the i-level father node is in an expansion state;
when the expansion mark is folded, determining that the i-level father node is in a folded state.
3. The method of claim 1, wherein performing an unrolling operation on parent nodes less than level i comprises:
and sequentially executing expansion operation on the parent nodes smaller than the i level according to the sequence of the parent node levels from high to low.
4. The method of claim 1, further comprising, before determining an i-level parent node of the node under test based on the tree menu and determining whether the i-level parent node is in the expanded state:
judging whether the root node of the tree menu is in an expansion state;
when the root node is in an expanded state, determining an i-level father node of a tested node based on the tree menu, and judging whether the i-level father node is in the expanded state;
and when the root node is in a folded state, performing unfolding operation on the root node, determining an i-level father node of the tested node based on the tree menu, and judging whether the i-level father node is in an unfolded state.
5. A Web page testing apparatus, characterized in that the apparatus comprises:
the receiving unit is used for receiving a test instruction, and the test instruction carries the name of a tested node;
the first judging unit is used for searching all child nodes in the tree menu based on the node attributes and determining the child nodes with the same node names as the tested nodes; determining an i-level father node of a tested node based on the tree menu, and judging whether the i-level father node is in an expansion state; wherein i is a natural number greater than 0, and the initial value is 1;
the first expansion unit is used for executing expansion operation on the father node smaller than the i level when the i level father node is in an expansion state so as to display the tested node and test the Web page corresponding to the tested node;
the first judging unit is further configured to judge whether an i + 1-level father node of the node to be tested is in an unfolded state when the i-level father node is in a folded state.
6. The apparatus according to claim 5, wherein the first judging unit includes:
the identification judgment subunit is used for judging whether the expansion identification of the i-level father node is expanded or not; wherein the expansion identifier is stored in the node attribute of the i-level parent node;
a third determining subunit, configured to determine that the i-level parent node is in an expanded state when the expansion flag is expanded;
the third determining subunit is further configured to determine that the i-level parent node is in a collapsed state when the expansion flag is collapsed.
7. The device of claim 5, wherein the first expansion unit comprises:
and the sequential expansion child unit is used for sequentially executing expansion operation on the parent nodes smaller than the i level according to the sequence of the parent node level from high to low.
8. The apparatus of claim 5, further comprising:
the second judging unit is used for judging whether a root node of the tree menu is in an expanded state or not before determining an i-level father node of a node to be detected based on the tree menu and judging whether the i-level father node is in the expanded state or not;
the first judging unit is used for determining an i-level father node of a tested node based on the tree menu when the root node is in an expanded state, and judging whether the i-level father node is in the expanded state;
the first judging unit is further configured to, when the root node is in a folded state, perform an unfolding operation on the root node, determine an i-level parent node of the node to be tested based on the tree menu, and then judge whether the i-level parent node is in an unfolded state.
CN201710599194.5A 2017-07-21 2017-07-21 Web page testing method and device Active CN107402882B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710599194.5A CN107402882B (en) 2017-07-21 2017-07-21 Web page testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710599194.5A CN107402882B (en) 2017-07-21 2017-07-21 Web page testing method and device

Publications (2)

Publication Number Publication Date
CN107402882A CN107402882A (en) 2017-11-28
CN107402882B true CN107402882B (en) 2020-11-06

Family

ID=60401169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710599194.5A Active CN107402882B (en) 2017-07-21 2017-07-21 Web page testing method and device

Country Status (1)

Country Link
CN (1) CN107402882B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086204B (en) * 2018-07-20 2022-03-11 北京小米移动软件有限公司 Node relation tree establishing method, page marking method, page identifying method, page marking device, page identifying device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101056303A (en) * 2007-05-31 2007-10-17 威盛电子股份有限公司 Configurable network interface with horizontal tree structure, its display method and node processing method
CN101192194A (en) * 2007-01-19 2008-06-04 中兴通讯股份有限公司 Test case design method based on test case database
CN102508779A (en) * 2011-11-17 2012-06-20 北京北纬点易信息技术有限公司 Automatic performance test script generating system based on web crawler logs and automatic performance test script generating method based on same
CN103678120A (en) * 2013-11-12 2014-03-26 北京京东尚科信息技术有限公司 Automatic web-application testing method based on modeling
CN104423961A (en) * 2013-09-11 2015-03-18 阿里巴巴集团控股有限公司 Method and system for generating testing script
US9680856B2 (en) * 2012-12-18 2017-06-13 Tinfoil Security, Inc. System and methods for scalably identifying and characterizing structural differences between document object models

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510207B (en) * 2009-02-26 2011-04-20 中兴通讯股份有限公司 Tree menu dynamic maintenance method and apparatus based on web page
CN101582075B (en) * 2009-06-24 2011-05-11 大连海事大学 Web information extraction system
CN102662939B (en) * 2011-11-17 2014-07-09 福建榕基软件股份有限公司 Tree-form data structure displaying method and system
CN103853654B (en) * 2012-11-30 2017-03-01 国际商业机器公司 The system of selection of webpage test path and device
CN103268226B (en) * 2013-05-17 2016-07-06 瑞斯康达科技发展股份有限公司 A kind of test script file generates method and device
CN103279420B (en) * 2013-06-08 2016-02-24 网宿科技股份有限公司 The application program for mobile terminal automated testing method optimized and system
CN103530379B (en) * 2013-10-15 2017-01-04 福建榕基软件股份有限公司 tree structure data display method and device
CN104834595B (en) * 2015-02-15 2017-09-12 网易(杭州)网络有限公司 A kind of Visual Automatic Test method and system
CN106547689B (en) * 2016-10-20 2019-03-01 金航数码科技有限责任公司 A kind of automatic test cases development system and method based on web

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192194A (en) * 2007-01-19 2008-06-04 中兴通讯股份有限公司 Test case design method based on test case database
CN101056303A (en) * 2007-05-31 2007-10-17 威盛电子股份有限公司 Configurable network interface with horizontal tree structure, its display method and node processing method
CN102508779A (en) * 2011-11-17 2012-06-20 北京北纬点易信息技术有限公司 Automatic performance test script generating system based on web crawler logs and automatic performance test script generating method based on same
US9680856B2 (en) * 2012-12-18 2017-06-13 Tinfoil Security, Inc. System and methods for scalably identifying and characterizing structural differences between document object models
CN104423961A (en) * 2013-09-11 2015-03-18 阿里巴巴集团控股有限公司 Method and system for generating testing script
CN103678120A (en) * 2013-11-12 2014-03-26 北京京东尚科信息技术有限公司 Automatic web-application testing method based on modeling

Also Published As

Publication number Publication date
CN107402882A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
CN102521121B (en) Page testing method and page testing device
CN107622008B (en) Traversal method and device for application page
CN107729475B (en) Webpage element acquisition method, device, terminal and computer-readable storage medium
US8880548B2 (en) Dynamic search interaction
CN109086204A (en) The foundation of node relationships tree, page marks and recognition methods, device and storage medium
CN105868096B (en) For showing the method, device and equipment of web page test result in a browser
US20150347281A1 (en) Automation testing using descriptive maps
CN105095067A (en) User interface element object identification and automatic test method and apparatus
US7661053B2 (en) Methods and apparatus for patternizing device responses
RU2011103185A (en) METHOD FOR DETERMINING LOCATION FROM CODED DATA REPRESENTING IT
EP1890235A1 (en) Test case management
CN105335246B (en) A kind of program crashing defect self-repairing method based on question and answer web analytics
CN102567565B (en) Cable parameter processing method and system utilizing same
CN107080945B (en) Method and device for testing artificial intelligence behaviors in game and electronic equipment
AU2019279950B2 (en) Web application adjustment for different browsers
CN114595343B (en) Map display method and device, storage medium and electronic equipment
WO2006007588A2 (en) Method and system for test case generation
CN109101410B (en) Risk drive testing method and device and computer readable storage medium
CN103631706B (en) A kind of browser testing method and apparatus
US20170220457A1 (en) Constructing test-centric model of application
CN108399125B (en) Automatic testing method and device, computer equipment and storage medium
US10823782B2 (en) Ensuring completeness of interface signal checking in functional verification
WO2019134297A1 (en) Method and device for detecting configuration pair naming duplicate, storage medium, and smart device
CN107402882B (en) Web page testing method and device
CN106959919A (en) Method for testing software and device based on test path figure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant