CN110262963A - Function test method, device and terminal device based on handle - Google Patents

Function test method, device and terminal device based on handle Download PDF

Info

Publication number
CN110262963A
CN110262963A CN201910424150.8A CN201910424150A CN110262963A CN 110262963 A CN110262963 A CN 110262963A CN 201910424150 A CN201910424150 A CN 201910424150A CN 110262963 A CN110262963 A CN 110262963A
Authority
CN
China
Prior art keywords
handle
title
main
window
corresponding window
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
CN201910424150.8A
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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201910424150.8A priority Critical patent/CN110262963A/en
Publication of CN110262963A publication Critical patent/CN110262963A/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/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)
  • User Interface Of Digital Computer (AREA)

Abstract

The present invention be suitable for technical field of data processing, provide function test method, device, terminal device and computer readable storage medium based on handle, comprising: determine main title and subheading, to there is currently handle carry out circulation positioning;If the corresponding window title of the handle navigated to is consistent with main title, the handle navigated to is determined as main clause handle;First object element is triggered in the corresponding window of main clause handle;Circulation positioning is carried out to existing handle;If the corresponding window title of the handle navigated to is consistent with subheading, the handle navigated to is determined as time handle, the prompt that output page turn function is successfully tested;The second object element is triggered in the corresponding window of secondary handle;Circulation positioning is carried out to existing handle;Window title different and corresponding from main clause handle handle identical with main title if it exists then exports page return functional test and successfully prompts.The present invention realizes page turn function and the page returns to the automatic test of function.

Description

Function test method, device and terminal device based on handle
Technical field
The invention belongs to technical field of data processing, more particularly to the function test method based on handle, device, terminal are set Standby and computer readable storage medium.
Background technique
Basic thought based on soft project, software test are a rings indispensable in software development flow, are used for The function and performance for ensuring software achieve the desired results.Particularly, for the software developed under a windows environment, function is surveyed Examination mainly include in software page turn function and the page return function test.
In the prior art, window is usually opened by tester, manually performs page jump and the page returns to function, and Test result is obtained by the state after observation execution.Since the efficiency of manual operation is lower, and artificial observation may malfunction, Lead to the progress for hampering functional test to a certain extent, the efficiency and accuracy of functional test are low.
Summary of the invention
In view of this, the embodiment of the invention provides by the function test method of handle, device, terminal device and based on Calculation machine readable storage medium storing program for executing, efficiency and the accuracy to solve the problems, such as functional test in the prior art are low.
The first aspect of the embodiment of the present invention provides a kind of function test method based on handle, comprising:
Determine main title and subheading to be detected, to there is currently handle carry out circulation positioning, wherein it is each described Handle corresponds to a window;
If the corresponding window title of the handle navigated to is consistent with the main title, the handle that will be navigated to It is determined as main clause handle;
First object element, the first object element and the subheading are triggered in the corresponding window of the main clause handle There are corresponding relationships;
To there is currently handle carry out circulation positioning;
If the corresponding window title of the handle navigated to is consistent with the subheading, the handle that will be navigated to It is determined as time handle, the prompt that output page turn function is successfully tested;
The second object element, second object element and the main title are triggered in the corresponding window of the secondary handle There are corresponding relationships;
To there is currently handle carry out circulation positioning;
Window title different and corresponding from main clause handle handle identical with the main title if it exists, then output page Face returns to functional test and successfully prompts.
The second aspect of the embodiment of the present invention provides a kind of device for testing functions based on handle, comprising:
First positioning unit, for determining main title and subheading to be detected, to there is currently handle recycle Positioning, wherein each corresponding window of the handle;
Main clause handle determination unit, if the corresponding window title of the handle for navigating to is consistent with the main title, The handle navigated to is then determined as main clause handle;
First trigger unit, for triggering first object element, first mesh in the corresponding window of the main clause handle Marking element, there are corresponding relationships with the subheading;
Second positioning unit, for there is currently handle carry out circulation positioning;
Output unit is jumped, if the corresponding window title of the handle for navigating to is consistent with the subheading, The handle navigated to is determined as time handle, the prompt that output page turn function is successfully tested;
Second trigger unit, for triggering the second object element, second mesh in the corresponding window of the secondary handle Marking element, there are corresponding relationships with the main title;
Third positioning unit, for there is currently handle carry out circulation positioning;
Output unit is returned to, for window title different and corresponding from the main clause handle if it exists and the main title phase Same handle then exports page return functional test and successfully prompts.
The third aspect of the embodiment of the present invention provides a kind of terminal device, and the terminal device includes memory, processing Device and storage in the memory and the computer program that can run on the processor, described in the processor execution Following steps are realized when computer program:
Determine main title and subheading to be detected, to there is currently handle carry out circulation positioning, wherein it is each described Handle corresponds to a window;
If the corresponding window title of the handle navigated to is consistent with the main title, the handle that will be navigated to It is determined as main clause handle;
First object element, the first object element and the subheading are triggered in the corresponding window of the main clause handle There are corresponding relationships;
To there is currently handle carry out circulation positioning;
If the corresponding window title of the handle navigated to is consistent with the subheading, the handle that will be navigated to It is determined as time handle, the prompt that output page turn function is successfully tested;
The second object element, second object element and the main title are triggered in the corresponding window of the secondary handle There are corresponding relationships;
To there is currently handle carry out circulation positioning;
Window title different and corresponding from main clause handle handle identical with the main title if it exists, then output page Face returns to functional test and successfully prompts.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program realizes following steps when being executed by processor:
Determine main title and subheading to be detected, to there is currently handle carry out circulation positioning, wherein it is each described Handle corresponds to a window;
If the corresponding window title of the handle navigated to is consistent with the main title, the handle that will be navigated to It is determined as main clause handle;
First object element, the first object element and the subheading are triggered in the corresponding window of the main clause handle There are corresponding relationships;
To there is currently handle carry out circulation positioning;
If the corresponding window title of the handle navigated to is consistent with the subheading, the handle that will be navigated to It is determined as time handle, the prompt that output page turn function is successfully tested;
The second object element, second object element and the main title are triggered in the corresponding window of the secondary handle There are corresponding relationships;
To there is currently handle carry out circulation positioning;
Window title different and corresponding from main clause handle handle identical with the main title if it exists, then output page Face returns to functional test and successfully prompts.
Existing beneficial effect is the embodiment of the present invention compared with prior art:
The embodiment of the present invention triggers the by determining main title to be detected and subheading in the corresponding window of main title One object element judges whether page turn function triggers success by way of circulation positioning, in the corresponding window of subheading The second object element of middle triggering judges that the page returns to whether function triggers success by way of circulation positioning, and the present invention is implemented Example reduces the manual operation of tester, realizes page turn function and the page returns to the automatic test of function, improve The efficiency and accuracy of functional test.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is the implementation flow chart of the function test method provided in an embodiment of the present invention based on handle;
Fig. 2 is the implementation flow chart of the corresponding window of handle except deletion main clause handle provided in an embodiment of the present invention;
Fig. 3 is the implementation process provided in an embodiment of the present invention that first object element is triggered in the corresponding window of main clause handle Figure;
Fig. 4 is the implementation process provided in an embodiment of the present invention that the second object element is triggered in the corresponding window of secondary handle Figure;
Fig. 5 is the structural block diagram of the device for testing functions provided in an embodiment of the present invention based on handle;
Fig. 6 is the schematic diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Fig. 1 shows the implementation process of the function test method provided in an embodiment of the present invention based on handle, and details are as follows:
In S101, determine main title and subheading to be detected, to there is currently handle carry out circulation positioning, In, each corresponding window of the handle.
Windows is the operating system based on virtual memory, in the environment of virtual memory, Windows behaviour The memory manager needs made in system often move back and forth object in memory, meet holding for various application programs with this Row.On this basis, in Windows operating system using handle (handle) come the different objects in identification application with And it is similar in different instances, such as a window, button, icon, scroll bar, output equipment, control or file etc., therefore energy The information of corresponding object is enough accessed by handle, the concrete form of handle is a unique integer value, i.e. 4 bytes (being 8 bytes in 64 programs) long numerical value.In order to avoid obscuring, limits the handle occurred in the embodiment of the present invention and be used to refer to Show window handle.
Under a windows environment carry out functional test when, it is first determined main title and subheading to be detected, main title and Subheading can be obtained from the test case write, can also carry out customized setting in test, main title and time Title is window title.It is subordinate relation between the corresponding window of main title window corresponding with subheading, for example, main Entitled " catalogue " has the link of " chapter 1 ", " chapter 2 " and " chapter 3 " in the corresponding window of main title, and deutero-albumose is entitled " chapter 1 ", then a kind of mode of operation is first to open the corresponding window of main title, then " the is clicked in the corresponding window of main title The link of one chapter ", to open the corresponding window of subheading.After determining main title and subheading, to there is currently handle Circulation positioning is carried out, the corresponding window of main title is judged whether there is.
Specifically, when carrying out circulation positioning, a Custom Number is respectively provided with to existing each handle, according to default Number order the corresponding handle of Custom Number is ranked up, and according to after sequence all handles carry out handle switching, One of handle is switched to every time, wherein the Custom Number of different handles is different.When carrying out circulation positioning, in order to Convenient for carrying out ordered operation to unknown handle, a Custom Number is respectively provided with to existing each handle.Optionally, it obtains The window of top layer in current Windows environment, and Custom Number is started setting up with the corresponding handle of the window.For setting The Custom Number set sets corresponding number order in the embodiment of the present invention, makes by oneself at each handle corresponding one On the basis of justice number, the corresponding handle of Custom Number is ranked up according to number order, and according to all after sequence Handle carry out sequence switching can specifically be switched by writing the Do statements such as sentence or if else realization sequence.The present invention The operation for switching handle in embodiment can be realized by driver.switch_to.window method, can also pass through other certainly Method is realized.For example, to handle HandleAThe Custom Number of setting is 0, to handle HandleBThe Custom Number of setting is 1, to handle HandleCThe Custom Number of setting is 2, and the number order set is 0,1,2, then according to number order, first general Operation object switches to handle HandleA, then switch to handle HandleB, it is eventually switched to handle HandleC
Optionally it is determined that after main title to be detected and subheading, to there is currently handle carry out circulation positioning Before, it determines window address corresponding with main title, which is added to the starting sentence of setting, execute starting sentence, To open the corresponding window of main title.It is jumped to realize to from the corresponding window of main title to the page of the corresponding window of subheading The test of rotating function, after determining main title and subheading to be detected, the corresponding window of creation main title, of the invention real It applies in example, other than by the corresponding window of tester's manual creation main title, can also obtain window corresponding with main title Address, and window address is added in the starting sentence of setting, the starting sentence that addition is completed is executed, then to open principal mark Inscribe corresponding window, wherein starting sentence can be driver.get sentence, can also can open according to address for other corresponding The sentence of window, the embodiment of the present invention is without limitation.The operation of tester can be simplified by the above method.
Optionally it is determined that main title to be detected and subheading, to there is currently handle carry out circulation positioning after, if The corresponding window title of the handle navigated to is not consistent with main title, then the handle to navigate to adds Redundant representations, the redundancy Mark indicates that corresponding handle is not used in and is repositioned.When carrying out circulation positioning, if the handle currently navigated to is corresponding Window title is not consistent with main title, then arrives the handle in order to avoid repositioning in subsequent circulation position fixing process, cause The waste of computing resource can add Redundant representations in embodiments of the present invention for the handle, and Redundant representations indicate corresponding handle It is not used in and is repositioned.After being added to Redundant representations with the handle that main title is not consistent for corresponding window title, to next A handle is positioned, until determining main clause handle.By the above method, redundancy mark is added for undesirable handle Know, the corresponding handle of Redundant representations is no longer positioned, computing resource is saved.
In S102, if the corresponding window title of the handle navigated to is consistent with the main title, it will navigate to The handle be determined as main clause handle.
After navigating to a handle, the corresponding window title of the handle is obtained, it specifically can be by the side driver.title Method is obtained.If the corresponding window title of the handle currently navigated to is consistent with main title, the handle navigated to is determined For main handle, and stop carrying out circulation positioning.
In S103, in the corresponding window of the main clause handle trigger first object element, the first object element with There are corresponding relationships for the subheading.
First object element, the first object element and subheading presence pair are triggered in the corresponding window of main clause handle It should be related to, first object element can specifically be specified to be located at the specific location in the corresponding window of main clause handle by tester, it is above Example citing is stated, then first object element is " chapter 1 ".It is noted that the element being related in the embodiment of the present invention is Refer to hypertext markup language (HyperText Markup Language, HTML) code in label to comprising and be shown in Page elements on html page, such as<a href="http://www.mulu-diyizhang.com">chapter 1</a >in,<a>with</a>a label pair is constituted, " href=http: //www.mulu-diyizhang.com " is the label pair Attribute, " chapter 1 " between the label pair is then the page elements being shown on HTML, then " chapter 1 " can be considered this hair Element in bright embodiment.Above-mentioned first object element can pass through driver.find_element_by_css_selector (" first object element ") .click method is triggered, and can also be triggered certainly using other way.
In S104, to there is currently handle carry out circulation positioning.
After triggering first object element, again to there is currently handle carry out circulation positioning, to judge whether In the presence of window corresponding with subheading.
In S105, if the corresponding window title of the handle navigated to is consistent with the subheading, it will navigate to The handle be determined as time handle, the prompt that output page turn function is successfully tested.
If the corresponding window title of the handle navigated to is identical as subheading, the handle currently navigated to is determined as secondary Handle, and stop carrying out circulation positioning, the prompt that output page turn function is successfully tested;Conversely, if the handle pair navigated to The window title answered is different from subheading, then continues circulation positioning, until determining secondary handle.If to all After handle carries out circulation positioning, it is still not determined by time handle, then exports the prompt of page turn function test crash.
In S106, trigger the second object element in the corresponding window of the secondary handle, second object element with There are corresponding relationships for the main title.
After being successfully tested to page turn function, the test that the page returns to function is carried out.Specifically, corresponding in secondary handle The second object element is triggered in window, there are corresponding relationships with main title for second object element, similarly, can be by tester Specified second object element is located at the specific location in time corresponding window of handle.
In S107, to there is currently handle carry out circulation positioning.
After triggering the second object element, in order to judge whether to occur another window corresponding with main title, again to working as Preceding existing handle carries out circulation positioning.
In S108, window title different and corresponding from main clause handle sentence identical with the main title if it exists Handle then exports page return functional test and successfully prompts.
Since the page returns to the triggering of function the result is that a new window corresponding with main title is opened, if therefore following In ring position fixing process, judges there is window title different and corresponding from main clause handle handle identical with main title, then export The page returns to functional test and successfully prompts;If after carrying out circulation positioning to all handles, being still not determined by and main clause handle Different and corresponding window title handle identical with main title then exports the prompt that the page returns to functional test failure.It is worth Illustrate, is successfully tested or the prompt of test crash can be exported in a manner of short message, mail or instant message etc., the present invention Embodiment does not limit this.
By embodiment illustrated in fig. 1 it is found that in embodiments of the present invention, determining main title and subheading, to there is currently Handle carry out circulation positioning, if the corresponding window title of the handle navigated to is consistent with main title, the handle that will be navigated to Be determined as main clause handle, in the corresponding window of main clause handle trigger first object element, again to there is currently handle follow The handle navigated to is determined as time handle if the corresponding window title of the handle navigated to is consistent with subheading by ring positioning, The prompt that is successfully tested of output page turn function, triggers the second object element in the corresponding window of secondary handle, to currently depositing Handle carry out circulation positioning, window title different and corresponding from main clause handle handle identical with main title if it exists, then The output page returns to functional test and successfully prompts, and the embodiment of the present invention is real by way of triggering element and circulation positioning handle Show page turn function and the page returns to the automatic test of function, improves the efficiency and accuracy of functional test.
It is the implementation process of the corresponding window of handle except deletion main clause handle provided in an embodiment of the present invention shown in Fig. 2 Figure, as shown in Fig. 2, the function test method based on handle may comprise steps of:
In S201, circulation positioning is carried out to the handle except the main clause handle.
After main clause handle has been determined, circulation positioning is carried out to the handle except main clause handle.
In S202, the handle is often navigated to, then the corresponding window of the handle is deleted, until there is only described Until the corresponding window of main clause handle.
In embodiments of the present invention when test page turn function, it is desirable that there is only the corresponding windows of main clause handle, therefore The caused wasting of resources often navigates to a main clause handle in this step when in order to avoid the subsequent circulation positioning to other handles Except handle, then delete the corresponding window of the handle, specifically can by driver.close method carry out window deletion, until There is only until the corresponding window of main clause handle.
By embodiment illustrated in fig. 2 it is found that in embodiments of the present invention, it is fixed recycle to the handle except main clause handle Position, often navigates to a handle, then deletes the corresponding window of handle, until window corresponding there is only main clause handle, this hair Bright embodiment saves computing resource from another level by deleting the corresponding window of handle except main clause handle.
It is the reality provided in an embodiment of the present invention that first object element is triggered in the corresponding window of main clause handle shown in Fig. 3 Existing flow chart, as shown in figure 3, the function test method based on handle may comprise steps of:
In S301, all hyperlink elements are searched out in the bottom source code of the corresponding window of the main clause handle, it is described Label where hyperlink element is to for hyperlink label pair.
In the case where the corresponding window of main clause handle is write by HTML, page turn function is usually to pass through in HTML The realization of hyperlink label, therefore in addition to specifying specific location of the first object element in the corresponding window of main clause handle by tester Outside, all hyperlink labels pair can also be searched out in the bottom source code of the corresponding window of main clause handle, and by all hyperlink marks It signs internal element and is determined as hyperlink element.Specifically, in HTML,<a></a>label to define hyperlink, be used for from One window is linked to another window.
In S302, the hyperlink element is determined as first object element, triggers the first object element.
Hyperlink element is determined as first object element, and triggers first object element, detection in the next steps is It is no the corresponding window of subheading occur.
By embodiment illustrated in fig. 3 it is found that in embodiments of the present invention, in the bottom source code of the corresponding window of main clause handle All hyperlink elements are searched out, hyperlink element is determined as first object element, trigger first object element, the present invention is real It applies example specified except first object element by tester, passes through all hyperlink member in the corresponding window of triggering main clause handle The test for usually carrying out page turn function, improves the applicability of functional test.
It is the reality provided in an embodiment of the present invention that the second object element is triggered in the corresponding window of secondary handle shown in Fig. 4 Existing flow chart, as shown in figure 4, the function test method based on handle may comprise steps of:
It in S401, determines and returns to word, searched out in the bottom source code of the corresponding window of the secondary handle comprising described Return to the hyperlink element of word.
When test page returns to function, in addition to by the second target element in specified corresponding window of handle of tester It is plain outer, it may further determine that return word, the hyperlink member comprising returning to word searched out in the bottom source code of the corresponding window of secondary handle Plain (hyperlink element searched out herein is different from the hyperlink element in step S301~S302).Returning to word may be configured as reality The page returns to the corresponding everyday words of function in the application scenarios of border, for example can will return to word and be set as " returning " or " Returning catalogue " Deng.
In S402, the hyperlink element is determined as second object element, triggers second object element.
After searching out the hyperlink element comprising returning to word, hyperlink element is determined as the second object element, and touch The second object element is sent out, and judges another main window whether occur after triggering the second object element in the next steps.
By embodiment illustrated in fig. 4 it is found that in embodiments of the present invention, determining and returning to word, in the corresponding window of secondary handle Bottom source code in search out comprising return word hyperlink element, hyperlink element is determined as the second object element, trigger Second object element, the embodiment of the present invention determine the second object element according to word is returned, and by triggering time corresponding window of handle The second target element in mouthful usually carries out the test that the page returns to function, and being applicable in for functional test is improved in another level Property.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Corresponding to, based on the function test method of handle, Fig. 5 shows the embodiment of the present invention and mentions described in foregoing embodiments The structural block diagram of the device for testing functions based on handle supplied, referring to Fig. 5, which includes:
First positioning unit 51, for determining main title and subheading to be detected, to there is currently handle follow Ring positioning, wherein each corresponding window of the handle;
Main clause handle determination unit 52, if the corresponding window title of the handle and the main title phase for navigating to Symbol, then be determined as main clause handle for the handle navigated to;
First trigger unit 53, in the corresponding window of the main clause handle trigger first object element, described first There are corresponding relationships with the subheading for object element;
Second positioning unit 54, for there is currently handle carry out circulation positioning;
Output unit 55 is jumped, if the corresponding window title of the handle for navigating to is consistent with the subheading, The handle navigated to is then determined as time handle, the prompt that output page turn function is successfully tested;
Second trigger unit 56, for triggering the second object element in the corresponding window of the secondary handle, described second There are corresponding relationships with the main title for object element;
Third positioning unit 57, for there is currently handle carry out circulation positioning;
Output unit 58 is returned to, for window title different and corresponding from the main clause handle if it exists and the main title Identical handle then exports page return functional test and successfully prompts.
Optionally, the first positioning unit 51 further include:
Adding unit, if the corresponding window title of the handle for navigating to is not consistent with the main title, for The handle addition Redundant representations navigated to, the Redundant representations indicate that the corresponding handle is not used in and are repositioned.
Optionally, main clause handle determination unit 52 further include:
Condition positioning unit, for carrying out circulation positioning to the handle except the main clause handle;
Delete unit, for often navigating to the handle, then delete the corresponding window of the handle, until there is only Until the corresponding window of the main clause handle.
Optionally, the first trigger unit 53 includes:
Search unit, for searching out all hyperlink elements in the bottom source code of the corresponding window of the main clause handle, Label where the hyperlink element is to for hyperlink label pair;
First triggering subelement triggers first mesh for the hyperlink element to be determined as first object element Mark element.
Optionally, the second trigger unit 55, comprising:
Determination unit returns to word for determining, searches out in the bottom source code of the corresponding window of the secondary handle and includes The hyperlink element for returning to word;
Second triggering subelement triggers described for the hyperlink element to be determined as second object element Two object elements.
Optionally, based on the device for testing functions of handle further include:
The window address is added to setting for determining window address corresponding with the main title by execution unit Starting sentence, the starting sentence is executed, to open the corresponding window of the main title.
Therefore, provided in an embodiment of the present invention to be determined based on the device for testing functions of handle by triggering element and recycle Position, realizes page turn function and the page returns to the automatic test of function, improves the efficiency of functional test.
Fig. 6 is the schematic diagram of terminal device provided in an embodiment of the present invention.As shown in fig. 6, the terminal device 6 of the embodiment Include: processor 60, memory 61 and is stored in the calculating that can be run in the memory 61 and on the processor 60 Machine program 62, such as the functional test program based on handle.The processor 60 is realized when executing the computer program 62 State the step in each function test method embodiment based on handle, such as step S101 to S108 shown in FIG. 1.Alternatively, The processor 60 is realized each in the above-mentioned respectively device for testing functions embodiment based on handle when executing the computer program 62 The function of unit, such as the function of unit 61 to 68 shown in Fig. 6.
Illustratively, the computer program 62 can be divided into one or more units, one or more of Unit is stored in the memory 61, and is executed by the processor 60, to complete the present invention.One or more of lists Member can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence 62 in the terminal device 6.For example, the computer program 62 can be divided into the first positioning list Member, main clause handle determination unit, the first trigger unit, the second positioning unit, to jump output unit, the second trigger unit, third fixed Bit location and return output unit, each unit concrete function are as follows:
First positioning unit, for determining main title and subheading to be detected, to there is currently handle recycle Positioning, wherein each corresponding window of the handle;
Main clause handle determination unit, if the corresponding window title of the handle for navigating to is consistent with the main title, The handle navigated to is then determined as main clause handle;
First trigger unit, for triggering first object element, first mesh in the corresponding window of the main clause handle Marking element, there are corresponding relationships with the subheading;
Second positioning unit, for there is currently handle carry out circulation positioning;
Output unit is jumped, if the corresponding window title of the handle for navigating to is consistent with the subheading, The handle navigated to is determined as time handle, the prompt that output page turn function is successfully tested;
Second trigger unit, for triggering the second object element, second mesh in the corresponding window of the secondary handle Marking element, there are corresponding relationships with the main title;
Third positioning unit, for there is currently handle carry out circulation positioning;
Output unit is returned to, for window title different and corresponding from the main clause handle if it exists and the main title phase Same handle then exports page return functional test and successfully prompts.
The terminal device 6 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The terminal device may include, but be not limited only to, processor 60, memory 61.It will be understood by those skilled in the art that Fig. 6 The only example of terminal device 6 does not constitute the restriction to terminal device 6, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net Network access device, bus etc..
Alleged processor 60 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 61 can be the internal storage unit of the terminal device 6, such as the hard disk or interior of terminal device 6 It deposits.The memory 61 is also possible to the External memory equipment of the terminal device 6, such as be equipped on the terminal device 6 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 61 can also both include the storage inside list of the terminal device 6 Member also includes External memory equipment.The memory 61 is for storing needed for the computer program and the terminal device Other programs and data.The memory 61 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit division progress for example, in practical application, can according to need and by above-mentioned function distribution by different functions Unit is completed, i.e., the internal structure of the terminal device is divided into different functional units, to complete whole described above Or partial function.Each functional unit in embodiment can integrate in one processing unit, be also possible to each unit list It is solely physically present, can also be integrated in one unit with two or more units, above-mentioned integrated unit can both use Formal implementation of hardware can also be realized in the form of software functional units.In addition, the specific name of each functional unit also only It is the protection scope that is not intended to limit this application for the ease of mutually distinguishing.The specific work process of unit in above system, It can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed terminal device and method can pass through it Its mode is realized.For example, terminal device embodiment described above is only schematical, for example, the unit is drawn Point, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can To combine or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or beg for The mutual coupling or direct-coupling or communication connection of opinion can be through some interfaces, the INDIRECT COUPLING of device or unit Or communication connection, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-described embodiment side All or part of the process in method can also instruct relevant hardware to complete, the computer by computer program Program can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned each The step of a embodiment of the method.Wherein, the computer program includes computer program code, and the computer program code can Think source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium can be with It include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, light that can carry the computer program code Disk, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described computer-readable The content that medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as at certain A little jurisdictions do not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of function test method based on handle characterized by comprising
Determine main title and subheading to be detected, to there is currently handle carry out circulation positioning, wherein each handle A corresponding window;
If the corresponding window title of the handle navigated to is consistent with the main title, the handle navigated to is determined For main handle;
First object element is triggered in the corresponding window of the main clause handle, the first object element and the subheading exist Corresponding relationship;
To there is currently handle carry out circulation positioning;
If the corresponding window title of the handle navigated to is consistent with the subheading, the handle navigated to is determined For secondary handle, the prompt that page turn function is successfully tested is exported;
The second object element is triggered in the corresponding window of the secondary handle, second object element and the main title exist Corresponding relationship;
To there is currently handle carry out circulation positioning;
Window title different and corresponding from main clause handle handle identical with the main title if it exists, then export the page and return Functional test is returned successfully to prompt.
2. function test method as described in claim 1, which is characterized in that determination main title to be detected and deutero-albumose Topic, to there is currently handle carry out circulation positioning after, further includes:
If the corresponding window title of the handle navigated to is not consistent with the main title, the handle to navigate to adds Add Redundant representations, the Redundant representations indicate that the corresponding handle is not used in and repositioned.
3. function test method as described in claim 1, which is characterized in that if the corresponding window of the handle navigated to Mouth title is consistent with the main title, then the handle navigated to is determined as after main clause handle, further includes:
Circulation positioning is carried out to the handle except the main clause handle;
The handle is often navigated to, then deletes the corresponding window of the handle, until there is only the main clause handle is corresponding Until window.
4. function test method as described in claim 1, which is characterized in that described to be touched in the corresponding window of the main clause handle Send out first object element, comprising:
All hyperlink elements, the hyperlink element place are searched out in the bottom source code of the corresponding window of the main clause handle Label to for hyperlink label pair;
The hyperlink element is determined as first object element, triggers the first object element.
5. function test method as described in claim 1, which is characterized in that described to be touched in the corresponding window of the secondary handle Send out the second object element, comprising:
It determines and returns to word, searched out in the bottom source code of the corresponding window of the secondary handle comprising the hyperlink for returning to word Element;
The hyperlink element is determined as second object element, triggers second object element.
6. function test method as described in claim 1, which is characterized in that determination main title to be detected and subheading Later, it is described to there is currently handle carry out circulation positioning before, further includes:
It determines window address corresponding with the main title, the window address is added to the starting sentence of setting, execute institute Starting sentence is stated, to open the corresponding window of the main title.
7. a kind of device for testing functions based on handle characterized by comprising
First positioning unit, for determining main title and subheading to be detected, to there is currently handle carry out circulation positioning, Wherein, the corresponding window of each handle;
Main clause handle determination unit will if the corresponding window title of the handle for navigating to is consistent with the main title The handle navigated to is determined as main clause handle;
First trigger unit, for triggering first object element, the first object member in the corresponding window of the main clause handle It is plain that there are corresponding relationships with the subheading;
Second positioning unit, for there is currently handle carry out circulation positioning;
Output unit is jumped, if the corresponding window title of the handle for navigating to is consistent with the subheading, will be determined Position to the handle be determined as time handle, the prompt that output page turn function is successfully tested;
Second trigger unit, for triggering the second object element, second target element in the corresponding window of the secondary handle It is plain that there are corresponding relationships with the main title;
Third positioning unit, for there is currently handle carry out circulation positioning;
Output unit is returned, it is identical with the main title for window title different and corresponding from the main clause handle if it exists Handle then exports page return functional test and successfully prompts.
8. a kind of terminal device, which is characterized in that the terminal device includes memory, processor and is stored in the storage In device and the computer program that can run on the processor, the processor are realized as follows when executing the computer program Step:
Determine main title and subheading to be detected, to there is currently handle carry out circulation positioning, wherein each handle A corresponding window;
If the corresponding window title of the handle navigated to is consistent with the main title, the handle navigated to is determined For main handle;
First object element is triggered in the corresponding window of the main clause handle, the first object element and the subheading exist Corresponding relationship;
To there is currently handle carry out circulation positioning;
If the corresponding window title of the handle navigated to is consistent with the subheading, the handle navigated to is determined For secondary handle, the prompt that page turn function is successfully tested is exported;
The second object element is triggered in the corresponding window of the secondary handle, second object element and the main title exist Corresponding relationship;
To there is currently handle carry out circulation positioning;
Window title different and corresponding from main clause handle handle identical with the main title if it exists, then export the page and return Functional test is returned successfully to prompt.
9. terminal device as claimed in claim 8, which is characterized in that determination main title to be detected and subheading, it is right There is currently handle carry out circulation positioning after, further includes:
If the corresponding window title of the handle navigated to is not consistent with the main title, the handle to navigate to adds Add Redundant representations, the Redundant representations indicate that the corresponding handle is not used in and repositioned.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In the step of realization function test method as described in any one of claim 1 to 6 when the computer program is executed by processor Suddenly.
CN201910424150.8A 2019-05-21 2019-05-21 Function test method, device and terminal device based on handle Pending CN110262963A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910424150.8A CN110262963A (en) 2019-05-21 2019-05-21 Function test method, device and terminal device based on handle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910424150.8A CN110262963A (en) 2019-05-21 2019-05-21 Function test method, device and terminal device based on handle

Publications (1)

Publication Number Publication Date
CN110262963A true CN110262963A (en) 2019-09-20

Family

ID=67914964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910424150.8A Pending CN110262963A (en) 2019-05-21 2019-05-21 Function test method, device and terminal device based on handle

Country Status (1)

Country Link
CN (1) CN110262963A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543152A (en) * 2022-11-16 2022-12-30 北京时代亿信科技股份有限公司 Method and device for determining file state

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013071728A1 (en) * 2011-11-18 2013-05-23 华为技术有限公司 Page testing method and page testing device
CN109522086A (en) * 2018-11-29 2019-03-26 金蝶软件(中国)有限公司 To the operating method and device of window, computer installation and readable storage medium storing program for executing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013071728A1 (en) * 2011-11-18 2013-05-23 华为技术有限公司 Page testing method and page testing device
CN109522086A (en) * 2018-11-29 2019-03-26 金蝶软件(中国)有限公司 To the operating method and device of window, computer installation and readable storage medium storing program for executing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
何文广;周珂;熊刚强;王耀民;: "VB.NET程序设计题动态评阅技术研究", 实验室研究与探索, no. 11 *
张虎;黄海于;: "基于分布式环境的子进程监控软件设计与实现", 微型机与应用, no. 07 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543152A (en) * 2022-11-16 2022-12-30 北京时代亿信科技股份有限公司 Method and device for determining file state

Similar Documents

Publication Publication Date Title
CN107438814B (en) Mobile device and method thereof, and method of mobile device emulator
US9298680B2 (en) Display of hypertext documents grouped according to their affinity
CN110442336A (en) A kind of web development methods and device, storage medium and electronic equipment
US20060259867A1 (en) System and method for automatic generation of browsing favorites
CN102902697A (en) Method and system for generating structured document guide view
US11526575B2 (en) Web browser with enhanced history classification
CN103873318A (en) Website automated testing method and automated testing system
EP3387525B1 (en) Learning from input patterns in programing-by-example
EP2707807A2 (en) Training statistical dialog managers in spoken dialog systems with web data
CN109783737A (en) Information retrieval method, device, computer equipment and storage medium
Peng et al. Graph-based ajax crawl: Mining data from rich internet applications
CN112765159A (en) Report generation method, system, computer equipment and storage medium
US9135328B2 (en) Ranking documents through contextual shortcuts
CN107193754B (en) Method and apparatus for data storage for searching
JP6586177B2 (en) Cumulative search processing method and apparatus, terminal, and storage medium
CN105659235A (en) A term searching method for network information and a system thereof
CN110262963A (en) Function test method, device and terminal device based on handle
CN111488510B (en) Method and device for determining related words of applet, processing equipment and search system
CN106570061B (en) Webpage label management method and mobile terminal
CN111723134A (en) Information processing method, information processing device, electronic equipment and storage medium
CN113392070A (en) Online document management method, device, system, equipment and storage medium
CN114519153A (en) Webpage history record display method, device, equipment and storage medium
CN104063118B (en) A kind of the click display methods and device of web page contents
JP5861545B2 (en) Information processing apparatus, history control method, and history control program
CN109885542A (en) Item file management method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20240621