CN105608007A - Page model as well as user interface automated test method and device - Google Patents

Page model as well as user interface automated test method and device Download PDF

Info

Publication number
CN105608007A
CN105608007A CN201511001546.XA CN201511001546A CN105608007A CN 105608007 A CN105608007 A CN 105608007A CN 201511001546 A CN201511001546 A CN 201511001546A CN 105608007 A CN105608007 A CN 105608007A
Authority
CN
China
Prior art keywords
page
model
user interface
page model
data input
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.)
Granted
Application number
CN201511001546.XA
Other languages
Chinese (zh)
Other versions
CN105608007B (en
Inventor
韦伟
康艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING SEEYON SOFTWARE Co Ltd
Original Assignee
BEIJING SEEYON SOFTWARE Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING SEEYON SOFTWARE Co Ltd filed Critical BEIJING SEEYON SOFTWARE Co Ltd
Priority to CN201511001546.XA priority Critical patent/CN105608007B/en
Publication of CN105608007A publication Critical patent/CN105608007A/en
Application granted granted Critical
Publication of CN105608007B publication Critical patent/CN105608007B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The invention relates to a page model as well as a user interface automated test method and device. The page model is provided with attributes and methods. The page model comprises a first set provided with attributes and methods and/or a second set provided with attributes and methods, wherein the first set is formed by packaging a plurality of page elements, and the methods of the first set are used for the methods of the page model or the methods of the second set to call; each page element packaged in the first set is provided with an attribute and a method, and the method of each page element is used for the methods of the first set to call; the second set is formed by packaging a plurality of first sets, and the methods of the second set are used for the methods of the page model to call; and when the page model is instantiated and called, corresponding page functions are finished by executing the methods of the page model. According to the page model as well as the user interface automated test method and device, the efficiency and maintainability of user interface automated testing are improved and the realization cost of user interface automated testing is reduced.

Description

Page model, user interface automated testing method and device
Technical field
The present invention relates to technical field of measurement and test, particularly relate to a kind of user interface automated testing method and user interface certainlyMovingization testing arrangement.
Background technology
One of test purpose of UI test (Userinterfacetesting, ui testing) is to guarantee testedThe user interface of business can provide corresponding access or the function such as browse for user.
In the evolution of UI test, be based upon the UI automatic test skill based on page model on object-oriented basisArt is suggested, and because this measuring technology has exploitation and the feature such as maintenance difficulties is low, and has obtained comparatively in UI field testsApply widely.
The existing UI automatization testing technique based on page model is mainly by each HTML (Hyper related tested businessTextMarkupLanguage, HTML) page is abstracted into attribute and method (as by html pageHold as attribute, using the function of html page as method), thereby using each html page function of tested business as surveyExamination granularity realizes UI automatic test. From the setting up procedure of page model, this measuring technology is mainly to utilize HTML pageThe all html pages unit comprising in face usually arranges page model, and all html page elements come from same conventionallyIndividual base class (as coming from WebElement base class).
Inventor finds realizing in process of the present invention: because the existing UI automatization testing technique based on page model is profitPage model being usually set with all html pages unit of comprising in the page, therefore, is tested business setting page mouldThe close phase of quantity of the html page element that the page quantity that the workload of type and tested business are related and the page compriseClose; Few in the page quantity that tested business is related, and also few feelings of the html page number of elements that comprises of the pageUnder condition, by the easier tested personnel of workload of tested business setting page model are accepted; And it is related in tested businessThe many situation of the html page number of elements that page quantity is many and the page comprises under, be tested business setting page modelWorkload can become very huge, thereby more difficult tested personnel accept. In addition, due to existing based on page modelUI automatization testing technique is to utilize all html pages unit comprising in actual html page that page model is usually set,Therefore, the page model of designing has stronger specific aim conventionally, and its versatility is poor, as for a certain tested businessThe page model of designing can only be applicable to, in the UI test process in this tested business, conventionally can not be applicable to other conventionallyIn the UI test process of tested business.
Because the problem of the existing UI automatization testing technique existence based on page model, the inventor is based on being engaged in this type ofThe practical experience that product design manufacture is enriched for many years and professional knowledge, and coordinate the utilization of scientific principle, actively research and innovation in addition, withPhase is founded a kind of page model and user interface automated testing method and device, can solve existing user interface automationThe existing problem of measuring technology, makes it have more practicality. Through continuous research and design, and through repeatedly study sample andAfter improvement, finally create the present invention who has practical value.
Summary of the invention
One of object of the present invention is, overcomes the technical problem that existing user interface automatization testing technique exists, and carriesFor a kind of page model and user interface automated testing method and device, technical problem to be solved is to improve user circleThe efficiency of face automatic test and maintainability, reduce the cost of realizing of user interface automatic test.
Object of the present invention and solve its technical problem and can adopt following technical scheme to realize.
Propose according to the present invention a kind of for user interface automatic test based on OO page model, described pageSurface model is provided with attribute and method, and described page model comprises: be provided with the first set of attribute and method and/or establishBe equipped with the second set of attribute and method; Described first gathers by multiple page elements are encapsulated and formed, described inThe method of the first set is for the method for page model or the method call of the second set; Be packaged in each page in the first setSurface element is provided with attribute and method, and the method for each page elements is all for the first method call of gathering; DescribedTwo set are by encapsulating and form at least one first set, and the method for described the second set is for the side of page modelMethod is called; Described page model is for being instantiated at it, and when called, the page model being instantiated is by carrying out its sideMethod completes corresponding page function, to realize user interface automatic test.
A kind of user interface automated testing method proposing according to the present invention, the method mainly comprises the steps: to determine quiltThe corresponding intended service flow process of test service; Determine the each self-corresponding page of the related each user interface of described intended service flow processSurface model, wherein, described page model is above-mentioned page model; Make the corresponding page according to each user interface of tested businessModel instantiation respectively; Call the page model after corresponding instantiation according to test case, the page after invoked instantiationModel completes corresponding page function by carrying out its method separately, to realize user interface automatic test.
A kind of user interface automatic test device proposing according to the present invention, is arranged in business management system, and this deviceMainly comprise: the first determination module, is suitable for determining the corresponding intended service flow process of tested business; The second determination module, suitableIn definite related each self-corresponding page model of each user interface of described intended service flow process, wherein, described page model isAbove-mentioned page model; Instantiation module, is suitable for making corresponding page model example respectively according to each user interface of tested businessChange; Test module, is suitable for calling the page model after corresponding instantiation according to test case the page after invoked instantiationSurface model completes corresponding page function by carrying out its method separately, to realize user interface automatic test.
By technique scheme, page model of the present invention, user interface automated testing method and device at least haveFollowing advantages and beneficial effect: the present invention is by multiple page elements are encapsulated and form the first set, and by leastOne first set encapsulates and forms the second set, and like this, each page model all can be by the first set and/or secondSet arranges, and can make to include each page mould of the first set and the second set by revising the first set and the second setType is all revised accordingly, thereby has simplified the setting up procedure of page model, has avoided as tested business setting page modelThe quantity of the html page element that comprises of workload and the related page quantity of tested business and the page closely-relatedPhenomenon; The present invention is by for the related each UI Preferences page model of intended service flow process, in intended service flow process andThe each user interface relating to has in the situation of stronger versatility, each user interface correspondence separately that this intended service flow process is relatedPage model also can there is stronger versatility, make this intended service flow process and related each user interface thereof corresponding separatelyPage model can be applied in the user interface automatic test course of the different business with identical services function, thereby canEffectively to reduce the workload of writing test code; Seen from the above description, technical scheme provided by the invention has improved user circleThe efficiency of face automatic test and maintainability, reduced the cost of realizing of user interface automatic test.
In sum, the present invention has significant progress technically, and has significantly actively technique effect, is really one newClever, progressive, practical new design.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to better understand technological means of the present invention, and canContent according to description is implemented, and for allow above and other object of the present invention, feature and advantage can be more obviousUnderstandable, below especially exemplified by preferred embodiment, be described in detail as follows.
Brief description of the drawings
Fig. 1 is the flow chart of the user interface automated testing method of the embodiment of the present invention two;
Fig. 2 is the schematic diagram of the user interface automatic test device of the embodiment of the present invention three.
Detailed description of the invention
Below in conjunction with accompanying drawing, user interface automated testing method and the device of the embodiment of the present invention are elaborated.
Embodiment mono-, for user interface automatic test based on OO page model. It is the page in the present embodimentSurface model arranges based on OO principle, and page model in the present embodiment to be mainly applicable to user interface automaticChange in test process.
Page model in the present embodiment is provided with attribute and method, and wherein, the attribute of page model is the page taking outThe feature that model has, and the method for page model is the performed operation of page model taking out. Page in the present embodimentSurface model is mainly used in after it is instantiated, and the page model after this instantiation can be called, as the page mould after instantiationType is called by user interface automatic test program, and user interface automatic test program can be come according to concrete testing requirementCall the method for the page model of this instantiation, the page model after invoked instantiation can complete phase by carrying out its methodThe page function of answering, the page function completing contributes to realize user interface automatic test.
Page model in the present embodiment mainly comprises: at least one is provided with the first set of attribute and method (as passed throughMultiple the first set are encapsulated and form page model); This page model also can comprise: at least one is provided with attributeThe second set (as by multiple the second set are encapsulated and form page model) with method; Also or this page moduleAlso can comprise: at least one is provided with, and first of attribute and method gathered and at least one is provided with second of attribute and methodSet (as formed page model by multiple the first set and multiple second are gathered to encapsulate).
As example, the page model in the present embodiment can further comprise on the basis of above-mentioned included content: at leastOne is provided with the page elements of attribute and method, and this page elements can be the page elements (base based on HTML basic elementMethod in the page elements of HTML basic element can be called by the method for page model), this page elements can be also baseIn the page elements of self-defined element base class, (method of the page elements based on self-defined element base class can be by the side of page modelMethod is called); A concrete example, by one or more page elements based on HTML basic element, one or manyIndividual page elements, one or more first set and one or more the second set based on self-defined element base class carried outThereby encapsulation forms the page model of the present embodiment. It should be noted that, although the present embodiment is not to based on HTMLThe page elements of basic element, the page elements based on self-defined element base class, the first set and the second set are by differentCombination is carried out encapsulation flexibly and is exemplified one by one description with the various examples that form page model, but, can obviously know thisThe page model of embodiment can form by other combinations completely, as page model can be by based on self-defined unitThe page elements of element base class and the first set encapsulate and formation etc.
In the present embodiment first set normally encapsulates for the multiple page elements that often use in each page togetherAnd form, the method for the first set can be called by the method for page model, and in page model, includes the second setSituation under, first set method also can be called by the method for the second set. In the present embodiment first set can be byBe called assembly.
Each page elements being packaged in the first set is provided with attribute and method, and the side of each page elementsMethod all can be called by the method for the first set. In addition, the in the situation that of including the second set in page model, eachThe method of page elements also can be called by the method for the second set. Certainly the side of each page elements in the present embodiment,Method is also to be called by the method for page model.
The page elements being packaged in the first set can comprise: at least one page elements based on HTML basic element and/Or at least one page elements based on self-defined element base class, that is to say, the first set can be passed through multiple based on HTMLThe page elements of basic element encapsulates and forms, and first set also can be by being multiple based on self-defined element base classPage elements encapsulates and forms, and the first set can also be for passing through at least one the page unit based on HTML basic elementElement and at least one page elements based on self-defined element base class encapsulate and form.
The above-mentioned page elements based on HTML basic element and the page elements based on self-defined element base class are all used to formThe base unit of the first set. Because the page elements based on HTML basic element can also be used to form based on self-defined elementThe page elements of base class, therefore, the page elements based on HTML basic element is the least unit in the present embodiment; This enforcementThe page elements based on HTML basic element in example can be specially and come from the existing page based on WebElement base classElement etc. The present embodiment does not limit the concrete manifestation form of the page elements based on HTML basic element.
As example, the above-mentioned page elements based on self-defined element base class can be specially the button based on button element base classElement, also can be specially the data input element based on data input element base class. Certainly, the present embodiment also can be for itHis element with identical function arranges base class, all comes from this base class thereby make other have identical element; The present embodimentDo not limit the concrete manifestation form of self-defined element base class.
In the prior art, because all elements in user interface all comes from same base class conventionally (as WebElementBase class), therefore, this base class is not to arrange for button element concrete in user interface specially; And at the present embodimentIn, be specially provided with base class (can be called button element base class) for the button element in user interface, thus the present embodimentMake button become the total presentation of a dvielement, the common ground of this dvielement comprises: complete people and smart electronics is established by clickMutual etc. between standby (as computer), the difference of this dvielement comprises: label difference (if any the mark of button elementLabel are a labels, and the label of some button elements is input label, and the label of some button elements is div label, even hasThe label of button element be multiple labels etc.), shape size is different and show text difference etc. The present embodiment is by establishingPut button element base class, and utilize the button element based on button element base class that the first set (being assembly) is set, make assemblyThere is versatility and become possibility.
Same, in the prior art, due to all elements in user interface conventionally all come from same base class (asWebElement base class), therefore, this base class is not specially to input relevant element for concrete in user interface to data(as input frame element) and arrange; And in the present embodiment, in user interface to input relevant element special to dataDoor is provided with one or more base class (can be called data input element base class), thereby makes text element, textareaElement, combobox element (as select element or one group of div element etc.), list/check box element are (as radio/checkboxElement), select control element, date control element etc. can come from data input element base class. Number in the present embodimentCan comprise multiple page elements based on HTML basic element according to input element base class, data input element base class can be byOne group of page elements based on HTML basic element encapsulates and forms, a concrete example, and data input element base class canBy one for representing the page elements based on HTML basic element (as label element) of title and one for literary compositionThis box form is accepted the page elements based on HTML basic element (as the input element) encapsulation of input character and is formed. ThisEmbodiment is by for inputting relevant element to data, data input element base class being set specially, and utilization is based on data input unitThe data input element of element base class arranges the first set (being assembly), and making assembly have versatility becomes possibility.
As example, in the attribute of the data input element based on data input element base class in the present embodiment, can be provided withRepresent that thereby the prompting text element in this data input element can be for identifying information the present embodiment of this data input elementCan utilize the particular content of this prompting text element to identify this data input element. Above-mentioned prompting text element conventionally and textElement, textarea element, combobox element (as select element or one group of div element etc.), list/check box elementThe elements such as (as radio/checkbox element), selection control element or date control element are corresponding. A concrete exampleSon, after the data input element based on data input element base class is instantiated, prompting text element is carrying of input frame sideShow text, as " name " on name input frame side can identify this data input element, that is to say, prompting text canTo become unique presentation attribute of a data input element; The concrete application of this data set input element can make one thusIt is " right that the operation that input frame is inputted is changed to by the form of presentation of existing " the element input content that is username to id "Name input content element typing content " form of presentation, thereby in the time writing UI automatic test code, can realize byFocus has risen to webpage representation layer from HTML code layer.
As example, the set of first in the present embodiment (being assembly) can be specially data input area assembly, sets of tablesPart, tree graph assembly, tab assembly and chart assembly etc., the present embodiment does not limit set component count and each assemblyConcrete manifestation form etc.
As example, data input area assembly is mainly by the button element to based on button element base class and based on numberThe assembly forming according to the data input element of input element base class encapsulates. Data input area assembly conventionally can be to inputThe quantity of frame etc. limits. Utilize data input area assembly can realize the input of one group of data, as utilize data input areaTerritory assembly can be realized the input of the log-on messages such as user's name, user cipher and identifying code.
As example, form component can be by the page elements based on HTML basic element being encapsulated to the group formingPart, form component also can make by the page elements to based on HTML basic element and the number based on data input element base classThe assembly forming according to input element encapsulates. The attribute of form component can comprise selector, the gauge outfit of showing regionThe selector of selector, table body, selector and the selector of cell etc. of row. Utilize form component can realize formShow; Under normal circumstances, form component can not be used in Information Inputting Process, but conventionally can be used to information access processIn; For example, the content presenting from utilizing form component, obtain corresponding information, to carry out information matches judgement etc. FormLine number, the columns that assembly can't comprise form and whether must include the contents such as gauge outfit and specifically limit.
As example, tree graph assembly is mainly by multiple page elements based on HTML basic element are encapsulated and formedAssembly; Utilize tree graph assembly can realize the displaying of tree-shaped figure; Under normal circumstances, it is defeated that tree graph assembly can not be used to informationEnter in process, but conventionally can be used in information access process; For example, the tree-shaped figure presenting from utilizing tree graph assemblyIn content, obtain corresponding information, to carry out information matches judgement etc. Tree graph assembly can't carry out tool to the structure of tree-shaped figureBody restriction.
As example, tab assembly is mainly by multiple page elements based on HTML basic element are encapsulated and formedAssembly; Utilize tab assembly can realize the displaying of the tab page.
As example, chart assembly is mainly by multiple page elements based on HTML basic element are encapsulated and formedAssembly; Utilize chart assembly can realize the displaying of the figures such as block diagram, cake chart and curve map; Under normal circumstances, figureTable assembly can not be used in Information Inputting Process, but conventionally can be used in information access process; For example,, from utilizing chartIn the content of assembly and the figure that presents, obtain corresponding information, to carry out information matches judgement etc. Chart assembly can't be to figureThe concrete shape of chart shape limits.
Above-mentionedly only schematically listed several assemblies, the present embodiment can arrange corresponding according to the concrete condition of the page completelyAssembly, and the attribute of assembly and method specifically arrange content conventionally can according to utilize the required realization of assembly function comeDetermine the not attribute of limiter assembly and the particular content that method comprises of the present embodiment.
In the present embodiment second set normally encapsulates and shape for the multiple assemblies that often use in each page togetherBecome, the method for the second set can be called by the method for page model. In fact, the second set is also a kind of assembly, andAnd for the first set, the second set is a kind of comparatively large-scale assembly; For ease of distinguishing with the first set, this realityExecuting example can be by the second set also referred to as assembly, but the second set is called to the page. Page model can be by a page orMultiple pages form.
As example, the composition unit of the second set is generally assembly; But second set of the present embodiment can be also pinAssembly and page elements are encapsulated and the page that forms; The composition unit of the second set can be assembly and page unitElement, the method for assembly and the method for page elements all can be called by the second set.
As example, the page elements being packaged in the second set can comprise: at least one page based on HTML basic elementSurface element and/or at least one page elements based on self-defined element base class, particularly, the second set can be passed through oneIndividual or multiple page elements and one or more assemblies based on HTML basic element encapsulate and form, and the second set alsoCan be by one or more page elements and one or more assemblies based on self-defined element base class be encapsulated and shapeBecome, the second set can also for by least one the page elements based on HTML basic element, at least one is based on making by oneselfPage elements and at least one assembly of justice element base class encapsulate and form.
The page elements based on self-defined element base class in the present embodiment, various assembly and the page etc. can be disaggregatedlyBe stored in code packages, carry out user interface automatic test to facilitate.
Embodiment bis-, user interface automated testing method.
Fig. 1 is the flow chart of the user interface automated testing method of the present embodiment, and the method shown in Fig. 1 mainly comprises: stepRapid S100, step S110, step S120 and step 130. The method of recording in the present embodiment runs on Intelligent electric conventionallyIn subset, preferred, the method for recording in the present embodiment can be at desktop computer, mobile computer, panel computerAnd move in the subscriber equipment such as intelligent mobile phone. Below the each step in Fig. 1 is described respectively.
S100, determine the corresponding intended service flow process of tested business.
Concrete, the intended service flow process in the present embodiment can be the general service stream for a certain concrete business function conventionallyJourney, when in tested business being train ticket in the first website ticket booking business, the train ticket ticket booking providing due to different web sitesThe operation flow of business is basic identical, and therefore, the intended service flow process in the present embodiment can be for being applicable to heterogeneous networks instituteThe operation flow of the versatility of the train ticket ticket booking business providing, this intended service flow process goes for the first website providesTrain ticket ticket booking business, also go for the train ticket ticket booking business that the second website and the 3rd website provide.
S110, determine the each self-corresponding page model of the related each user interface of this intended service flow process.
Concrete, the page model of the page model in the present embodiment for recording in above-described embodiment one. The present embodiment canIn the case of not setting in advance the each self-corresponding page model of the related each user interface of this intended service flow process, according to quiltTest service arranges intended service flow process and the related each self-corresponding page mould of each user interface of this intended service flow processType, and store the each self-corresponding page model of the related each user interface of this intended service flow process; The present embodiment also can be in advanceFirst be provided with in the situation of the related each self-corresponding page model of each user interface of this intended service flow process, according to the letter of storageBreath is determined the each self-corresponding page model of the related each user interface of this intended service flow process.
S120, make the instantiation respectively of corresponding page model according to the related each user interface of tested business.
Concrete, due to have identical services function different business the related user interface of operation flow substantially identical (asThe related login page of train ticket ticket booking business all can comprise user name input frame, Password Input frame and login button conventionallyDeng), its difference be generally the position of text difference on setting position difference, the button of button, input frame different andThe prompting text that input frame is corresponding is not equal, and therefore, the present embodiment makes by the each user interface according to tested business accordinglyPage model instantiation respectively, can make the related peculiar content of each user interface of tested business abundant by instantiationEmbody, as in the instantiation process of Page Template, according to a concrete user interface, page model is being carried out initiallyWhen change, carry out assignment by the respective attributes in page model, make the page model after instantiation become this concrete user circleFace. The present embodiment can obtain corresponding value from the document (as java script file) setting in advance, to carry out belonging toThe assign operation of property.
S130, call the page model after corresponding instantiation according to test case, the page model after invoked instantiationComplete corresponding page function by carrying out its method separately, to realize user interface automatic test.
Concrete, ui testing program can be called the method for the page model after instantiation, the page mould after instantiationThe method of type is performed, to realize the function of this page model, as the method for page model in the process of implementation, by calling itThe method of the each assembly comprising or the method for each page make each assembly or the page realize corresponding function, thereby make the pageThe corresponding function of model realization.
A concrete example of the ui testing method of the present embodiment: first, due to the tested industry in the present embodimentBusiness, for air ticket ticket booking business (as the air ticket ticket booking business of ctrip.com), therefore, first takes out the industry of a set of general air ticket ticket bookingBusiness flow process; Then, determine all user interfaces that this operation flow is involved, and determine required for all user interfacesThe page, assembly and the self-defined element base class that use, if set in advance the page, the assembly and self-defined of required useElement base class, this test process does not need to arrange the page, assembly and self-defined element base class, if do not arranged in advanceThe page, assembly and the self-defined element base class of required use can arrange the corresponding page, group in this test processPart and self-defined element base class; Afterwards, utilize the page, assembly and self-defined element base class come for operation flow involvedAll UI Preferences page model, certainly, can directly utilize in advance and establish if set in advance corresponding page modelThe page model of putting; Afterwards, according to increase for tested business (as the air ticket ticket booking business of ctrip.com) product bag (asTake journey bag) so that newly-increased product bag is inherited the set each page model of operation flow for general air ticket ticket booking; SoAfter, the page model in the product bag newly increasing is carried out to instantiation, peculiar with the air ticket ticket booking business for ctrip.com inHold and define, as user name input frame positional information and password in the login page of the air ticket ticket booking business of definition ctrip.comInput frame positional information etc.; Afterwards, use phase according to concrete testing requirement (as the testing requirement that test case embodied)The variable of answering goes to call the page model after corresponding instantiation, as inputted departure place in the page model after to corresponding instantiationAnd the information such as terminus, thereby finally can realize user interface automatic test.
Embodiment tri-, user interface automatic test device.
Fig. 2 is the schematic diagram of the user interface automatic test device of the present embodiment, and the device shown in Fig. 2 mainly comprises: theOne determination module 200, the second determination module 210, instantiation module 220 and test module 230. In the present embodiment, recordDevice conventionally can be arranged in intelligent electronic device, preferred, this device can be arranged at desktop computer, notes typeIn the subscriber equipmenies such as computer, panel computer and intelligent mobile phone. Below the each module in Fig. 2 is described respectively.
The first determination module 200 is mainly suitable for determining the corresponding intended service flow process of tested business.
Concrete, the intended service flow process that the first determination module 200 is determined can be for a certain concrete business merit conventionallyCan general service flow process, when in tested business being train ticket in the first website ticket booking business, because different web sites is carriedThe operation flow of the train ticket ticket booking business of confession is basic identical, therefore, and the intended service stream that the first determination module 200 is determinedJourney can be for being applicable to the operation flow of versatility of the train ticket ticket booking business that heterogeneous networks provides, i.e. this intended serviceFlow process goes for the train ticket ticket booking business that the first website provides, and also goes for the second website and the 3rd website is carriedThe train ticket ticket booking business of confession.
The second determination module 210 is mainly suitable for determining the related each self-corresponding page mould of each user interface of intended service flow processType.
Concrete, the page model of the page model that the second determination module 210 is determined for recording in embodiment mono-. TheTwo determination modules 210 can not set in advance the each self-corresponding page mould of the related each user interface of this intended service flow processIn the situation of type, according to tested business, intended service flow process and the related each user interface of this intended service flow process are setEach self-corresponding page model, and store the each self-corresponding page model of the related each user interface of this intended service flow process; TheTwo determination modules 210 also can set in advance the each self-corresponding page mould of the related each user interface of this intended service flow processIn the situation of type, determine the each self-corresponding page mould of the related each user interface of this intended service flow process according to canned dataType.
Instantiation module 220 is mainly suitable for making the instantiation respectively of corresponding page model according to each user interface of tested business.
Concrete, due to have identical services function different business the related user interface of operation flow substantially identical (asThe related login page of train ticket ticket booking business all can comprise user name input frame, Password Input frame and login button conventionallyDeng), its difference be generally the position of text difference on setting position difference, the button of button, input frame different andThe prompting text that input frame is corresponding is not equal, and therefore, instantiation module 220 makes by the each user interface according to tested businessThe instantiation respectively of corresponding page model, can make the related peculiar content of each user interface of tested business pass through exampleChange and fully demonstrate out, as in the instantiation process of Page Template, instantiation module 220 is according to concrete user circleWhile initialization in the face of page model, carry out assignment by the respective attributes in page model, make the page mould after instantiationType becomes this concrete user interface. Instantiation module 220 can be from the document (as java script file) setting in advanceObtain corresponding value, to carry out the assign operation to attribute.
Test module 230 is mainly suitable for calling the page model after corresponding instantiation according to test case, invoked examplePage model after change completes corresponding page function by carrying out its method separately, to realize user interface automatic test.
Concrete, test module 230 can call the method for the page model after instantiation, makes the page model after instantiationMethod be performed, thereby can realize the function of this page model, as made in the method for test module 230 invoking page modelsThe method of page model in the process of implementation, makes each group by calling the method for its each assembly comprising or the method for each pagePart or the page are realized corresponding function, thereby make page model realize corresponding function.
The above is only preferred embodiment of the present invention, not the present invention is done to any pro forma restriction, although thisInvention discloses as above with preferred embodiment, but foregoing description is not in order to limit the present invention, is anyly familiar with this professional skillArt personnel are departing from the scope of technical solution of the present invention, when can utilize the technology contents of above-mentioned announcement make a little change orBeing modified to the equivalent embodiment of equivalent variations, is the content that does not depart from technical solution of the present invention in every case, real according to technology of the present inventionAny simple modification, equivalent variations and modification that the above embodiment that verifies does, all still belong in the scope of technical solution of the present invention.

Claims (10)

  1. For user interface automatic test based on an OO page model, it is characterized in that the described pageModel is provided with attribute and method, and described page model comprises: be provided with the first set of attribute and method and/or arrangeThere is the second set of attribute and method;
    Described the first set is by multiple page elements are encapsulated and formed, and the method for described the first set is for the pageThe method call of the method for model or the second set;
    Each page elements being packaged in the first set is provided with attribute and method, and the side of each page elementsMethod is all for the first method call of gathering;
    Described the second set is by encapsulating and form at least one first set, and the method for described the second set suppliesThe method call of page model;
    Described page model is for being instantiated at it, and when called, the page model being instantiated is by carrying out its methodComplete corresponding page function, to realize user interface automatic test.
  2. 2. page model as claimed in claim 1, is characterized in that, the page elements being packaged in the first set comprises:At least one page elements and/or at least one page elements based on self-defined element base class based on HTML basic element.
  3. 3. page model as claimed in claim 2, is characterized in that, the described page elements based on self-defined element base classComprise: the button element based on button element base class and/or the data input element based on data input element base class.
  4. 4. page model as claimed in claim 3, is characterized in that, the described data based on data input element base class are defeatedEntering element comprises: one group of page elements based on HTML basic element.
  5. 5. page model as claimed in claim 3, is characterized in that, the described data based on data input element base class are defeatedEnter in attribute of an element and be provided with: for representing that the prompting text element of this data input element is this data input element of markInformation.
  6. 6. page model as claimed in claim 3, is characterized in that, described the first set is specially:
    Undertaken by the button element to based on button element base class and the data input element based on data input element base classThe data input area assembly encapsulating and form; Or
    By the page elements based on HTML basic element being encapsulated to the form component forming; Or
    Seal by the page elements to based on HTML basic element and the data input element based on data input element base classThe form component filling and form; Or
    By multiple page elements based on HTML basic element being encapsulated to the tree graph assembly forming; Or
    By multiple page elements based on HTML basic element being encapsulated to the tab assembly forming; Or
    By multiple page elements based on HTML basic element being encapsulated to the chart assembly forming.
  7. 7. a user interface automated testing method, is characterized in that, described method comprises the steps:
    Determine the corresponding intended service flow process of tested business;
    Determine the each self-corresponding page model of the related each user interface of described intended service flow process, wherein, described page mouldType is the page model described in arbitrary claim in claim 1-6;
    Make the instantiation respectively of corresponding page model according to each user interface of tested business;
    Call the page model after corresponding instantiation according to test case, the page model after invoked instantiation is by holdingIts method separately of row completes corresponding page function, to realize user interface automatic test.
  8. 8. method as claimed in claim 7, is characterized in that, described intended service flow process is: for tested business withAnd there are other business of business function of tested business and the general service flow process that arranges.
  9. 9. a user interface automatic test device, is characterized in that, described device comprises:
    The first determination module, is suitable for determining the corresponding intended service flow process of tested business;
    The second determination module, is suitable for determining the related each self-corresponding page model of each user interface of described intended service flow process,Wherein, described page model is the page model described in arbitrary claim in claim 1-6;
    Instantiation module, is suitable for making the instantiation respectively of corresponding page model according to each user interface of tested business;
    Test module, is suitable for calling the page model after corresponding instantiation according to test case, after invoked instantiationPage model completes corresponding page function by carrying out its method separately, to realize user interface automatic test.
  10. 10. device as claimed in claim 9, is characterized in that, described intended service flow process is: for tested businessAnd there are other business of business function of tested business and the general service flow process that arranges.
CN201511001546.XA 2015-12-28 2015-12-28 Page model, user interface automated testing method and device Active CN105608007B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511001546.XA CN105608007B (en) 2015-12-28 2015-12-28 Page model, user interface automated testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511001546.XA CN105608007B (en) 2015-12-28 2015-12-28 Page model, user interface automated testing method and device

Publications (2)

Publication Number Publication Date
CN105608007A true CN105608007A (en) 2016-05-25
CN105608007B CN105608007B (en) 2018-04-13

Family

ID=55987959

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511001546.XA Active CN105608007B (en) 2015-12-28 2015-12-28 Page model, user interface automated testing method and device

Country Status (1)

Country Link
CN (1) CN105608007B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066240A (en) * 2016-10-08 2017-08-18 阿里巴巴集团控股有限公司 The implementation method and device of assembly function
CN107153614A (en) * 2017-05-12 2017-09-12 郑州云海信息技术有限公司 A kind of automatic test page navigation method for organizing
CN108153551A (en) * 2017-12-11 2018-06-12 中国民生银行股份有限公司 A kind of operation flow page shows method and apparatus
CN109792452A (en) * 2016-11-04 2019-05-21 谷歌有限责任公司 The adaptive user interface of payload with reduction
WO2019210614A1 (en) * 2018-05-04 2019-11-07 平安科技(深圳)有限公司 Method and apparatus for implementing page function reuse
CN110618941A (en) * 2019-09-19 2019-12-27 中国银行股份有限公司 Interface element processing method and device
CN110737597A (en) * 2019-10-15 2020-01-31 北京弘远博学科技有限公司 UI layer automatic testing method based on education training platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186455A (en) * 2011-12-28 2013-07-03 阿里巴巴集团控股有限公司 Method and system for generating automatic test script on page
CN103377127A (en) * 2012-04-28 2013-10-30 阿里巴巴集团控股有限公司 Development testing system, testing method and device for webpage product
CN103631719A (en) * 2013-12-12 2014-03-12 用友软件股份有限公司 Web automated testing method and device
CN103678120A (en) * 2013-11-12 2014-03-26 北京京东尚科信息技术有限公司 Automatic web-application testing method based on modeling
US20150186249A1 (en) * 2007-06-05 2015-07-02 Edward F. Miller Testing web pages using a document object model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150186249A1 (en) * 2007-06-05 2015-07-02 Edward F. Miller Testing web pages using a document object model
CN103186455A (en) * 2011-12-28 2013-07-03 阿里巴巴集团控股有限公司 Method and system for generating automatic test script on page
CN103377127A (en) * 2012-04-28 2013-10-30 阿里巴巴集团控股有限公司 Development testing system, testing method and device for webpage product
CN103678120A (en) * 2013-11-12 2014-03-26 北京京东尚科信息技术有限公司 Automatic web-application testing method based on modeling
CN103631719A (en) * 2013-12-12 2014-03-12 用友软件股份有限公司 Web automated testing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
边芮: "基于SSL_Robot的Https页面自动化测试研究", 《计算机时代》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066240A (en) * 2016-10-08 2017-08-18 阿里巴巴集团控股有限公司 The implementation method and device of assembly function
CN109792452A (en) * 2016-11-04 2019-05-21 谷歌有限责任公司 The adaptive user interface of payload with reduction
CN109792452B (en) * 2016-11-04 2021-10-15 谷歌有限责任公司 Method and system for transmitting data packets over a network to provide an adaptive user interface
CN107153614A (en) * 2017-05-12 2017-09-12 郑州云海信息技术有限公司 A kind of automatic test page navigation method for organizing
CN108153551A (en) * 2017-12-11 2018-06-12 中国民生银行股份有限公司 A kind of operation flow page shows method and apparatus
WO2019210614A1 (en) * 2018-05-04 2019-11-07 平安科技(深圳)有限公司 Method and apparatus for implementing page function reuse
CN110618941A (en) * 2019-09-19 2019-12-27 中国银行股份有限公司 Interface element processing method and device
CN110618941B (en) * 2019-09-19 2023-01-20 中国银行股份有限公司 Interface element processing method and device
CN110737597A (en) * 2019-10-15 2020-01-31 北京弘远博学科技有限公司 UI layer automatic testing method based on education training platform

Also Published As

Publication number Publication date
CN105608007B (en) 2018-04-13

Similar Documents

Publication Publication Date Title
CN105608007A (en) Page model as well as user interface automated test method and device
CN103019684B (en) A kind of method of the configuration service page based on dynamic template
CN105700888B (en) A kind of visualization quick development platform based on jbpm workflow engine
CN106598591A (en) Webpage dynamic menu generation method and device
CN107659624A (en) A kind of isomery cloud management system and method suitable for cloud computing
CN109358851A (en) Creation method, device and the computer readable storage medium of chart components
CN107122301A (en) Interface detection method and device
CN103164114A (en) Method and device of classifying icons of terminal operation interface
CN103677789A (en) Table data displaying method and system based on GRID assembly
CN109445783A (en) By the construction method and device of the dynamic configuration application of service driving
CN106897216A (en) The method and apparatus of test software
CN113703749A (en) Information system based on visual programming technology and construction method thereof
US10949331B1 (en) Integration testing of web applications utilizing dynamically generated automation identifiers
US20170169474A1 (en) Internet-based display material system and internet-based display material producing method
CN109697266A (en) Page rendering system, page rendering method and page rendering device
CN106919406A (en) A kind of desktop application component issue, update method and device
CN107894887A (en) Page assembly method, apparatus and computer-readable recording medium
CN106326604B (en) A kind of finite element analysis method of servicing based on cloud manufacturing platform
CN108134812A (en) Data processing method and device
CN107491307A (en) Information providing method, device, electronic equipment and computer-readable recording medium
CN109657427A (en) The method and device of permission control
CN107852422A (en) Connected from the server interface with different API to obtain ad data
CN112926008B (en) Method, device, electronic equipment and storage medium for generating form page
CN114155921A (en) Configuration method and device of medical form, computer equipment and storage medium
CN110109684A (en) Block chain node administration agent services installation method, electronic device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100195 Haidian District, Beijing, North Village, a road, a static core Park, block N

Applicant after: Beijing Zhiyuan Internet software Limited by Share Ltd

Address before: 100195 Haidian District, Beijing, North Village, a road, a static core Park, block N

Applicant before: Beijing Seeyon Software Co., Ltd.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant