CN107577607A - User interface automated testing method, device, electronic equipment, storage medium - Google Patents

User interface automated testing method, device, electronic equipment, storage medium Download PDF

Info

Publication number
CN107577607A
CN107577607A CN201710801790.7A CN201710801790A CN107577607A CN 107577607 A CN107577607 A CN 107577607A CN 201710801790 A CN201710801790 A CN 201710801790A CN 107577607 A CN107577607 A CN 107577607A
Authority
CN
China
Prior art keywords
page
case
value
user interface
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710801790.7A
Other languages
Chinese (zh)
Other versions
CN107577607B (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.)
Ctrip Travel Information Technology Shanghai Co Ltd
Original Assignee
Ctrip Travel Information Technology Shanghai 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 Ctrip Travel Information Technology Shanghai Co Ltd filed Critical Ctrip Travel Information Technology Shanghai Co Ltd
Priority to CN201710801790.7A priority Critical patent/CN107577607B/en
Publication of CN107577607A publication Critical patent/CN107577607A/en
Application granted granted Critical
Publication of CN107577607B publication Critical patent/CN107577607B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention provides a kind of user interface automated testing method, device, electronic equipment, storage medium, including:Receive the use-case file and element files for writing use-case;D ynamic instantiation each element so that instantiation use-case, wherein, to each element:The object of element term is loaded with from a widget library according to element term;Method with element method title is called from widget library according to element method title;Platform environment data are obtained according to the platform of operation element;Drive test system perform instantiation use-case, wherein, in operation element the page on search whether the element be present;If in the presence of the element, the method for driving test system execution element;If the element is not present, using predetermined amount of time as interval, search whether the element be present again, when exceeding scheduled time threshold value from first search to the time interval of current time, then error is tested in prompting.Method and device provided by the invention accelerates the efficiency of UI automatic tests.

Description

User interface automated testing method, device, electronic equipment, storage medium
Technical field
The present invention relates to Computer Applied Technology field, more particularly to a kind of user interface automated testing method, device, Electronic equipment, storage medium.
Background technology
Ui testing (User interface testing, UI test) is used for the functional module for testing user interface Layout it is whether reasonable, whether whole style consistent and whether the placement location of each control meets client's use habit, heavier That wants is to fit to simple operation, and navigation is easily understood, and whether word is correct in interface, and whether name unifies, and whether the page is beautiful See, word, picture combination whether perfection etc..
Existing UI tests generally carry out UI operations by artificial mode on the page, in order to accelerate the speed of UI tests Degree, the mode automated carry out UI tests.
However, existing UI automatic tests require that tester needs certain code base and surveyed so that UI to be automated Example on probation carries out written in code, and different types of automation needs to manage the different code of more sets, its workload still compared with Greatly, it can not realize that the popularization of UI automatic tests and efficiency further increase.
The content of the invention
The defects of present invention is in order to overcome above-mentioned prior art to exist, there is provided a kind of user interface automated testing method, Device, electronic equipment, storage medium, to accelerate user interface automatic test efficiency.
According to an aspect of the present invention, there is provided a kind of user interface automated testing method, including:Receive one and write use The use-case file and element files of example, the use-case file comprise at least the element terms of multiple elements, element method title and Element value, the element files comprise at least the use-case file in multiple elements static defining, the use-case file and/ Or the element files also include the platform of operation element and the Page Name of operation element;Each element of D ynamic instantiation with Make the instantiation use-case, wherein, to each element:The element is loaded with from a widget library according to the element term The object of title;Method with the element method title is called from the widget library according to the element method title;Root Platform environment data are obtained according to the platform of the operation element;Test system is driven to perform the use-case of instantiation, wherein, in operation Search whether the element be present on the page of the element;If running and the element on the page of the element be present, driving is surveyed The method that test system performs the element;The element is not present on the page of the element if running, using predetermined amount of time as Interval, again in searching whether the element be present on the page for running the element, when from when searching for the first time to current time Between interval exceed scheduled time threshold value, then prompting test malfunction.
Alternatively, driving test system to perform the use-case of instantiation also includes:Assertion verification is performed, obtains and stores one Or multiple the elements desired value, the after tested actual value for one or more elements that system performs and the desired value that perform with The comparative result of the actual value.
Alternatively, for expected one or more of elements, system performs after operation element the desired value after tested The content shown on the page or next page;The actual value is that system performs after operation member one or more elements after tested The content shown on the page or next page of element, wherein, the actual value is in the position shown on the page and the desired value It is identical in the position shown on the page.
Alternatively, in the element files, different use-cases share the static defining of element.
Alternatively, the element value in the use-case file includes the element value of corresponding different test-types, corresponding different surveys The test system for trying type loads same test script.
Alternatively, the test-types include:Test environment is checked and accepted, pre-manufactured environmental acceptance and production environment are checked and accepted.
Alternatively, the use-case file is Excel forms or DB formatted files.
Alternatively, the static defining includes:Element type, element search item, element searches the value of item, including element institute Join one or more in framework, element description.
According to another aspect of the invention, a kind of user interface automatic test device is also provided, including:Data reception Block, for receiving the use-case file and element files for writing use-case, the use-case file comprises at least the element of multiple elements Title, element method title and element value, the element files comprise at least the static state of multiple elements in the use-case file Definition, the use-case file and/or the element files also include the platform of operation element and the Page Name of operation element;Member Plain parsing module, for each element of D ynamic instantiation so as to instantiate the use-case, wherein, to each element:According to The element term is loaded with the object of the element term from a widget library;According to the element method title from the control Call the method with the element method title in part storehouse;Platform environment data are obtained according to the platform of the operation element;Drive Dynamic model block, for driving test system to perform the use-case of instantiation, wherein, search whether to deposit on the page for running the element In the element;If running and the element on the page of the element be present, the method for the driving test system execution element;If Run and the element is not present on the page of the element, then using predetermined amount of time as interval, again in the page for running the element Search whether the element be present on face, when exceeding scheduled time threshold value from first search to the time interval of current time, then carry Show test error;Widget library, the widget library store encoded multiple elements and element method.
Alternatively, the element parsing module and the test system are write using different coded systems, utilize Maven Element parsing module described in item objects model-driven is so that the mutual calling of the element parsing module and the test system.
Alternatively, in addition to:Module is asserted, for performing assertion verification, obtains the expection that one or more elements perform The comparison knot of the actual value and the desired value and the actual value of one or more elements that value, after tested system perform Fruit;Daily record storage module, for storing the desired value of the one or more elements execution asserted module and obtained, being after tested The actual value of the one or more elements performed of uniting and the comparative result of the desired value and the actual value.
According to another aspect of the invention, a kind of electronic equipment is also provided, the electronic equipment includes:Processor;Storage Medium, is stored thereon with computer program, and the computer program performs step as described above when being run by the processor.
According to another aspect of the invention, a kind of storage medium is also provided, computer journey is stored with the storage medium Sequence, the computer program perform step as described above when being run by processor.
Compared with prior art, advantage of the invention is that:
1) tester only needs to provide the use-case file and element files of configurationization, and in use-case file and element files Item without tester there is code base can complete, and be realized by widget library D ynamic instantiation element with performing use-case automatically UI automatic tests;
2) in the case where element loading is relatively slow, by usually judging whether to perform the element with the presence or absence of this yuan on the page Method, when the element is not present in the page, at preset time intervals after search whether there is element on the page again, and set Scheduled time threshold value ought reach the scheduled time threshold value page and element yet not be present, then prompting error, thus, prevents test errors Judge by accident and accelerate the efficiency of test;
3) by assertion verification, obtain and store desired value, actual value and its comparative result of use-case execution, pass through these Data can subsequently self-defined test report, and for follow-up with reference to checking use;
4) element is shared in different test cases by element files, improves the reusability of element;
5) element value of different test-types is provided in use-case file, same pin can be loaded in different test systems This is tested, and realizes that script is shared;
6) element parsing module described in Maven item objects model-drivens is utilized so that the element parsing module and described The mutual calling of test system, realize the calling transboundary between different language.
Brief description of the drawings
Its example embodiment is described in detail by referring to accompanying drawing, above and other feature and advantage of the invention will become It is more obvious.
Fig. 1 shows the schematic diagram of user interface automatic test device according to embodiments of the present invention.
Fig. 2 and Fig. 3 shows the schematic diagram of use-case file according to embodiments of the present invention.
Fig. 4 shows the schematic diagram of element files according to embodiments of the present invention.
Fig. 5 shows the schematic diagram of login page according to embodiments of the present invention.
Fig. 6 shows the flow chart of user interface automated testing method according to embodiments of the present invention.
Fig. 7 schematically shows a kind of computer-readable recording medium schematic diagram in disclosure exemplary embodiment.
Fig. 8 schematically shows a kind of electronic equipment schematic diagram in disclosure exemplary embodiment.
Embodiment
Example embodiment is described more fully with referring now to accompanying drawing.However, example embodiment can be with a variety of shapes Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, these embodiments are provided so that the disclosure will more Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.Described feature, knot Structure or characteristic can be incorporated in one or more embodiments in any suitable manner.
In addition, accompanying drawing is only the schematic illustrations of the disclosure, it is not necessarily drawn to scale.Identical accompanying drawing mark in figure Note represents same or similar part, thus will omit repetition thereof.Some block diagrams shown in accompanying drawing are work( Can entity, not necessarily must be corresponding with physically or logically independent entity.These work(can be realized using software form Energy entity, or these functional entitys are realized in one or more hardware modules or integrated circuit, or at heterogeneous networks and/or place These functional entitys are realized in reason device device and/or microcontroller device.
In order to solve the defects of prior art, accelerate user interface automatic test efficiency, the present invention provides a kind of user Interface automation method of testing, device, electronic equipment, storage medium.
Referring first to Fig. 1, Fig. 1 shows the signal of user interface automatic test device according to embodiments of the present invention Figure.
User interface automatic test device 100 includes data reception module 102, element parsing module 103, widget library 104 and drive module 105.
Data reception module 102 is used to receive the one of the transmission of the called side 101 use-case file and element files for writing use-case. Use-case file comprises at least element term, element method title and the element value of multiple elements.The element files comprise at least The static defining of multiple elements in the use-case file.The use-case file and/or the element files also include operation member The platform of element and the Page Name of operation element.
Use-case file can be the Excel forms of configurationization or the file of DB forms.Data reception module 102 can be right The file of Excel forms or DB forms is handled, and the data handled well are supplied into element parsing module 103.Use example text The content of part may refer to Fig. 2.In embodiment as shown in Figure 2, use-case file includes 9 elements and runs the flat of each element Platform (Platform), run the Page Name (PageName) of each element, element term (PageElement), method And element value (Value) (Action).The platform of each element of operation set in use-case file can be in subsequent instance process In, the page data for element parsing module from system bottom acquisition different platform.Platform said herein can include Online (PC ends), the H5 pages or APP.Different platform browsers needs different data when forming the page.Simultaneously as different is flat Platform can use the use-case file of same format so that user interface automatic test device 100 is that each platform is general, reduces item Purpose management cost.
Further, Fig. 3 shows the use-case file of another embodiment of the present invention.In the embodiment shown in fig. 3, example text is used Element value in part includes the element value (as shown in black surround) of corresponding different test-types, the test system of corresponding different test-types System loads same test script.Specifically, due to may require that different element values in different test-types, for example, it is different The login account (element value) inputted in test-types is different;In another example chained address (the member linked in different test-types Element value) it is also different, in this case, come in the different test script of prior art generally use according to different element values Tested in different test-types, tester and test system workload greatly increase.Reality shown in Fig. 3 of the present invention Apply the different element values for being illustrated and identity element being corresponded in use-case file:ValueFat (test environments in FAT Under element value);ValueUat (element value in CAT under pre-manufactured environment);ValuePro (survey by user acceptance Element value in examination under production environment), by setting the different element values of different test-types can be rear in use-case file It is continuous to be tested using same script in different test environments, realize that data detach and shared with script.
Element files can be XML format file.The content of element files may refer to Fig. 4 (Fig. 4 element files and figure 2nd, Fig. 3 use-case file and non-corresponding, alternatively, the number of elements in element files are more than the number of elements in use-case file). Element files can also be referred to as element shared pool, and the mould of element files can be set or voluntarily provided by system by called side 101 Plate.In embodiment as shown in Figure 4, element files include the platform of 6 elements and each element of operation, run each element Page Name, element term, element type, element search value, inline frame (iFrame) and the description of item, element lookup item. It is the setting in development process to element that element, which searches item, the value of element lookup item and inline frame (iFrame), in element files These contents are set to accelerate the speed of lookup and acquisition of element.The platform of each element of operation set in element files During subsequent instance, the page data of different platform can be obtained from system bottom for element parsing module.Alternatively, exist In some embodiments, a file sets the platform of operation element and the title of the operation page in use-case file and element files. In certain embodiments, there are 10 elements in element files, such as above login page, there are 5 above enrollment page Element;So there will be two groups inside element files:Login and enrollment page;One shares 15 elements;These elements can To be shared in different test cases, the reusability of the element greatly improved.Simultaneously when page elements have carried out change Afterwards, the definition of element need to be only changed inside element files, without carrying out any change to the use-case for quoting the element, greatly The big maintenance cost for reducing UI automations.
Element parsing module 103 is used for each element of D ynamic instantiation so as to instantiate the use-case.Wherein, to each institute State element:The object of the element term is loaded with from a widget library according to the element term;According to the element method Title calls the method with the element method title from the widget library;Platform is obtained according to the platform of the operation element Environmental data.
Specifically, in element parsing module 103, for any one class, all category of this class can be known Property and method;For any one object, its any means and attribute can be called with realize dynamic access information and Dynamic call object.
Below with two specific embodiments, the data acquisition and method of calling of description element parsing module 103.
Example one:Call the method stated without ginseng, such as click () method below Button classes.
Button type definitions (being stored in widget library) are as follows first:
Element parsing module 103 is realized by following code and called:
String className=" UIElement. "+bean.getType ();//bean objects are next to be transmitted through above Treated DB data acquisition systems, the name for Class that getType here takes, example middle finger Button
Demo=Class.forName (className);
Method method=demo.getMethod (bean.getAction ());//getAction is the name of method Word, example middle finger click
method.invoke(demo.getConstructor(String.class,String.class, Finder.class, String.class, WebDriver.class) // the part for instantiation Button building method
.newInstance(bean.getiFrame(),bean.getPlatform(),
Finder.valueOf(bean.getFinder()),bean.getFinderValue(),driver));// logical Reflection is crossed, calls click methods
By above-mentioned code, required Class and Method come into as dynamic state of parameters, thus can be with Operationally it is compiled and runs;The Class and Method of same type are directed to, what this section of code can call arrives.
Example two:The method containing a parameter of calling, such as:SetValue (String below TextField classes Value) method, this method receive the parameter value of a String type
Element parsing module 103 is realized by following code and called:
String className=" UIElement. "+bean.getType ();//getType take for Class Name, example middle finger TextField
Demo=Class.forName (className);
Method method=demo.getMethod (bean.getAction (), String.class);//
String.class be needed for enter ginseng parameter type, this is defined herein as String
method.invoke(demo.getConstructor(String.class,String.class, Finder.class,String.class,WebDriver.class)
.newInstance(bean.getiFrame(),bean.getPlatform(),
Finder.valueOf(bean.getFinder()),bean.getFinderValue(),driver),
bean.getValue());// setValue methods are called, and by true in bean.getValue acquisition business It is transmitted through the value come
The method for calling multiple parameters is similar with example two.Because element type is numerous above user interface, so can define Wide variety of different types of Class, required class and method are operationally so called by the can of element parsing module 103, Business personnel only need to define element in front end page by certain rule, without contacting code, pass through the element parsing module 103 It can be translated and be performed, even if below because the needs of business, need to add new element type, element parsing module 103 Also can be parsed completely.
Drive module 104 is used for the use-case for driving test system to perform instantiation.Wherein, in the page for running the element On search whether the element be present;If running and the element on the page of the element be present, described in driving test system execution The method of element;The element is not present on the page of the element if running, using predetermined amount of time as interval, again in operation Search whether the element be present on the page of the element, searched when from first to the time interval of current time more than pre- timing Between threshold value, then prompting test error.
For example, may refer to Fig. 5, Fig. 5 shows a part for login page, and label 201 is element T extField, label 202 be element B utton, and label 203 is element URL.When use-case file includes these elements, pass through element parsing module 103 Parsing and drive module 104 drive load on login page.Click methods are called after Button202 is loaded When, searching whether to have shown that Button202 (in browser source code can be looked into by the step of lookup in login page first Look for matching), if Button202 has not yet been displayed in login page, then it represents that Button202 does not load completion also, can be with 1 second or 2 seconds For predetermined time interval, Button202 is searched in login page again, if finding Button202 in login page, is continued Call click methods.Start to exceed predetermined threshold (example to current time if confessing one's crime and finding Button202 inferior to login page Such as 1 minute, 2 minutes or 3 minutes), then directly prompt test crash.Thus, in compared with prior art, after calling Button202 Click methods are directly invoked, reduces and directly misses the probability of prompting error because can not find element (loading does not complete also), enhancing The stability of script, while increase testing efficiency.
Widget library, the widget library store encoded multiple elements and element method.
Specifically, the bottom frame that UI testing tools are quoted is typically all WebDriver, and for WebDriver, All elements are all WebElement on the page, but for a user, so it is inconvenient understanding, so right WebElement has carried out secondary encapsulation, has encapsulated conventional element type:Such as input frame, button, combobox, and Referred to as widget library, each different element have oneself unique operating method.Such as Button types are determined in above-mentioned example 1 Justice is stored in widget library
In the embodiment shown in fig. 1, automatic test device 100 also includes daily record memory module 106 and asserts module 107。
Assert that module 107 is used to perform assertion verification, obtain desired value that one or more elements perform, after tested system The actual value and the desired value of one or more elements of execution and the comparative result of the actual value.The desired value is It is expected that system performs after the content shown on the page of operation element one or more of elements after tested.The actual value For one or more elements, system is performed after the content shown on the page of operation element after tested.The actual value is in operation The position shown on the page of element is identical in the position shown on the page of operation element with the desired value.Specifically, Such as in Fig. 5 login page, enter next page if click methods are called to button202, it is contemplated that value may be configured as " cancellation ", and in actual motion, call click methods then to enter after next page to button202 and be shown as " publishing " (" note Pin " and " publishing " be located at the same position of the page), then assert the acquisition desired value of module 107 " cancellation ", actual value " publishing " and in advance The Boolean comparison result of time value and actual value.
Daily record storage module 106 be used to storing the desired value that the one or more elements for asserting that module obtains perform, The comparative result of the actual value for one or more elements that system performs and the desired value and the actual value after tested.By This, access side 101 can show test result with a self-defined front end page, and the type of test report can also be by access side 101 random changes, fully achieve liberalization.
Alternatively, in the above-described embodiments, element parsing module 103 and test system 108 use different coded systems Write.For example, element parsing module 103 is encoded using Java, test system 108 is encoded using .net.The present invention utilizes Maven Element parsing module 103 described in item objects model-driven is so that element parsing module 103 and the mutual tune of test system 108 With realizing the calling transboundary between different language.
Fig. 1 is only to schematically show modules, it will be understood that the software module or reality that these modules can be virtual The hardware module on border, merging, fractionation and its increase of complementary modul block of these modules are all within protection scope of the present invention.
Referring to Fig. 6, Fig. 6 shows the flow of user interface automated testing method according to embodiments of the present invention Figure.
Fig. 6 shows 3 steps altogether:
Step S310:Receive the use-case file and element files for writing use-case.
The use-case file comprises at least element term, element method title and the element value of multiple elements.The use-case File can be Excel forms or DB formatted files.The element files comprise at least multiple members in the use-case file The static defining of element.In the element files, different use-cases can share the static defining of element.Static defining can include member It is one or more in inline frame, element description where plain type, element search item, element searches the value of item, element.It is described Use-case file and/or the element files also include the platform of operation element and the Page Name of operation element.
Step S320:Each element of D ynamic instantiation is so as to instantiate the use-case.Wherein, each element is performed Step S321 to step S323:
Step S321:The object of the element term is loaded with from a widget library according to the element term.
Step S322:Side with the element method title is called from the widget library according to the element method title Method.
Step S323:Platform environment data are obtained according to the platform of the operation element.
Step S330:Test system is driven to perform the use-case of instantiation.Step S330 includes following sub-step:
Step S331, in searching whether the element be present on the page for running the element.
The method that step S335 driving test systems perform the element is performed if step S331 judges to have the element.
Perform step S332 if step S331 judges the element is not present, judge from find for the first time current time when Between be spaced whether exceed scheduled time threshold value.
If step S332 judges, not less than time threshold, to perform step S333, performed again after being spaced predetermined amount of time Step S331.
If step S332 judges to exceed time threshold, step S334 is performed, prompts test error.
In some change case of the present invention, also include performing assertion verification in above-mentioned steps S330.Assertion verification can Obtain and store desired value that one or more elements perform, after tested one or more elements that system performs actual value with And the comparative result of the desired value and the actual value.
Specifically, for expected one or more of elements, system performs after operation element the desired value after tested The page on the content that shows;The actual value is that system performs the page after operation element to one or more elements after tested The content of upper display, wherein, the actual value is in the position shown on the page of operation element with the desired value in operation member The position shown on the page of element is identical.
In an exemplary embodiment of the disclosure, a kind of computer-readable recording medium is additionally provided, is stored thereon with meter Calculation machine program, it can realize that electronic prescription described in any one above-mentioned embodiment circulates when the program is by such as computing device The step of processing method.In some possible embodiments, various aspects of the invention are also implemented as a kind of program production The form of product, it includes program code, and when described program product is run on the terminal device, described program code is used to make institute State terminal device perform described in this specification above-mentioned electronic prescription circulation processing method part according to the various examples of the present invention The step of property embodiment.
With reference to shown in figure 7, the program product for being used to realize the above method according to the embodiment of the present invention is described 300, it can use portable compact disc read only memory (CD-ROM) and including program code, and can in terminal device, Such as run on PC.However, the program product not limited to this of the present invention, in this document, readable storage medium storing program for executing can be with Be it is any include or the tangible medium of storage program, the program can be commanded execution system, device either device use or It is in connection.
Described program product can use any combination of one or more computer-readable recording mediums.Computer-readable recording medium can be readable letter Number medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example can be but be not limited to electricity, magnetic, optical, electromagnetic, infrared ray or System, device or the device of semiconductor, or any combination above.The more specifically example of readable storage medium storing program for executing is (non exhaustive List) include:It is electrical connection, portable disc, hard disk, random access memory (RAM) with one or more wires, read-only Memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read only memory (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
The computer-readable recording medium can include believing in a base band or as the data that a carrier wave part is propagated Number, wherein carrying readable program code.The data-signal of this propagation can take various forms, including but not limited to electromagnetism Signal, optical signal or above-mentioned any appropriate combination.Readable storage medium storing program for executing can also be any beyond readable storage medium storing program for executing Computer-readable recording medium, the computer-readable recording medium can send, propagate either transmit for being used by instruction execution system, device or device or Person's program in connection.The program code included on readable storage medium storing program for executing can be transmitted with any appropriate medium, bag Include but be not limited to wireless, wired, optical cable, RF etc., or above-mentioned any appropriate combination.
Can being combined to write the program operated for performing the present invention with one or more programming languages Code, described program design language include object oriented program language-Java, C++ etc., include routine Procedural programming language-such as " C " language or similar programming language.Program code can be fully in tenant Perform on computing device, partly performed in tenant's equipment, the software kit independent as one performs, is partly calculated in tenant Its upper side point is performed or performed completely in remote computing device or server on a remote computing.It is remote being related to In the situation of journey computing device, remote computing device can pass through the network of any kind, including LAN (LAN) or wide area network (WAN) tenant's computing device, is connected to, or, it may be connected to external computing device (such as utilize ISP To pass through Internet connection).
In an exemplary embodiment of the disclosure, a kind of electronic equipment is also provided, the electronic equipment can include processor, And the memory of the executable instruction for storing the processor.Wherein, the processor is configured to via described in execution The step of executable instruction is to perform the circulation processing method of electronic prescription described in any one above-mentioned embodiment.
Person of ordinary skill in the field it is understood that various aspects of the invention can be implemented as system, method or Program product.Therefore, various aspects of the invention can be implemented as following form, i.e.,:It is complete hardware embodiment, complete The embodiment combined in terms of full Software Implementation (including firmware, microcode etc.), or hardware and software, can unite here Referred to as " circuit ", " module " or " system ".
The electronic equipment 600 according to the embodiment of the invention is described referring to Fig. 8.The electronics that Fig. 8 is shown Equipment 600 is only an example, should not bring any restrictions to the function and use range of the embodiment of the present invention.
As shown in figure 8, electronic equipment 600 is showed in the form of universal computing device.The component of electronic equipment 600 can wrap Include but be not limited to:At least one processing unit 610, at least one memory cell 620, (including the storage of connection different system component Unit 620 and processing unit 610) bus 630, display unit 640 etc..
Wherein, the memory cell is had program stored therein code, and described program code can be held by the processing unit 610 OK so that the processing unit 610 perform described in the above-mentioned electronic prescription circulation processing method part of this specification according to this The step of inventing various illustrative embodiments.For example, the step of processing unit 610 can perform as shown in Figure 6.
The memory cell 620 can include the computer-readable recording medium of volatile memory cell form, such as random access memory Unit (RAM) 6201 and/or cache memory unit 6202, it can further include read-only memory unit (ROM) 6203.
The memory cell 620 can also include program/practical work with one group of (at least one) program module 6205 Tool 6204, such program module 6205 includes but is not limited to:Operating system, one or more application program, other programs Module and routine data, the realization of network environment may be included in each or certain combination in these examples.
Bus 630 can be to represent the one or more in a few class bus structures, including memory cell bus or storage Cell controller, peripheral bus, graphics acceleration port, processing unit use any bus structures in a variety of bus structures Local bus.
Electronic equipment 600 can also be with one or more external equipments 700 (such as keyboard, sensing equipment, bluetooth equipment Deng) communication, the equipment communication that can also enable tenant to be interacted with the electronic equipment 600 with one or more, and/or with causing Any equipment that the electronic equipment 600 can be communicated with one or more of the other computing device (such as router, modulation /demodulation Device etc.) communication.This communication can be carried out by input/output (I/O) interface 650.Also, electronic equipment 600 can be with By network adapter 660 and one or more network (such as LAN (LAN), wide area network (WAN) and/or public network, Such as internet) communication.Network adapter 660 can be communicated by bus 630 with other modules of electronic equipment 600.Should Understand, although not shown in the drawings, can combine electronic equipment 600 uses other hardware and/or software module, including it is but unlimited In:Microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive and number According to backup storage system etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented Mode can be realized by software, can also be realized by way of software combines necessary hardware.Therefore, according to the disclosure The technical scheme of embodiment can be embodied in the form of software product, the software product can be stored in one it is non-volatile Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are to cause a calculating Equipment (can be personal computer, server or network equipment etc.) performs the above-mentioned electronics according to disclosure embodiment Prescription circulation processing method.
Compared with prior art, advantage of the invention is that:
1) tester only needs to provide the use-case file and element files of configurationization, and in use-case file and element files Item without tester there is code base can complete, and be realized by widget library D ynamic instantiation element with performing use-case automatically UI automatic tests;
2) in the case where element loading is relatively slow, by usually judging whether to perform the element with the presence or absence of this yuan on the page Method, when the element is not present in the page, at preset time intervals after search whether there is element on the page again, and set Scheduled time threshold value ought reach the scheduled time threshold value page and element yet not be present, then prompting error, thus, prevents test errors Judge by accident and accelerate the efficiency of test;
3) by assertion verification, obtain and store desired value, actual value and its comparative result of use-case execution, pass through these Data can subsequently self-defined test report, and for follow-up with reference to checking use;
4) element is shared in different test cases by element files, improves the reusability of element;
5) element value of different test-types is provided in use-case file, same pin can be loaded in different test systems This is tested, and realizes that script is shared;
6) element parsing module described in Maven item objects model-drivens is utilized so that the element parsing module and described The mutual calling of test system, realize the calling transboundary between different language.
Those skilled in the art will readily occur to the disclosure its after considering specification and putting into practice invention disclosed herein Its embodiment.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or Person's adaptations follow the general principle of the disclosure and including the undocumented common knowledges in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by appended Claim is pointed out.

Claims (13)

  1. A kind of 1. user interface automated testing method, it is characterised in that including:
    The use-case file and element files for writing use-case is received, the use-case file comprises at least the masurium of multiple elements Claim, element method title and element value, the static state that the element files comprise at least multiple elements in the use-case file are determined Justice, the use-case file and/or the element files also include the platform of operation element and the Page Name of operation element;
    Each element of D ynamic instantiation so as to instantiate the use-case, wherein, to each element:
    The object of the element term is loaded with from a widget library according to the element term;
    Method with the element method title is called from the widget library according to the element method title;
    Platform environment data are obtained according to the platform of the operation element;
    Test system is driven to perform the use-case of instantiation, wherein,
    In searching whether the element be present on the page for running the element;
    If running and the element on the page of the element be present, the method for the driving test system execution element;
    The element is not present on the page of the element if running, using predetermined amount of time as interval, again in the operation member Search whether the element be present on the page of element, when first search to the time interval of current time exceedes scheduled time threshold certainly Value, then prompting test error.
  2. 2. user interface automated testing method as claimed in claim 1, it is characterised in that driving test system performs example The use-case of change also includes:
    Perform assertion verification, obtain and store desired value that one or more elements perform, after tested perform one of system or The comparative result of the actual value of multiple elements and the desired value and the actual value.
  3. 3. user interface automated testing method as claimed in claim 2, it is characterised in that
    For expected one or more of elements, system performs the page or next after operation element to the desired value after tested The content shown on the page;
    The actual value is that system performs after aobvious on the page or next page of operation element one or more elements after tested The content shown, wherein, the actual value is identical in the position shown on the page with the desired value in the position shown on the page.
  4. 4. user interface automated testing method as claimed in claim 1, it is characterised in that different in the element files Use-case shares the static defining of element.
  5. 5. user interface automated testing method as claimed in claim 1, it is characterised in that the element in the use-case file Value includes the element value of corresponding different test-types, and the test system of corresponding different test-types loads same test script.
  6. 6. user interface automated testing method as claimed in claim 5, it is characterised in that the test-types include:Survey Environmental acceptance, pre-manufactured environmental acceptance and production environment is tried to check and accept.
  7. 7. the user interface automated testing method as described in any one of claim 1 to 6, it is characterised in that described to use example text Part is Excel forms or DB formatted files.
  8. 8. the user interface automated testing method as described in any one of claim 1 to 6, it is characterised in that described static fixed Justice includes:One in inline frame, element description where element type, element search item, element searches the value of item, element or It is multinomial.
  9. A kind of 9. user interface automatic test device, it is characterised in that including:
    Data reception module, for receiving the use-case file and element files for writing use-case, the use-case file comprises at least Element term, element method title and the element value of multiple elements, the element files are comprised at least in the use-case file The static defining of multiple elements, the use-case file and/or the element files also include the platform and operation member of operation element The Page Name of element;
    Element parsing module, for each element of D ynamic instantiation so as to instantiate the use-case, wherein, to each member Element:
    The object of the element term is loaded with from a widget library according to the element term;
    Method with the element method title is called from the widget library according to the element method title;
    Platform environment data are obtained according to the platform of the operation element;
    Drive module, for driving test system to perform the use-case of instantiation, wherein,
    In searching whether the element be present on the page for running the element;
    If running and the element on the page of the element be present, the method for the driving test system execution element;
    The element is not present on the page of the element if running, using predetermined amount of time as interval, again in the operation member Search whether the element be present on the page of element, when first search to the time interval of current time exceedes scheduled time threshold certainly Value, then prompting test error;
    Widget library, the widget library store encoded multiple elements and element method.
  10. 10. user interface automatic test device as claimed in claim 9, it is characterised in that the element parsing module and institute Test system is stated to write using different coded systems, using element parsing module described in Maven item objects model-drivens with Make the mutual calling of the element parsing module and the test system.
  11. 11. user interface automatic test device as claimed in claim 9, it is characterised in that also include:
    Module is asserted, for performing assertion verification, obtains the desired value of one or more elements execution, system performs after tested The comparative result of the actual value of one or more elements and the desired value and the actual value;
    Daily record storage module, for storing desired value that the one or more elements for asserting that module obtains perform, after tested The comparative result of the actual value and the desired value and the actual value of one or more elements that system performs.
  12. 12. a kind of electronic equipment, it is characterised in that the electronic equipment includes:
    Processor;
    Storage medium, computer program is stored thereon with, such as right is performed when the computer program is run by the processor It is required that the step described in 1 to 8 any one.
  13. 13. a kind of storage medium, it is characterised in that computer program, the computer program are stored with the storage medium The step as described in any one of claim 1 to 8 is performed when being run by processor.
CN201710801790.7A 2017-09-07 2017-09-07 User interface automatic testing method and device, electronic equipment and storage medium Active CN107577607B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710801790.7A CN107577607B (en) 2017-09-07 2017-09-07 User interface automatic testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710801790.7A CN107577607B (en) 2017-09-07 2017-09-07 User interface automatic testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN107577607A true CN107577607A (en) 2018-01-12
CN107577607B CN107577607B (en) 2020-07-21

Family

ID=61031431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710801790.7A Active CN107577607B (en) 2017-09-07 2017-09-07 User interface automatic testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN107577607B (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170611A (en) * 2018-01-23 2018-06-15 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108763097A (en) * 2018-06-06 2018-11-06 上海携程国际旅行社有限公司 Automated testing method, device, electronic equipment, storage medium
CN109460264A (en) * 2018-09-26 2019-03-12 深圳壹账通智能科技有限公司 The acquisition methods of the H5 page, device and computer equipment in application program
CN109634839A (en) * 2018-10-25 2019-04-16 深圳壹账通智能科技有限公司 Page test method and device, storage medium, electric terminal
CN109634857A (en) * 2018-12-05 2019-04-16 东软集团股份有限公司 The method, apparatus and storage medium of test page object
CN109656816A (en) * 2018-12-04 2019-04-19 泰康保险集团股份有限公司 Control recognition methods, device, equipment and storage medium
CN110727603A (en) * 2019-10-25 2020-01-24 重庆誉存大数据科技有限公司 Improved method for automatically testing positioning elements based on UI (user interface)
CN111026645A (en) * 2019-11-20 2020-04-17 航天信息股份有限公司 User interface automatic testing method and device, storage medium and electronic equipment
CN111124919A (en) * 2019-12-24 2020-05-08 浙江诺诺网络科技有限公司 User interface testing method, device, equipment and storage medium
CN111209183A (en) * 2018-11-22 2020-05-29 中国电信股份有限公司 UI function traversal test method and device
CN111274509A (en) * 2020-01-14 2020-06-12 拉扎斯网络科技(上海)有限公司 Object list page display method and device
CN111679976A (en) * 2020-05-28 2020-09-18 泰康保险集团股份有限公司 Method and device for searching page object
CN112162750A (en) * 2020-09-09 2021-01-01 杭州涂鸦信息技术有限公司 Method and system for realizing same functions of different systems by using case script
CN112214397A (en) * 2020-09-09 2021-01-12 腾讯科技(深圳)有限公司 User interface testing method and device, computer equipment and storage medium
CN112579465A (en) * 2020-12-25 2021-03-30 中国农业银行股份有限公司 Test case execution method and device, storage medium and equipment
CN113238953A (en) * 2021-05-26 2021-08-10 杭州安恒信息技术股份有限公司 UI automation test method and device, electronic equipment and storage medium
CN113791974A (en) * 2021-08-25 2021-12-14 微梦创科网络科技(中国)有限公司 User interface UI element explicit waiting method and device
CN114706753A (en) * 2022-03-14 2022-07-05 马上消费金融股份有限公司 Display interface testing method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229920A1 (en) * 2013-02-13 2014-08-14 Sap Ag Dynamic scenario testing of web application
CN106021102A (en) * 2016-05-16 2016-10-12 北京奇虎科技有限公司 Automated test file generation method and apparatus
CN106055468A (en) * 2016-04-25 2016-10-26 乐视控股(北京)有限公司 Method and system for automatic testing of interface
CN106484609A (en) * 2015-09-01 2017-03-08 博雅网络游戏开发(深圳)有限公司 Page method of testing and device
CN106547689A (en) * 2016-10-20 2017-03-29 金航数码科技有限责任公司 A kind of automatic test cases development system and method based on web
CN106649125A (en) * 2016-12-28 2017-05-10 上海携程国际旅行社有限公司 Method and frame system for establishing multi-platform-supporting automatic testing script
CN106874207A (en) * 2017-02-27 2017-06-20 税友软件集团股份有限公司 The automated testing method and device of a kind of web page

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229920A1 (en) * 2013-02-13 2014-08-14 Sap Ag Dynamic scenario testing of web application
CN106484609A (en) * 2015-09-01 2017-03-08 博雅网络游戏开发(深圳)有限公司 Page method of testing and device
CN106055468A (en) * 2016-04-25 2016-10-26 乐视控股(北京)有限公司 Method and system for automatic testing of interface
CN106021102A (en) * 2016-05-16 2016-10-12 北京奇虎科技有限公司 Automated test file generation method and apparatus
CN106547689A (en) * 2016-10-20 2017-03-29 金航数码科技有限责任公司 A kind of automatic test cases development system and method based on web
CN106649125A (en) * 2016-12-28 2017-05-10 上海携程国际旅行社有限公司 Method and frame system for establishing multi-platform-supporting automatic testing script
CN106874207A (en) * 2017-02-27 2017-06-20 税友软件集团股份有限公司 The automated testing method and device of a kind of web page

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11561887B2 (en) 2018-01-23 2023-01-24 Netease (Hangzhou) Network Co., Ltd. Test script debugging using an automated testing framework and UI rendering tree
CN108170611A (en) * 2018-01-23 2018-06-15 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108763097A (en) * 2018-06-06 2018-11-06 上海携程国际旅行社有限公司 Automated testing method, device, electronic equipment, storage medium
CN109460264A (en) * 2018-09-26 2019-03-12 深圳壹账通智能科技有限公司 The acquisition methods of the H5 page, device and computer equipment in application program
CN109634839A (en) * 2018-10-25 2019-04-16 深圳壹账通智能科技有限公司 Page test method and device, storage medium, electric terminal
CN111209183A (en) * 2018-11-22 2020-05-29 中国电信股份有限公司 UI function traversal test method and device
CN109656816A (en) * 2018-12-04 2019-04-19 泰康保险集团股份有限公司 Control recognition methods, device, equipment and storage medium
CN109634857A (en) * 2018-12-05 2019-04-16 东软集团股份有限公司 The method, apparatus and storage medium of test page object
CN110727603A (en) * 2019-10-25 2020-01-24 重庆誉存大数据科技有限公司 Improved method for automatically testing positioning elements based on UI (user interface)
CN111026645A (en) * 2019-11-20 2020-04-17 航天信息股份有限公司 User interface automatic testing method and device, storage medium and electronic equipment
CN111026645B (en) * 2019-11-20 2023-11-28 航天信息股份有限公司 User interface automatic test method and device, storage medium and electronic equipment
CN111124919A (en) * 2019-12-24 2020-05-08 浙江诺诺网络科技有限公司 User interface testing method, device, equipment and storage medium
CN111274509A (en) * 2020-01-14 2020-06-12 拉扎斯网络科技(上海)有限公司 Object list page display method and device
CN111679976A (en) * 2020-05-28 2020-09-18 泰康保险集团股份有限公司 Method and device for searching page object
CN112214397A (en) * 2020-09-09 2021-01-12 腾讯科技(深圳)有限公司 User interface testing method and device, computer equipment and storage medium
CN112162750A (en) * 2020-09-09 2021-01-01 杭州涂鸦信息技术有限公司 Method and system for realizing same functions of different systems by using case script
CN112579465A (en) * 2020-12-25 2021-03-30 中国农业银行股份有限公司 Test case execution method and device, storage medium and equipment
CN113238953A (en) * 2021-05-26 2021-08-10 杭州安恒信息技术股份有限公司 UI automation test method and device, electronic equipment and storage medium
CN113791974A (en) * 2021-08-25 2021-12-14 微梦创科网络科技(中国)有限公司 User interface UI element explicit waiting method and device
CN113791974B (en) * 2021-08-25 2024-05-17 微梦创科网络科技(中国)有限公司 Explicit waiting method and device for user interface UI element
CN114706753A (en) * 2022-03-14 2022-07-05 马上消费金融股份有限公司 Display interface testing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN107577607B (en) 2020-07-21

Similar Documents

Publication Publication Date Title
CN107577607A (en) User interface automated testing method, device, electronic equipment, storage medium
US20220108108A1 (en) Method and system for extraction of data from documents for robotic process automation
US9189377B1 (en) Automation testing using descriptive maps
US9058177B2 (en) Real software components for achieving real component-based design
US8832658B2 (en) Verification framework for business objects
CN105022630B (en) A kind of assembly management system and assembly management method
US20070088598A1 (en) Mechanism for using processlets to model service processes
US20150363304A1 (en) Self-learning and self-validating declarative testing
CN109683953A (en) A kind of method and device carrying out configuration file processing based on visualization interface
US20050268280A1 (en) Encapsulating changes to a software application
Buinevich et al. The life cycle of vulnerabilities in the representations of software for telecommunication devices
US20210117313A1 (en) Language agnostic automation scripting tool
CN113238929B (en) Code testing method and device based on Mock data, electronic equipment and storage medium
US10248535B2 (en) On-demand automated locale seed generation and verification
Wang et al. Automatic generation of test models for model transformations
US20220308984A1 (en) Source code fault detection
CN114968741A (en) Performance test method, system, equipment and medium based on scene platform
Arora et al. Mobile agent‐based regression test case generation using model and formal specifications
CN113935847A (en) Online process risk processing method, device, server and medium
CN113032256A (en) Automatic test method, device, computer system and readable storage medium
CN110633077A (en) Rapid development system and method based on modularization
Johansen Testing Product Lines of Industrial Size: Advancements in Combinatorial Interaction Testing
US20230046322A1 (en) Robotic process automation system for managing human, robotic and external tasks
CN116560819B (en) RPA-based batch automatic operation method, system, equipment and storage medium
CN117850752B (en) Method and system for constructing low-code platform through domain model instantiation generator

Legal Events

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