CN110413520A - Method, server and the readable storage medium storing program for executing of control are obtained in page test - Google Patents

Method, server and the readable storage medium storing program for executing of control are obtained in page test Download PDF

Info

Publication number
CN110413520A
CN110413520A CN201910665212.4A CN201910665212A CN110413520A CN 110413520 A CN110413520 A CN 110413520A CN 201910665212 A CN201910665212 A CN 201910665212A CN 110413520 A CN110413520 A CN 110413520A
Authority
CN
China
Prior art keywords
target widget
path
page
control
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910665212.4A
Other languages
Chinese (zh)
Inventor
邸立涛
熊云萍
赵静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN STOCK EXCHANGE
Original Assignee
SHENZHEN STOCK EXCHANGE
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 SHENZHEN STOCK EXCHANGE filed Critical SHENZHEN STOCK EXCHANGE
Priority to CN201910665212.4A priority Critical patent/CN110413520A/en
Publication of CN110413520A publication Critical patent/CN110413520A/en
Pending legal-status Critical Current

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
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The invention discloses method, server and computer readable storage mediums that control is obtained in a kind of test of page, comprising the following steps: during running page test case, obtains the path of target widget;The target widget is searched from the page according to the path of the target widget;When searching in the page less than the target widget, the path of the target widget is updated, returns and executes the step of target widget is searched from the page in the path according to the target widget;When finding the target widget in the page, the control is operated, to carry out page test.When the present invention can not find target widget to be tested according to the path of setting when running page test case, target widget is searched again with the path of update, it solves the problems, such as the path failure originally set caused by type or version in test process because having replaced browser, improves the automatic test success rate of the page.

Description

Method, server and the readable storage medium storing program for executing of control are obtained in page test
Technical field
The present invention relates to obtained in computer field more particularly to a kind of test of page the method for control, server and Computer readable storage medium.
Background technique
When the split Webpage distributed carries out automatic test, according to the control of the page to be tested, to be tested The execution movement of the page and preset Test data generation test case, and executed by automation tools by test case.Its In, need setting to obtain the path of the control of the page to be tested in the code of test case.
But due to different browsers, the different editions of the even same browser to the interpretative rule of the page not Together, the problem of path of the control of the page to be tested occur can change as the load of browser parses.If in test process Replaced browser, the control path failure being arranged in test case and cause test case to execute failure, greatly reduce page The automatic test success rate in face.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill Art.
Summary of the invention
The main purpose of the present invention is to provide method, server and computers that control is obtained in a kind of test of page Readable storage medium storing program for executing, it is intended to solve because having replaced browser in test process, the control path failure being arranged in test case and The problem of causing test case to execute failure, greatly reducing the automatic test success rate of the page.
In order to achieve the above object, the present invention provides the method that control is obtained in a kind of test of the page, the page test It is middle obtain control method the following steps are included:
During running page test case, the path of target widget is obtained;
The target widget is searched from the page according to the path of the target widget;
When searching in the page less than the target widget, the path of the target widget is updated, returns and executes The step of target widget is searched from the page in the path according to the target widget;
When finding the target widget in the page, the control is operated, to carry out page test.
Optionally, the step of target widget is searched from the page in the path according to the target widget it Afterwards further include:
When finding the target widget in the page, the target widget is verified;
When verifying unsuccessful, the path of the target widget is updated, with the path searching of the target widget of update The target widget.
Optionally, described when finding the target widget in the page, the target widget is verified The step of include:
When finding the target widget in the page, the control type of the target widget is obtained;
The target widget is verified according to the control type.
Optionally, described the step of being verified according to the control type to the target widget, includes:
Corresponding default nodal community and node naming rule are obtained according to the control type, and obtains the target control The nodal community and nodal value of part;
Compare the nodal community and nodal value and the default nodal community and the node naming rule, wherein when The nodal community of the target widget and the default nodal community mismatch or the nodal value of the target widget with it is described When node naming rule mismatches, determine that verification is unsuccessful.
Optionally, described when verifying unsuccessful, the step of updating the path of the target widget, includes:
When verifying unsuccessful, current path searching direction is determined, wherein the path searching direction is looked into including peer It looks for, upward one level search and downward one level search;
According to determining path searching direction, the path of the target widget is updated.
Optionally, described according to determining path searching direction, the path of the target widget is updated, described in update The step of target widget described in the path searching of target widget includes:
When determining path searching direction is upward one level search or downward one level search, corresponding historical path is obtained Search number;
When the corresponding historical path, which searches number, is less than or equal to default lookup frequency threshold value, according to determining road Diameter search direction updates the path of the target widget.
Optionally, described when determining path searching direction is upward one level search or downward one level search, acquisition pair The historical path answered was searched after the step of number further include:
Obtain the type of the target widget;
Corresponding default lookup frequency threshold value is determined according to the type of the target widget.
Optionally, described when verifying unsuccessful, the step of determining current path searching direction, includes:
When verifying unsuccessful, the type of the target widget is obtained;
Corresponding path searching direction is determined according to the type of the target widget.
In addition, to achieve the above object, the present invention also provides obtain control server, the page in a kind of test of page Control server is obtained in test to include processor, memory and be stored on the memory and can transport on the processor Control handler is obtained in capable page test, is obtained control handler in the page test and is executed by the processor The step of obtaining the method for control in Shi Shixian page test as described above.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium It is stored on storage medium in page test and obtains control handler, obtained control handler in the page test and located Reason device realizes the step of obtaining the method for control in page test as described above when executing.
Method, server and the computer readable storage medium of control, In are obtained in page test provided by the invention When can not find target widget to be tested according to the path of setting when running page test case, searched again with the path of update Target widget, the path failure originally set caused by solving type or version in test process because having replaced browser Problem improves the automatic test success rate of the page.
Detailed description of the invention
Detailed description of the invention is used to provide further understanding of the present invention, and constitutes part of specification, with the present invention Embodiment be used to explain the present invention together, be not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the hardware structural diagram that control server is obtained during the page that the embodiment of the present invention is related to is tested;
Fig. 2 is the flow diagram that the method first embodiment of control is obtained in the page of the present invention test;
Fig. 3 is the flow diagram that the method second embodiment of control is obtained in the page of the present invention test;
The refinement step signal that Fig. 4 is step S60 in the method second embodiment for obtain in the page of the present invention test control Figure;
Fig. 5 is the refinement that the update target widget step of method second embodiment of control is obtained in the page of the present invention test Step schematic diagram;
Fig. 6 is the flow diagram that the method fourth embodiment of control is obtained in the page of the present invention test;
Fig. 7 is the flow diagram that the 5th embodiment of method of control is obtained in the page of the present invention test;
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are: during running page test case, obtaining target widget Path;The target widget is searched from the page according to the path of the target widget;It is searched when in the page When less than the target widget, the path of the target widget is updated, returns and executes the path according to the target widget The step of searching the target widget from the page;When finding the target widget in the page, to described Control is operated, to carry out page test.
The present invention provides a solution, can not find when running page test case according to the path of setting to be tested Target widget when, target widget is searched again with the path of update, solves the kind in test process because having replaced browser The problem of path failure originally set caused by class or version, improves the automatic test success rate of the page.
As shown in Figure 1, Fig. 1 is that the embodiment of the present invention is related to the hardware structural diagram of server.
Referring to Fig.1, which may include: processor 1001, such as CPU, memory 1002, communication bus 1003, Network interface 1004.Wherein, communication bus 1003 is for realizing the connection communication between each building block in the server.Network Interface 1004 optionally may include standard wireline interface and wireless interface (such as WI-FI interface).Memory 1002 can be height Fast RAM memory is also possible to stable memory (non-volatile memory), such as magnetic disk storage.Memory 1002 optionally can also be the storage server independently of aforementioned processor 1001.As shown in Figure 1, being deposited as a kind of computer It may include that control processing journey is obtained in operating system, network communication module and page test in the memory 1002 of storage media Sequence.
It will be understood by those skilled in the art that server architecture shown in Fig. 1 does not constitute the restriction to server, it can To include perhaps combining certain components or different component layouts than illustrating more or fewer components.
In hardware involved in server shown in Fig. 1, processor 1001 can be used for calling to be deposited in memory 1002 The node path of storage modifies program, and executes following operation:
During running page test case, the path of target widget is obtained;
The target widget is searched from the page according to the path of the target widget;
When searching in the page less than the target widget, the path of the target widget is updated, returns and executes The step of target widget is searched from the page in the path according to the target widget;
When finding the target widget in the page, the control is operated, to carry out page test.
Further, processor 1001 can be used for that the node path stored in memory 1002 is called to modify program, also Execute following operation:
When finding the target widget in the page, the target widget is verified;
When verifying unsuccessful, the path of the target widget is updated, with the path searching of the target widget of update The target widget.
Further, processor 1001 can be used for that the node path stored in memory 1002 is called to modify program, also Execute following operation:
When finding the target widget in the page, the control type of the target widget is obtained;
The target widget is verified according to the control type.
Further, processor 1001 can be used for that the node path stored in memory 1002 is called to modify program, also Execute following operation:
Corresponding default nodal community and node naming rule are obtained according to the control type, and obtains the target control The nodal community and nodal value of part;
Compare the nodal community and nodal value and the default nodal community and the node naming rule, wherein when The nodal community of the target widget and the default nodal community mismatch or the nodal value of the target widget with it is described When node naming rule mismatches, determine that verification is unsuccessful.
Further, processor 1001 can be used for that the node path stored in memory 1002 is called to modify program, also Execute following operation:
When verifying unsuccessful, current path searching direction is determined, wherein the path searching direction is looked into including peer It looks for, upward one level search and downward one level search;
According to determining path searching direction, the path of the target widget is updated.
Further, processor 1001 can be used for that the node path stored in memory 1002 is called to modify program, also Execute following operation:
When determining path searching direction is upward one level search or downward one level search, corresponding historical path is obtained Search number;
When the corresponding historical path, which searches number, is less than or equal to default lookup frequency threshold value, according to determining road Diameter search direction updates the path of the target widget.
Further, processor 1001 can be used for that the node path stored in memory 1002 is called to modify program, also Execute following operation:
Obtain the type of the target widget;
Corresponding default lookup frequency threshold value is determined according to the type of the target widget.
Further, processor 1001 can be used for that the node path stored in memory 1002 is called to modify program, also Execute following operation:
When verifying unsuccessful, the type of the target widget is obtained;
Corresponding path searching direction is determined according to the type of the target widget.
It is the first embodiment that the method for control is obtained in the page of the present invention test, the page test referring to Fig. 2, Fig. 2 It is middle obtain control method include:
Step S10, during running page test case, the path of target widget is obtained;
When the split Webpage distributed carries out automatic test, test code is needed to each in Webpage Control executes operation, to test each control.Wherein, control refers to the encapsulation to data and method, common control Including input frame, radio box, combobox, button etc..
During the operation of page test case, different operations is executed to different types of control, such as inputting Frame inputs text, carries out clicking selection in radio box and combobox, clicks button etc..
Step S20 searches the target widget according to the path of the target widget from the page;
Each Webpage corresponds to a document node tree (dom tree), includes a series of mark in document node tree Such as html, body, div etc. are signed, these labels form a tree structure.Mesh to be tested included in Webpage Mark control corresponds to the node in document node tree.The node in document node tree is searched in test code according to Xpath, i.e., Search the target widget to be tested in webpage to be tested.
Specifically, the node in document node tree is searched using Xpath absolute path, such as searches input control The first absolute path of Xpath are as follows:
“/html/body/div[1]/div[1]/div/div/section[2]/div/div/div/form/div[8]/ input”
Step S30 updates the path of the target widget when searching in the page less than the target widget, It returns and executes the step of target widget is searched from the page in the path according to the target widget;
Test Engineer is that target widget to be tested is provided with based on a kind of browser version when writing test case One path leads to target control due to having used the different editions of other kinds of browser or browser of the same race when test Path of the part in the browser in test environment is changed, it may be possible to by one or more layers path of multinest, therefore It can be searched at this time towards the even higher level of node direction of target widget, i.e., be its upper level by the routing update of target widget The path of node, according to updated path searching target widget.
Such as when can not find input control with above-mentioned first absolute path, continue to seek according to following second absolute path Look for input control:
“/html/body/div[1]/div[1]/div/div/section[2]/div/div/div/form/div [8]/”
It should be noted that this step may need to be performed a number of times, i.e., from node where target widget, through excessive Secondary superior node checks can just find target widget, wherein execute this step each time and all remove the absolute road current Xpath The last one slash "/" in diameter, to obtain the path of corresponding even higher level of node, according to updated path searching target control Part.
Although path of the target widget in the browser in test environment is changed, caused by the variation The path level variation of target widget is within the scope of a limited path change.Such as path change range is 2 grades of levels Or 3 grades of levels, it still can not find target widget if searching 2 times or 3 times upwards, target control can be found by being further continued for searching upwards A possibility that part, is very small.
Therefore, further, in order to save process resource, a default update times threshold value is set, in this step, when When searching in the page less than the target widget, preset if it is determined that the current accumulative number searched upwards is less than or equal to When update times threshold value, the path of target widget is just updated, if it is determined that the current accumulative number searched upwards is greater than default update When frequency threshold value, stop the path for updating target widget, the lookup of target end control.
Step S40 operates the control when finding the target widget in the page, to carry out Page test.
When having found target widget according to the Xpath absolute path of update, test code is able to continue to run to target The operation of control, to complete the test case of the current page to be tested.
In the present embodiment, it can not find target widget to be tested according to the path of setting when running page test case When, target widget is searched again with the path of update, is solved in test process because the type or version of having replaced browser are led The problem of path failure originally set caused, improve the automatic test success rate of the page.
Further, it is the second embodiment for obtaining the method for control in the page of the present invention test referring to Fig. 3, Fig. 3, is based on Above-described embodiment, after the step S20 further include:
Step S50, when finding the target widget in the page, the target widget is verified;
When having arrived target widget according to the path searching of setting, the target widget found may be unsatisfactory for control rule and Cause to target widget operation failure, wherein control rule includes the attribute having required for control and naming rule.It needs Bright, when the node in the document node tree that control is considered as the page, control rule refers to what corresponding node needed to have Nodal community and node naming rule.
Therefore, when finding target widget in the page, the control type of target widget is obtained, according to control type pair Target widget is verified.
Specifically, corresponding default nodal community and node naming rule are obtained according to control type, and obtains target control The nodal community and nodal value of part;Compare nodal community and nodal value and default nodal community and node naming rule, wherein when The nodal community of target widget and default nodal community mismatch or the nodal value and node naming rule of the target widget When mismatch, determine that verification is unsuccessful.
For example, dropdown menu controls are regular are as follows: node includes classname attribute, and value meets naming rule " xxx- Grid-container ", " xxx " are self-defining character string;Input frame control rule are as follows: node includes ng-model attribute, Value meets regular " input-xxx-xxx ", and '-xxx-xxx ' is self-defining character string.
If target widget is input frame control, will judge whether target widget includes ng-model attribute, if not including The attribute then determines that target widget verification is unsuccessful, further judges whether its value meets name if comprising ng-model attribute Regular " input-xxx-xxx " also determines that target widget verification is unsuccessful if its value is unsatisfactory for naming rule.
Step S60 updates the path of the target widget, when verifying unsuccessful with the target widget of update Target widget described in path searching.
Specifically, as shown in figure 4, this step can be segmented are as follows:
Step S61 determines current path searching direction when verifying unsuccessful, wherein the path searching direction packet Include lookup, upward one level search and downward one level search at the same level;
Step S62 updates the path of target widget, according to determining path searching direction with the target widget of update Path searching described in target widget.
When being searched using the corresponding node of target widget as source node in the document node tree of the page to be tested, together Grade searches the brotgher of node for referring to and searching source node, and upward one level search refers to the father node for searching source node, looks into next stage Look for the child node for referring to and searching source node.It should be noted that if searching to obtain multiple sections according to determining path searching direction To get to a node listing when point, defaults and obtain the target control that first node in node listing is arrived as current lookup Part.
It should be noted that this step may need to be performed a number of times, i.e., from node where target widget, through excessive It is secondary to be searched to even higher level of node or just find target widget to next node checks.Also, the path searching repeatedly searched Direction may be different, such as first searches for the first time in peer, if not finding, second to the 4th time is where target widget Node searched to even higher level of node, the 5th to the 6th time is is searched from the downward first nodes of node where target widget.
Therefore, further, in order to save process resource, a default lookup frequency threshold value is set, as shown in figure 5, root The path of target widget is updated according to following step:
Step S63 is obtained corresponding when determining path searching direction is upward one level search or downward one level search Historical path searches number;
Wherein, it is for the lookup of a target widget, in the same search direction that historical path, which searches number, Accumulative lookup number.
Step S64, when corresponding historical path, which searches number, is less than or equal to default lookup frequency threshold value, according to determination Path searching direction, update the path of the target widget;
It, can be directly by accumulative path searching number and a default lookup time when search direction is all identical each time Number threshold value is compared to determine whether more new route.And when multiple search direction difference, it needs to add up each look into respectively The lookup number for looking for direction obtains search direction corresponding default lookup frequency threshold value when judging, will be in a search direction Accumulative lookup number default lookup frequency threshold value corresponding with one is compared to determine whether more new route.
It is to be appreciated that stopping updating mesh when corresponding historical path searches number and is greater than default lookup frequency threshold value The path for marking control, terminates this lookup.
It is not offered as stopping the lookup to target widget it should be noted that terminating this lookup.Such as a mesh Mark control will successively carry out lookup, upward one level search and downward one level search at the same level, wherein upward one level search and downwards The corresponding default lookup frequency threshold value of one level search is 2.For this target widget, possible maximum number of searching is 5 times: Primary lookup, 2 upward one level search and 2 downward one level search at the same level.
It is unsuccessful verifying by being verified to the target widget found in technical solution provided in this embodiment When target widget searched again with the path of the target widget updated, detect the target control for not meeting preset condition in advance Part is simultaneously corrected in time, not only saves process resource, but also improve the success rate of page automatic test.
Further, referring to Fig. 6, it is based on above-mentioned second embodiment, proposes the side for obtaining control in page test of the present invention The 3rd embodiment of method, after the step S63 further include:
Step S65 obtains the type of the target widget;
Specifically, in this step, by calling third party's interface to obtain the type of current goal control.According to control Subobject exhibition method can be divided into these types of major class: single object control, list type control, tree control and compound subobject control Part.It is every one kind control in again may include it is a variety of subdivision types controls, such as single object control include Text Entry, can point The button hit, the link that can be clicked etc. include cell control etc. in list type control.
The type for the current goal control for calling third party's interface to obtain can be above-mentioned big Class Type, be also possible to big Subdivision type under class.
Step S66 determines corresponding default lookup frequency threshold value according to the type of the target widget.
According to layout designs feature of various types of target widgets in the page, corresponding default lookup time is preset Number threshold value.For example, due to the relationship of page layout design, often having multilayer nest, level compares for text entry box control It is deep, biggish lookup depth is needed, biggish default lookup frequency threshold value can be set, and for Menu Type control, button The control nesting of type is less, and lesser default lookup frequency threshold value can be set.
Therefore, corresponding default lookup frequency threshold value is found according to the type of the target widget of acquisition in this step, it should Default frequency threshold value of searching determines the lookup depth to target widget.
In technical solution provided in this embodiment, corresponding default lookup number threshold is determined according to the type of target widget Value can be suitably to search depth to upper level section when searching fall short control according to preset path in test case Point or downwards first nodes lookup, save process resource, improve the whole efficiency of page test run.
Further, referring to Fig. 7, it is based on above-mentioned second embodiment, proposes the side for obtaining control in page test of the present invention The fourth embodiment of method, the step S61 include:
Step S611 obtains the type of the target widget when verifying unsuccessful;
Step S612 determines corresponding path searching direction according to the type of the target widget.
Since layout designs feature is different in the page for different types of control, different types of control has different embedding Level characteristics are covered, and the similarity degree between the subobject of different types of control is different.Such as tree control, menu control Part and button control, the attribute between the brotgher of node of these type controls is similar, and corresponding path searching direction can be Peer searches;Such as multi hierarchical and nested between cell control or the subobject of input control, corresponding path searching direction can Think upward one level search or downward one level search.
In technical solution provided in this embodiment, when verifying unsuccessful, determined according to the type of target widget corresponding Path searching direction avoids searching the traversal of various search directions, has saved system processing resources, advanced optimized the page The efficiency of automatic test.
To achieve the above object, the present invention also provides the server for obtaining control in a kind of test of page, the page is surveyed The server that control is obtained in examination includes processor, memory and is stored on the memory and can transport on the processor The processing routine of control is obtained in capable page test, obtains the processing routine of control by the processor in the page test The step of obtaining the method for control in page test as described above is realized when execution.
To achieve the above object, the present invention also provides a kind of computer readable storage medium, the computer-readable storages Node path modification program is stored on medium, the node path modification program is realized as described above when being executed by processor The step of obtaining the method for control in page test.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be TV Machine, mobile phone, computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. obtaining the method for control in a kind of page test, which is characterized in that obtain the method packet of control in the page test Include following steps:
During running page test case, the path of target widget is obtained;
The target widget is searched from the page according to the path of the target widget;
When searching in the page less than the target widget, the path of the target widget is updated, is returned described in executing The step of searching the target widget from the page according to the path of the target widget;
When finding the target widget in the page, the control is operated, to carry out page test.
2. obtaining the method for control in page test as described in claim 1, which is characterized in that described according to the target control The path of part is after the step of searching the target widget in the page further include:
When finding the target widget in the page, the target widget is verified;
When verifying unsuccessful, the path of the target widget is updated, described in the path searching of the target widget of update Target widget.
3. obtaining the method for control in page test as claimed in claim 2, which is characterized in that described in the page When finding the target widget, the step of verifying to the target widget, includes:
When finding the target widget in the page, the control type of the target widget is obtained;
The target widget is verified according to the control type.
4. obtaining the method for control in page test as claimed in claim 3, which is characterized in that described according to the control class The step of type verifies the target widget include:
Corresponding default nodal community and node naming rule are obtained according to the control type, and obtains the target widget Nodal community and nodal value;
Compare the nodal community and nodal value and the default nodal community and the node naming rule, wherein when described The nodal community of target widget and the default nodal community mismatch or the nodal value and the node of the target widget When naming rule mismatches, determine that verification is unsuccessful.
5. obtaining the method for control in page test as claimed in claim 2, which is characterized in that described unsuccessful in verification When, the path of the target widget is updated, is wrapped with the step of target widget described in the path searching of the target widget of update It includes:
When verifying unsuccessful, determine current path searching direction, wherein the path searching direction include it is at the same level search, Upward one level search and downward one level search;
According to determining path searching direction, the path of the target widget is updated, with the path of the target widget of update Search the target widget.
6. obtaining the method for control in page test as claimed in claim 5, which is characterized in that described according to determining path Search direction, the step of updating the path of the target widget include:
When determining path searching direction is upward one level search or downward one level search, obtains corresponding historical path and search Number;
When the corresponding historical path, which searches number, is less than or equal to default lookup frequency threshold value, looked into according to determining path Direction is looked for, the path of the target widget is updated.
7. obtaining the method for control in page test as claimed in claim 6, which is characterized in that described when determining path is looked into When to look for direction be upward one level search or downward one level search, obtain and also wrap after the step of corresponding historical path searches number It includes:
Obtain the type of the target widget;
Corresponding default lookup frequency threshold value is determined according to the type of the target widget.
8. obtaining the method for control in page test as claimed in claim 5, which is characterized in that described unsuccessful in verification When, the step of determining current path searching direction includes:
When verifying unsuccessful, the type of the target widget is obtained;
Corresponding path searching direction is determined according to the type of the target widget.
9. obtaining the server of control in a kind of page test, which is characterized in that obtain the service of control in the page test Device includes processor, memory and is stored on the memory and obtains in the page that can be run on the processor test The program of control is obtained in the page test when program of control is executed by the processor and is realized in such as claim 1 to 8 The step of obtaining the method for control in described in any item page tests.
10. a kind of readable storage medium storing program for executing, which is characterized in that be stored with node path modification on the computer readable storage medium Program, the node path modification program realize that the page described in any item of the claim 1 to 8 such as is surveyed when being executed by processor The step of method of control is obtained in examination.
CN201910665212.4A 2019-07-22 2019-07-22 Method, server and the readable storage medium storing program for executing of control are obtained in page test Pending CN110413520A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910665212.4A CN110413520A (en) 2019-07-22 2019-07-22 Method, server and the readable storage medium storing program for executing of control are obtained in page test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910665212.4A CN110413520A (en) 2019-07-22 2019-07-22 Method, server and the readable storage medium storing program for executing of control are obtained in page test

Publications (1)

Publication Number Publication Date
CN110413520A true CN110413520A (en) 2019-11-05

Family

ID=68362524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910665212.4A Pending CN110413520A (en) 2019-07-22 2019-07-22 Method, server and the readable storage medium storing program for executing of control are obtained in page test

Country Status (1)

Country Link
CN (1) CN110413520A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367802A (en) * 2020-02-29 2020-07-03 中国平安财产保险股份有限公司 Web automatic testing method and device and computer readable storage medium
CN112328488A (en) * 2020-11-09 2021-02-05 深圳证券通信有限公司 Control object identification method for UI (user interface) automatic test
CN113076262A (en) * 2021-04-30 2021-07-06 中国工商银行股份有限公司 Automatic webpage testing method and device
CN113918460A (en) * 2021-10-15 2022-01-11 京东科技信息技术有限公司 Page testing method, device, equipment and medium
CN114020648A (en) * 2022-01-04 2022-02-08 广东拓思软件科学园有限公司 Application control testing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491488A (en) * 2017-07-18 2017-12-19 北京京东尚科信息技术有限公司 The method and apparatus of page data collection
CN107861868A (en) * 2017-10-31 2018-03-30 郑州云海信息技术有限公司 A kind of method and system for extracting automation test object
CN108845925A (en) * 2018-03-30 2018-11-20 新华三技术有限公司 Web page test method, device, electronic equipment and computer-readable medium
CN109446069A (en) * 2018-09-26 2019-03-08 平安普惠企业管理有限公司 Compatibility test method, device, computer equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491488A (en) * 2017-07-18 2017-12-19 北京京东尚科信息技术有限公司 The method and apparatus of page data collection
CN107861868A (en) * 2017-10-31 2018-03-30 郑州云海信息技术有限公司 A kind of method and system for extracting automation test object
CN108845925A (en) * 2018-03-30 2018-11-20 新华三技术有限公司 Web page test method, device, electronic equipment and computer-readable medium
CN109446069A (en) * 2018-09-26 2019-03-08 平安普惠企业管理有限公司 Compatibility test method, device, computer equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
岁月如歌_九: "元素定位-XPATH定位方法总结", 《博客园:HTTPS://WWW.CNBLOGS.COM/XJX767361314/P/10152498.HTML》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367802A (en) * 2020-02-29 2020-07-03 中国平安财产保险股份有限公司 Web automatic testing method and device and computer readable storage medium
CN112328488A (en) * 2020-11-09 2021-02-05 深圳证券通信有限公司 Control object identification method for UI (user interface) automatic test
CN113076262A (en) * 2021-04-30 2021-07-06 中国工商银行股份有限公司 Automatic webpage testing method and device
CN113076262B (en) * 2021-04-30 2024-02-23 中国工商银行股份有限公司 Webpage automatic testing method and device
CN113918460A (en) * 2021-10-15 2022-01-11 京东科技信息技术有限公司 Page testing method, device, equipment and medium
CN114020648A (en) * 2022-01-04 2022-02-08 广东拓思软件科学园有限公司 Application control testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110413520A (en) Method, server and the readable storage medium storing program for executing of control are obtained in page test
JP4879580B2 (en) System and method for providing an automatic search menu to a user interface
CN103034583B (en) A kind of method and system for the treatment of software automatic test script
CN104572114B (en) A kind of binding device, using updating device and method
US8108360B2 (en) Database object update order determination
US20080307300A1 (en) Display control information generation
US8082488B2 (en) Method for accessing a parent page while browsing web pages
CN105574207A (en) WAP webpage developing method
US9514164B1 (en) Selectively migrating data between databases based on dependencies of database entities
JP2007183916A (en) Method and apparatus for automatic form input on mobile devices
US20200304366A1 (en) Routing configuration method of view files, storage medium, terminal device and apparatus
CN102982169A (en) Browser and method for isolating webpage plugins
CN111324577A (en) Method and device for reading and writing Yml file
US10133766B2 (en) Accessing and editing virtually-indexed message flows using structured query langauge (SQL)
US20200394055A1 (en) System and method for providing a configurable user interface using a self-describing data system
CN111753490B (en) Metal wire layout design rule checking method
CN108156510A (en) The method, apparatus and computer readable storage medium of page focus processing
CN103488674A (en) Computing system and method for implementing and controlling thereof
CN103440453B (en) Method for detecting operation environment of browser, client, server and system
CN110321503A (en) A kind of web component caching method, device and electronic equipment
Xu et al. Towards context consistency by concurrent checking for internetware applications
KR101286284B1 (en) QoS-aware Web Service Composition method using On-the-fly Learning-based Search
US9767146B2 (en) Use of generated SQL for evaluation of decision point rules in a workflow system
CN108536447B (en) Operation and maintenance management method
CN112766505B (en) Knowledge representation method of non-monotonic reasoning in logical action language system depiction

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191105

RJ01 Rejection of invention patent application after publication