CN104461900B - Test method, control server, test terminal and the system of user interface - Google Patents

Test method, control server, test terminal and the system of user interface Download PDF

Info

Publication number
CN104461900B
CN104461900B CN201410805346.9A CN201410805346A CN104461900B CN 104461900 B CN104461900 B CN 104461900B CN 201410805346 A CN201410805346 A CN 201410805346A CN 104461900 B CN104461900 B CN 104461900B
Authority
CN
China
Prior art keywords
control
test
interface
test terminal
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410805346.9A
Other languages
Chinese (zh)
Other versions
CN104461900A (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 Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410805346.9A priority Critical patent/CN104461900B/en
Publication of CN104461900A publication Critical patent/CN104461900A/en
Application granted granted Critical
Publication of CN104461900B publication Critical patent/CN104461900B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of test method of user interface, control server, test terminal and systems, are related to automatic test field, can solve the problems, such as that UI components testings process is complicated, cumbersome.The main technical solution of the present invention is:Control server receives test instruction, and test instruction is used to indicate carries out user interface UI tests to selected tested application;Control server obtains the data packet of the tested application, and the data packet is handed down to test terminal;It tests terminal and the tested application of operation is started according to data packet, and obtain the interface coordinate of every control in application interface;Test terminal carries out simulation click according to interface coordinate to control;It tests terminal record and clicks the test result that the control generates.Present invention is mainly used for the user interfaces to application to test.

Description

Test method, control server, test terminal and the system of user interface
Technical field
The present invention relates to automatic test field more particularly to a kind of test method of user interface, control server, surveys Try terminal and system.
Background technology
User interface (User Interface, abbreviation UI) test generally comprises layout test, content test (including word And picture), Fabric Hand Test, the contents such as components testing.For test objects such as layout, content style, fonts, generally use is static Mode is tested, such as point of use inspection table combines the mode manually observed to obtain test result.And in user interface For control, due to its characteristic with human-computer interaction, it can provide a user that such as interface redirects, to switch control, word defeated The interaction sexual function such as enter, therefore often the control in UI is tested using dynamical fashion in the prior art.
The existing dynamic test majority for UI controls needs tester to write test case, to tested object, surveys The contents such as examination mode, expected results are bound, and then executing the test case by test equipment (such as mobile phone) completes to UI The test of control.
Inventor has found during above-mentioned test UI controls, and writing for test case is typically more professional, for general For logical tester, complete set is write, available and efficient test case is not a simple thing.Especially It is individually to write test case and unrealistic for different test objects in the case where test case is short of transplantability.
Invention content
In view of this, the present invention provides a kind of test method of user interface controls, control server, test terminal and is System can solve the problems, such as that UI components testings process is complicated, cumbersome.
According to the present invention on one side, it is proposed that a kind of test method of user interface controls, this method include:
Control server receives test instruction, and the test instruction is used to indicate carries out user circle to selected tested application Face UI is tested;
The control server obtains the data packet of the tested application, and the data packet is handed down to test terminal;
The test terminal starts according to the data packet runs the tested application, and obtains every control in application interface The interface coordinate of part;
The test terminal carries out simulation click according to the interface coordinate to the control;
The test terminal record clicks the test result that the control generates.
According to the present invention on the other hand, it is proposed that a kind of control server, the control server include:
Receiving unit, for receiving test instruction, the test instruction, which is used to indicate, uses selected tested application Family interface UI is tested;
Acquiring unit, the test instruction for being received according to the receiving unit obtain the data of the tested application Packet;
Transmission unit, the data packet for obtaining the acquiring unit is handed down to test terminal, so that described It tests terminal and the operation tested application is started according to the data packet, the UI controls of the tested application are tested.
According to the present invention on the other hand, it is also proposed that a kind of test terminal, the test terminal include:
Receiving unit, the data packet for receiving the tested application that control server issues;
Execution unit, the data packet for being received according to the receiving unit, which starts, runs the tested application;
Acquiring unit, it is each in application interface for during the execution unit runs the tested application, obtaining The interface coordinate of item control;
Processing unit, the interface coordinate for being obtained according to the acquiring unit carry out simulation point to the control It hits;
Recording unit clicks the test result that the control generates for recording the processing unit.
According to the present invention on the other hand, it is proposed that a kind of test system of user interface, the system include middle control service Device and test terminal;
The control server, for receiving test instruction, the test instruction is used to indicate to selected tested application User interface UI tests are carried out, the data packet of the tested application is obtained, and the data packet is handed down to the test terminal;
The test terminal, the data packet for being issued according to the control server start described be tested of operation and answer With, the interface coordinate of every control in application interface is obtained, simulation click is carried out to the control according to the interface coordinate, and Record clicks the test result that the control generates.
A kind of test method of user interface controls of the present invention, tests terminal and system at control server, is Test instruction is received by control server, obtains the data packet of tested application, and delivers a packet to test terminal, by testing Terminal obtains the control interfaces coordinate being tested in application interface, and carrying out simulation according to acquired coordinate clicks test, and will survey Test result is recorded.The UI tests carried out by this method, tester only need to send to test to control server to refer to It enables, then only need to wait for control server and tests the automatic test of the tested application of terminal-pair, finally obtained in test terminal Test result is taken, compared with the existing technology, tester can save and be write to test case, also need not be to tested pair As, contents such as test mode, expected results are bound, to significantly reduce the working strength of tester, fundamentally Solve the problems, such as that UI components testings process is complicated, cumbersome.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technical means of the present invention, And can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, below the special specific implementation mode for lifting the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are common for this field Technical staff will become clear.Attached drawing only for the purpose of illustrating preferred embodiments, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of test method flow chart for user interface that the embodiment of the present invention proposes;
Fig. 2 shows the test method flow charts for another user interface that the embodiment of the present invention proposes;
Fig. 3 shows a kind of structural schematic diagram for control server that the embodiment of the present invention proposes;
Fig. 4 shows the structural schematic diagram for another control server that the embodiment of the present invention proposes;
Fig. 5 shows the structural schematic diagram for the test terminal that the embodiment of the present invention proposes;
Fig. 6 shows the structural schematic diagram for another test terminal that the embodiment of the present invention proposes;
Fig. 7 shows a kind of test system schematic for user interface that the embodiment of the present invention proposes.
Specific implementation mode
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
An embodiment of the present invention provides a kind of test methods of user interface, as shown in Figure 1, this method includes:
101, control server receives test instruction, and test instruction is used to indicate carries out user circle to selected tested application Face UI is tested.
After being selected during tester is by test platform and being used as the application of test object, control server receives test The test instruction that platform issues.The present embodiment is tested mainly for the click function of UI controls.
102, control server obtains the data packet of tested application, and data packet is handed down to test terminal.
Control server needs the data packet for obtaining tested application after determining the UI test events to be carried out.In general, It is preserved in control server for recording the mapping table for applying data packet store path.After obtaining test instruction, Control server searches mapping table according to the application identities carried in the instruction, obtains the storage road for applying data packet Diameter, and the data packet of the application is further obtained according to the store path.In practical application, data packet can be stored in middle control clothes It is engaged in inside device, can also be stored in the database independently of control server, no matter use which kind of storage mode, middle control service Device can obtain the data packet of application by searching for the mode of store path.
The present embodiment is tested mainly for the application under Android (Android) operating system, therefore, above-mentioned data packet Sometimes referred as correspond to the Android data packet (Android Package, abbreviation APK) of Android application.
The data packet can be handed down to test terminal, by testing by control server after the data packet for obtaining tested application Terminal is preserved and is tested.
In a kind of realization method of the present embodiment, control server calls ADB's (Android Debug Bridge) PUSH orders will be in packet synchronisation to test terminal.By test terminal-pair, the data packet is stored, and for the side of storage Formula can be stored in test terminal local, can also be this side in the storage device for being stored in and being connected in the test terminal Formula does not have the case where memory space primarily directed to test terminal itself.
103, test terminal starts the tested application of operation according to data packet, and obtains the interface of every control in application interface Coordinate.
Terminal is tested after the tested application data packet for obtaining being sent by control server, the data packet will be carried out automatically Dissection process starts after the execution file for obtaining tested application and runs the application, while obtaining in the tested application interface The interface coordinate of control.In the present embodiment, test terminal can also obtain the coordinate of VIEW, and adopt in addition to the coordinate for obtaining control The VIEW in UI is tested with mode identical with test control.VIEW and control the difference is that, interface control Refer to the visualized graphs " element " that can be placed on forms, such as button, Document Editing frame, has the function of to execute or pass through " event " causes the function that code runs and completes response, and VIEW is shown a fixed block in interface as one Area, the object of displaying can be the graph text informations of dynamic or static state, it will usually be linked to next stage sub-interface.
104, test terminal carries out simulation click according to interface coordinate to control.
The case where terminal clicks control in interface by user in software simulation reality is tested in tested application interface Control carries out simulation click, when carrying out simulation and clicking, test terminal by the coordinate of control in acquired interface in 103 come Determine the specific location of the control.In fact, test terminal can not be intuitive by naked eyes and human thinking as user Judge the specific location of control (also including VIEW certainly), it is to keep test whole to obtain the purpose of control coordinate in the present embodiment End can be accurately positioned in the case of None- identified control and click each control.
105, test terminal record clicks the test result that control generates.
Event is clicked according to the simulation in 104, test terminal will record this result for clicking test.Specific to the present invention Embodiment, it is exactly that this is tested apply whether will produce response after this click to click test result caused by control, there is sound It should illustrate that the control in tested application can be executed normally, and then illustrate that the control of tested application can not normal work without response Make, the collapse of application process can be caused.Wherein, the collapse of application process refers to that corresponding process disappears suddenly after application program reports an error The reason of mistake or corresponding service are automatically stopped, application process caused to collapse is varied, specific to the embodiment of the present invention, is In Android operation system, the process of application in the process of implementation, often carries out single stepping, can all generate one in systems A corresponding thread is handled, and ends automatically the thread again after processing is completed.And the processing time for working as thread is longer, And when opening a fairly large number of thread in same amount of time, a large amount of memory sources which will be in consumption system, And according to the operating mechanism of android system, system can be automatically stopped a part of thread in the process and carry out releasing memory resource For the operation of other application, in this process, if system stop thread in include the application some core into The phenomenon that Cheng Shi, which just will appear process collapse.
The embodiment of the present invention uses a kind of test method of user interface controls, is to receive test by control server to refer to It enables, obtains the data packet of tested application, and deliver a packet to test terminal, obtained and be tested in application interface by test terminal Control interfaces coordinate, simulation is carried out according to acquired coordinate and clicks test, and test result is recorded.Pass through the party The UI tests that method is carried out, tester only need to send test instruction to control server, then just wait for middle control service The automatic test of device and the tested application of test terminal-pair, finally obtains test result in test terminal, compared with the existing technology, Tester can save and be write to test case, also need not be to contents such as tested object, test mode, expected results It is bound, to significantly reduce the working strength of tester, it is complicated, numerous fundamentally to solve UI components testings process Trivial problem.
In order to further carry out refinement explanation to above-mentioned method, the embodiment of the present invention also provides a kind of survey of user interface Method for testing, as shown in Fig. 2, this method includes:
201, control server receives test instruction, and test instruction is used to indicate carries out user circle to selected tested application Face UI is tested.
The generation of test instruction can show the list comprising optional application or dish by Web page by control server It is single, sequentially list the correlation attribute information of application in list or menu, the title such as applied, provider, application size. Choose optional in tester in application, control server obtains test instruction, and the optional application chosen is determined as being tested Using.Wherein, control server by shown by Web page can selection operation be generally single selection mode, i.e., cannot choose simultaneously Two applications carry out UI tests.
202, control server obtains the data packet of tested application, and data packet is handed down to test terminal.
Control server is after the data packet for obtaining tested application according to test instruction, and control server is by acquired number It is handed down to test terminal according to packet.Wherein, the concrete mode for being handed down to test terminal can be that control server passes through wireless network The mode of transmission is directly transmitted to test terminal, is such as sent using the data packet that WIFI network carries out, and can also be to be taken by middle control Business device is sent to terminal test terminal by proxy server indirectly, such as data packet is first sent to agency's clothes by control server Business device, then test terminal is sent to by proxy server.Proxy server with test terminal can be connect by USB interface or It is attached by wireless network.It is above-described to issue mode, it is to be changed according to the difference of concrete application scene, example Such as, former side can be used when control server is less compared with close or test application task with test terminal distance Formula, and for control server with test terminal distance farther out or the more proxy server point of needing of the task of test application When serving as business, so that it may which in a manner of using the issuing of latter, the embodiment of the present invention does not limit specifically which kind of is used issue mode It is fixed.
203, test terminal starts the tested application of operation according to data packet, and obtains the interface of every control in application interface Coordinate.
Test terminal will parse the data packet after the data packet for receiving control server transmission, obtain data The interface identification at the first interface of application, the interface first interface shown when being tested application execution, interface are tested in packet Mark describes the information such as title, the version at interface.Meanwhile it obtaining the execution file of tested application and starting this tested answering With.
After starting tested application, test terminal is known according to the interface identification at the first interface of the tested application parsed The first interface being tested using after starting is not gone out (interface is also referred to as used as an Activity).It is opened from the control at the interfaces head Begin, (such as from left to right or from top to bottom) traverses in first interface and its sub-interface at different levels terminal successively in a certain order Each control.
When often traversing a control, test terminal will obtain the interface coordinate of the control.In the present embodiment, test Terminal is by calling Accessibility interfaces to realize the traversal of control and the acquisition of interface coordinate.Wherein, Accessibility be it is a kind of UI element informations are accessed with program mode (PM) or operate the function services of these UI elements, in this hair In bright embodiment, test terminal can be accessed the interfaces UI in tested application by Accessibility and obtain wherein control The information such as relevant information, including the coordinate parameters of control type and control in interface.By calling Accessibility The specific implementation for the control that interface comes in traversal applications interface is:Test interface of the terminal according to the first interface in data packet Mark, navigates to initial application interface.Again since initial application interface, at different levels answer is sequenced through according to the rule of depth-first With the control in interface.So-called depth-first rule refers to that the logical path being directed toward according to some control clicks each height step by step Interface, until returning again to upper level interface after clicking to bottom interface clicks other interfaces.Illustratively, it is answered with certain food and drink class For, first interface is for selecting area, wherein including the controls such as " Beijing ", " Shanghai ", " Shenzhen ", " Chengdu ".According to by a left side To right, sequence from top to bottom, test terminal first clicks on control " Beijing ", into next stage submenu, then still with aforementioned Sequence sequentially clicks the control " Broiled Dishes " in the interface of the second level, control " buffet " and afterbody in third level interface Control " so-and-so restaurant " in interface thus completes an extreme saturation.Then, test terminal continues to click afterbody interface The control in middle other restaurants of correspondence continues to click other controls such as " western-style food " until returning to Level-3 menu after all clicking Part.
After having carried out an extreme saturation, test terminal arranges control according to the sequencing for obtaining interface coordinate Sequence will obtain a list of controls to sort according to depth-first principle, have recorded all controls in the application in lists Quantity and the corresponding interface coordinate of each control, such as " Beijing "->" Broiled Dishes "->" buffet "->" so-and-so restaurant ".
204, test terminal carries out simulation click according to interface coordinate to control.
When carrying out simulation click, test terminal executes shell-command, and acquired control interfaces coordinate is written to In input sentences and the input sentences are executed, primary simulation is thus completed and clicks.
It need not again be held after all control interfaces coordinates for obtaining application it should be noted that being clicked to the simulation of control Row, but can be according to the simulation clicking operation being carried out while obtaining control interfaces coordinate in 203 to the control.
205, test terminal record clicks the test result that control generates.
Test terminal records the result that the simulation in 204 is clicked, and generates a components testing the results list, In the list other than recording the title of control clicked and being clicked the quantity of control, also record have control relative to The click path of application interface, the click path are that record test terminal is clicked by the control sequence in the first interface of tested application The control currently clicked routing information (such as Beijing "->" Broiled Dishes "->" buffet "->" so-and-so restaurant ").It is practical In, which leads to the click process that application process is collapsed commonly used in record.
Further, above-mentioned components testing the results list can also in 203 according to the sequence of depth-first principle List of controls is combined, and the click path of test result and control is recorded in the table.
206, test terminal reports test result to control server.
After obtaining test result, which is reported to control server by test terminal, then has control server to report To test platform, checked for tester.In practical application, multiple test terminal-pair same applications can be used to carry out UI surveys Examination, and the test result reported to each test terminal by control server carries out summarizing duplicate removal, it is possible thereby to reject individual whole The random factor at end obtains more stable, accurate test result.
Further, in practical applications, test terminal is obtained according to the control in depth-first principle traversal applications When the interface coordinate of control, it is possible to the click process of endless loop can be absorbed in.Under normal conditions, the generation of infinite loop phenomenon is main There is " return " control in interface to cause, due to there is " return " control, test terminal may be in the superior and the subordinate interface repeatedly " enter<—>The clicking operation of return ", is thus absorbed in cycle, can not extricate oneself.In the present embodiment, to prevent endless loop feelings The generation of condition, test terminal can execute following operation:
Step 1, the simulation number of clicks for testing terminal-pair control are counted.
Test terminal can be locally generated a DB (data base) file, and often obtaining a control will be in this document In establish a record for the control.When simulation, which is clicked, to be occurred, test terminal can be according to the reading of counter in DB files Record modify and preserve.
Step 2, before carrying out simulation click again, test terminal read count value.
Due to the next stage interface phase of two different controls in the presence of the possibility repeatedly clicked, such as in the same interface Meanwhile the control at the next stage interface will be clicked repeatedly.And after each control carries out simulation click, test terminal will lead to The number of counter records click is crossed, and before simulation is clicked next time, keeps the count value of the control number of clicks.
If step 3, count value have reached preset quantity, cancel the simulation clicking operation to the control.
Terminal is tested before clicking control, the count value of the control can be read, and be compared with preset quantity, if should Count value has reached the preset quantity, and test terminal is by cancellation to the simulation clicking operation of control.Wherein, the setting of preset quantity It can be according to by the self-defined positive integer being set as not less than 1 of tester.Pass through the restriction to number of clicks, so that it may with effective Test process is prevented to be absorbed in the appearance of endless loop situation.
Further, it is clicked and is surveyed relative to actual hardware in such a way that software simulates and clicks control due to test terminal Examination can save a large amount of manpower and time cost, but even in such a way that simulation is clicked, for some interfaces and control Part is more, and for the more complicated application of level, to finish primary complete test is also to need a very long time, in order to The case where controlling the time of test, while test can also be further prevented to fall into endless loop, the embodiment of the present invention can pass through The process of test is simplified to the restriction of testing time, concrete mode is:The process for testing terminal-pair UI tests carries out timing; When UI tests are when taking more than preset duration, test terminal terminates UI test process.Wherein, the setting preset often should be greater than The test reaches the duration that process is clicked using the control in minimum bed boundary being clicked by the control in first interface.
Further, the present invention a kind of realization method in, as to it is aforementioned by depth-first principle traversal in a manner of It replaces, this system also supports monkey to click the mode of test, and which is to be by the coordinate obtained at random in application interface The interface coordinate of control starts shell-command again by test terminal later, the interface coordinate of control is written to In input sentences and the input sentences are executed to execute simulation clicking operation, obtain test result.It is carried out using which Test can control the time of test, the more meanings of the test mode by limiting the random number for obtaining interface coordinate It is to click the control using UI tests the test for bearing pressure, test application can or can not during the click of limited number of time There is a situation where application crashes.
Further, as the realization to method shown in above-mentioned Fig. 1 or Fig. 2, another embodiment of the present invention additionally provides one Kind control server, to be realized to above-mentioned method shown in fig. 1 or fig. 2.As shown in figure 3, the control server includes: Receiving unit 31, acquiring unit 32 and transmission unit 33, wherein:
Receiving unit 31, for receiving test instruction, test instruction is used to indicate carries out user to selected tested application Interface UI is tested;
Acquiring unit 32, the test instruction for being received according to receiving unit 31 obtain the data packet of tested application;
Transmission unit 33, the data packet for obtaining acquiring unit 32 are handed down to test terminal, so that test terminal Start the tested application of operation according to data packet, the UI controls of tested application are tested.
Further, as shown in figure 4, receiving unit 31, including:
Subelement 311 is handled, the list comprising optional application or menu are shown for sending Web page;
Determination subelement 312, for choosing optional in tester in application, obtaining test instruction, and can by what is chosen Choosing application is determined as tested application.
Further, receiving unit 31, the test result reported for receiving test terminal.
Further, as the realization to method shown in above-mentioned Fig. 1 or Fig. 2, another embodiment of the present invention additionally provides one Kind test terminal, to be realized to above-mentioned method shown in fig. 1 or fig. 2.As shown in figure 5, the test terminal includes:It receives Unit 51, execution unit 52, acquiring unit 53, processing unit 54 and recording unit 55, wherein:
Receiving unit 51, the data packet for receiving the tested application that control server issues;
Execution unit 52, the data packet for being received according to receiving unit 51 start the tested application of operation;
Acquiring unit 53, for during execution unit 52 runs tested application, obtaining every control in application interface The interface coordinate of part;
Processing unit 54, the interface coordinate for being obtained according to acquiring unit 53 carry out simulation click to control;
Recording unit 55 clicks the test result that control generates for recording processing unit 54.
Further, acquiring unit 53, for calling the control in Accessibility interface traversal applications interface, and Obtain the interface coordinate of every control.
Further, acquiring unit 53 are used for:
The interface identification at the first interface of the tested application is obtained, and initial application circle is navigated to according to the interface identification Face;
Since initial application interface, the control in application interfaces at different levels is sequenced through according to the rule of depth-first.
Further, interface coordinate is written in input sentences and is held for starting shell-command by processing unit 54 Row input sentences.
Further, recording unit 55 are used for:
Record the click path of control in application interfaces at different levels;
When the collapse of the process of generation, the click process for causing process to be collapsed is determined according to path is clicked.
Further, as shown in fig. 6, the test terminal further comprises:
Counting unit 56, the simulation number of clicks for clicking control to processing unit 54 count;
Processing unit 54, for before carrying out simulation click again, reading the count value that counting unit 56 records, if meter Numerical value has reached preset quantity, then cancels the simulation clicking operation to control.
Further, as shown in fig. 6, the test terminal further comprises:
The process of timing unit 57, the UI tests for being executed to execution unit 52 carries out timing;
Execution unit 52, for when the taking more than preset duration of UI tests that timing unit 57 records, terminating UI and surveying Examination process.
Further, as shown in fig. 6, the test terminal further comprises:
Transmission unit 58 services after recording in recording unit 55 and clicking the test result that control generates to middle control Device reports the test result that recording unit 55 records.
Further, as the realization to method shown in above-mentioned Fig. 1 or Fig. 2, another embodiment of the present invention additionally provides one The test system of kind user interface.As shown in fig. 7, the system includes control server 71 and test terminal 72;
Control server 71, for receiving test instruction, test instruction, which is used to indicate, uses selected tested application Family interface UI is tested, and obtains the data packet of tested application, and data packet is handed down to test terminal 72;
Terminal 72 is tested, the data packet for being issued according to control server 71 starts the tested application of operation, obtains application The interface coordinate of every control, simulation click is carried out according to interface coordinate to control in interface, and is recorded and clicked what control generated Test result.
In conclusion control server used by the embodiment of the present invention, test terminal and system, can be serviced by middle control Device receives test instruction, receives the data packet of tested application, and delivers a packet to test terminal, and quilt is obtained by test terminal The control interfaces coordinate in application interface is surveyed, carrying out simulation according to acquired coordinate clicks test, while test result being remembered Record is got off, and the result is reported to control server again.The UI tests carried out by this method, tester only need pair Control server sends test instruction, then only needs to wait for control server and tests the automatic survey of the tested application of terminal-pair Examination finally obtains test result by test terminal and is reported to control server, and tester can be obtained by control server Final test result is taken to analyze to the reliability of tested application, compared with the existing technology, can be saved using this programme Tester writes test case, also need not carry out boundary to contents such as tested object, test mode, expected results It is fixed, and letter is also acted by the counting to the simulation number of clicks of control in the interfaces UI, and the total duration of limitation test It is single effectively to prevent test from entering the effect that endless loop situation occurs, while the working strength of tester is significantly reduced, from Fundamentally solve the problems, such as that UI components testings process is complicated, cumbersome.
Further, the invention also discloses:
A1, a kind of test method of user interface, the method includes:
Control server receives test instruction, and the test instruction is used to indicate carries out user circle to selected tested application Face UI is tested;
The control server obtains the data packet of the tested application, and the data packet is handed down to test terminal;
The test terminal starts according to the data packet runs the tested application, and obtains every control in application interface The interface coordinate of part;
The test terminal carries out simulation click according to the interface coordinate to the control;
The test terminal record clicks the test result that the control generates.
A2, the method according to A1, the control server receive test instruction, including:
The control server shows the list comprising optional application or menu by Web page;
Choose described optional in tester in application, the control server obtains the test instruction, and will choose The optional application be determined as the tested application.
A3, the method according to A1, the test terminal obtain the interface coordinate of every control in application interface, packet It includes:
The test terminal calls Accessibility interfaces to traverse the control in the application interface, and obtains items The interface coordinate of control.
A4, the method according to A3, the test terminal call Accessibility interfaces to traverse the application interface In control, including:
The test terminal obtains the interface identification at the first interface of the tested application, and is positioned according to the interface identification To initial application interface;
The test terminal sequences through applications at different levels since the initial application interface, according to the rule of depth-first Control in interface.
A5, the method according to A1, the test terminal carry out simulation point according to the interface coordinate to the control It hits, including:
The test terminal starts shell-command, the interface coordinate is written in input sentences and described in executing Input sentences.
A6, the method according to A1, the test terminal record click the test result that the control generates, including:
The test terminal records the click path of control in application interfaces at different levels;
When the collapse of the process of generation, the test terminal determines the click for causing process to be collapsed according to the click path Journey.
A7, the method according to A1, the method further includes:
The simulation number of clicks of control described in the test terminal-pair is counted;
Before carrying out simulation click again, the test terminal reads the count value;
If the count value has reached preset quantity, cancel the simulation clicking operation to the control.
A8, the method according to A1, the method further includes:
The process that UI described in the test terminal-pair is tested carries out timing;
When UI tests are when taking more than preset duration, the test terminal terminates the UI test process.
A9, the method according to A1, after the test terminal record clicks the test result that the control generates, The method further includes:
The test terminal reports the test result to the control server.
B10, a kind of control server, the control server include:
Receiving unit, for receiving test instruction, the test instruction, which is used to indicate, uses selected tested application Family interface UI is tested;
Acquiring unit, the test instruction for being received according to the receiving unit obtain the data of the tested application Packet;
Transmission unit, the data packet for obtaining the acquiring unit is handed down to test terminal, so that described It tests terminal and the operation tested application is started according to the data packet, the UI controls of the tested application are tested.
B11, the control server according to B10, the receiving unit, including:
Subelement is handled, the list comprising optional application or menu are shown for sending Web page;
Determination subelement for choosing described optional in tester in application, obtaining the test instruction, and will be chosen The optional application be determined as the tested application.
B12, the control server according to B10, the receiving unit, the survey reported for receiving the test terminal Test result.
C13, a kind of test terminal, the test terminal include:
Receiving unit, the data packet for receiving the tested application that control server issues;
Execution unit, the data packet for being received according to the receiving unit, which starts, runs the tested application;
Acquiring unit, it is each in application interface for during the execution unit runs the tested application, obtaining The interface coordinate of item control;
Processing unit, the interface coordinate for being obtained according to the acquiring unit carry out simulation point to the control It hits;
Recording unit clicks the test result that the control generates for recording the processing unit.
C14, the test terminal according to C13, the acquiring unit, for calling Accessibility interfaces to traverse Control in the application interface, and obtain the interface coordinate of every control.
C15, the test terminal according to C14, the acquiring unit are used for:
The interface identification at the first interface of the tested application is obtained, and initial application circle is navigated to according to the interface identification Face;
Since the initial application interface, the control in application interfaces at different levels is sequenced through according to the rule of depth-first Part.
C16, the test terminal according to C13, the processing unit sit the interface for starting shell-command Mark is written in input sentences and executes the input sentences.
C17, the test terminal according to C13, the recording unit are used for:
Record the click path of control in application interfaces at different levels;
When the collapse of the process of generation, the click process for causing process to be collapsed is determined according to the click path.
C18, the test terminal according to C13, the test terminal further comprise:
Counting unit, the simulation number of clicks for clicking the control to the processing unit count;
The processing unit, the meter for before carrying out simulation click again, reading the counting unit record Numerical value cancels the simulation clicking operation to the control if the count value has reached preset quantity.
C19, the test terminal according to C13, the test terminal further comprise:
The process of timing unit, the UI tests for being executed to the execution unit carries out timing;
The execution unit is used for when the taking more than preset duration of UI tests that the timing unit records, Terminate the UI test process.
C20, the test terminal according to C13, the test terminal further comprise:
Transmission unit, for after the test result that the recording unit records click that the control generates, to described Control server reports the test result of the recording unit records.
The test system of D21, a kind of user interface, the system comprises control server and test terminals;
The control server, for receiving test instruction, the test instruction is used to indicate to selected tested application User interface UI tests are carried out, the data packet of the tested application is obtained, and the data packet is handed down to the test terminal;
The test terminal, the data packet for being issued according to the control server start described be tested of operation and answer With, the interface coordinate of every control in application interface is obtained, simulation click is carried out to the control according to the interface coordinate, and Record clicks the test result that the control generates.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment " first ", " second " etc. be and not represent the quality of each embodiment for distinguishing each embodiment.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific implementation mode are expressly incorporated in the specific implementation mode, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment Change and they are arranged in the one or more equipment different from the embodiment.It can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization, or to run on one or more processors Software module realize, or realized with combination thereof.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) realize the denomination of invention according to the ... of the embodiment of the present invention (as determined in website The device of Hyperlink rank) in some or all components some or all functions.The present invention is also implemented as being used for Some or all equipment or program of device of method as described herein are executed (for example, computer program and calculating Machine program product).It is such to realize that the program of the present invention may be stored on the computer-readable medium, or there are one can having Or the form of multiple signals.Such signal can be downloaded from internet website and be obtained, or be provided on carrier signal, Or it provides in any other forms.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be by the same hardware branch To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and be run after fame Claim.

Claims (18)

1. a kind of test method of user interface, which is characterized in that the method includes:
Control server receives test instruction, and the test instruction is used to indicate carries out user interface UI to selected tested application Test;
The control server obtains the data packet of the tested application by searching for the mode of store path, and by the data Packet is handed down to test terminal;
The test terminal starts according to the data packet runs the tested application, and obtains every control in application interface Interface coordinate, the interface coordinate include the coordinate of control and the coordinate of VIEW;
The test terminal carries out simulation click according to the interface coordinate to the control;
The test terminal record clicks the test result that the control generates.
2. according to the method described in claim 1, it is characterized in that, the control server receive test instruction, including:
The control server shows the list comprising optional application or menu by Web page;
Choose described optional in application, the control server obtains the test instruction, and the institute that will be chosen in tester It states optional application and is determined as the tested application.
3. according to the method described in claim 1, it is characterized in that, the test terminal obtains every control in application interface Interface coordinate, including:
The test terminal calls Accessibility interfaces to traverse the control in the application interface, and obtains every control Interface coordinate.
4. according to the method described in claim 3, it is characterized in that, the test terminal calls Accessibility interfaces time The control in the application interface is gone through, including:
The test terminal obtains the interface identification at the first interface of the tested application, and has been navigated to according to the interface identification Beginning application interface;
The test terminal sequences through application interfaces at different levels since the initial application interface, according to the rule of depth-first In control.
5. according to the method described in claim 1, it is characterized in that, the test terminal according to the interface coordinate to the control Part carries out simulation click, including:
The test terminal starts shell-command, and the interface coordinate is written in input sentences and executes the input Sentence.
6. according to the method described in claim 1, it is characterized in that, the test terminal record clicks the survey that the control generates Test result, including:
The test terminal records the click path of control in application interfaces at different levels;
When the collapse of the process of generation, the test terminal determines the click process for causing process to be collapsed according to the click path.
7. according to the method described in claim 1, it is characterized in that, the method further includes:
The simulation number of clicks of control described in the test terminal-pair is counted;
Before carrying out simulation click again, the test terminal reads the count value;
If the count value has reached preset quantity, cancel the simulation clicking operation to the control.
8. according to the method described in claim 1, it is characterized in that, the method further includes:
The process that UI described in the test terminal-pair is tested carries out timing;
When UI tests are when taking more than preset duration, the test terminal terminates the UI test process.
9. according to the method described in claim 1, it is characterized in that, clicking what the control generated in the test terminal record After test result, the method further includes:
The test terminal reports the test result to the control server.
10. a kind of test terminal, which is characterized in that the test terminal includes:
Receiving unit, the data packet for receiving the tested application that control server issues;
Execution unit, the data packet for being received according to the receiving unit, which starts, runs the tested application;
Acquiring unit, for during the execution unit runs the tested application, obtaining every control in application interface The interface coordinate of part, the interface coordinate include the coordinate of control and the coordinate of VIEW;
Processing unit, the interface coordinate for being obtained according to the acquiring unit carry out simulation click to the control;
Recording unit clicks the test result that the control generates for recording the processing unit.
11. test terminal according to claim 10, which is characterized in that the acquiring unit, for calling Accessibility interfaces traverse the control in the application interface, and obtain the interface coordinate of every control.
12. test terminal according to claim 11, which is characterized in that the acquiring unit is used for:
The interface identification at the first interface of the tested application is obtained, and initial application interface is navigated to according to the interface identification;
Since the initial application interface, the control in application interfaces at different levels is sequenced through according to the rule of depth-first.
13. test terminal according to claim 10, which is characterized in that the processing unit, for starting shell lives It enables, the interface coordinate is written in input sentences and executes the input sentences.
14. test terminal according to claim 10, which is characterized in that the recording unit is used for:
Record the click path of control in application interfaces at different levels;
When the collapse of the process of generation, the click process for causing process to be collapsed is determined according to the click path.
15. test terminal according to claim 10, which is characterized in that the test terminal further comprises:
Counting unit, the simulation number of clicks for clicking the control to the processing unit count;
The processing unit, the count value for before carrying out simulation click again, reading the counting unit record, If the count value has reached preset quantity, cancel the simulation clicking operation to the control.
16. test terminal according to claim 10, which is characterized in that the test terminal further comprises:
The process of timing unit, the UI tests for being executed to the execution unit carries out timing;
The execution unit, for when the taking more than preset duration of UI tests that the timing unit records, terminating The UI test process.
17. test terminal according to claim 10, which is characterized in that the test terminal further comprises:
Transmission unit, for after the test result that the recording unit records click that the control generates, to the middle control Server reports the test result of the recording unit records.
18. a kind of test system of user interface, which is characterized in that the system comprises control server and test terminals;
The control server, for receiving test instruction, the test instruction, which is used to indicate, carries out selected tested application User interface UI tests, obtain the data packet of the tested application, and the data packet is handed down to the test terminal;
The test terminal, the data packet for being issued according to the control server, which starts, runs the tested application, Obtaining the interface coordinate of every control in application interface, the interface coordinate includes the coordinate of control and the coordinate of VIEW, according to The interface coordinate carries out simulation click to the control, and records and click the test result that the control generates.
CN201410805346.9A 2014-12-19 2014-12-19 Test method, control server, test terminal and the system of user interface Active CN104461900B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410805346.9A CN104461900B (en) 2014-12-19 2014-12-19 Test method, control server, test terminal and the system of user interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410805346.9A CN104461900B (en) 2014-12-19 2014-12-19 Test method, control server, test terminal and the system of user interface

Publications (2)

Publication Number Publication Date
CN104461900A CN104461900A (en) 2015-03-25
CN104461900B true CN104461900B (en) 2018-08-10

Family

ID=52907989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410805346.9A Active CN104461900B (en) 2014-12-19 2014-12-19 Test method, control server, test terminal and the system of user interface

Country Status (1)

Country Link
CN (1) CN104461900B (en)

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294106B (en) * 2015-05-27 2019-03-22 航天信息股份有限公司 The test method and device of Web application system
CN106326104B (en) * 2015-07-08 2021-03-16 腾讯科技(深圳)有限公司 Terminal control testing method and device
CN105205003A (en) * 2015-10-28 2015-12-30 努比亚技术有限公司 Automated testing method and device based on clustering system
CN105653056B (en) * 2015-12-17 2019-05-28 北京奇虎科技有限公司 The test method and device of input method
CN105868100A (en) * 2015-12-22 2016-08-17 乐视网信息技术(北京)股份有限公司 Android system-based automatic test method and device
CN105956438A (en) * 2016-04-19 2016-09-21 奇酷软件(深圳)有限公司 Rapid display method, rapid display device and terminal
CN106789399B (en) * 2016-11-28 2020-06-26 成都成电光信科技股份有限公司 Test method, device and system
CN107017939A (en) * 2017-04-17 2017-08-04 北京奥博太空科技有限公司 A kind of server, answering machine, satellite test system and correlation technique
CN107122301B (en) * 2017-04-27 2020-04-10 武汉斗鱼网络科技有限公司 Interface testing method and device
CN107329898A (en) * 2017-06-30 2017-11-07 上海摩软通讯技术有限公司 Terminal interface automated testing method and system
CN107451063B (en) * 2017-08-14 2021-04-27 凌云天博光电科技股份有限公司 Script testing method and device
CN109558307B (en) * 2017-09-26 2022-03-22 卓望数码技术(深圳)有限公司 Game program testing method and system
CN110162453B (en) * 2018-02-11 2022-03-01 腾讯科技(深圳)有限公司 Test method, test device, computer readable storage medium and computer equipment
CN108549601A (en) * 2018-04-02 2018-09-18 郑州云海信息技术有限公司 A kind of more browser compatibility automated testing methods
CN109101429B (en) * 2018-08-21 2021-12-07 青岛海信宽带多媒体技术有限公司 Method and device for debugging browser page of set top box
CN109491890A (en) * 2018-10-16 2019-03-19 深圳壹账通智能科技有限公司 The interface scans method and terminal device of application program
CN109587663A (en) * 2018-10-25 2019-04-05 惠州市德赛西威汽车电子股份有限公司 A kind of automated testing method and its system of vehicle-mounted Wi-Fi switch
CN111290938A (en) * 2018-12-08 2020-06-16 南京慕测信息科技有限公司 Android semi-automatic testing method based on manual assistance
CN110008110B (en) * 2019-01-28 2022-07-22 创新先进技术有限公司 User interface testing method and device
CN110471855A (en) * 2019-08-21 2019-11-19 小胡杨信息技术(武汉)有限公司 A kind of computer application software test macro and method
CN110795022B (en) * 2019-11-08 2022-03-15 北京字节跳动网络技术有限公司 Terminal testing method, system and storage medium
CN110968519A (en) * 2019-12-23 2020-04-07 上海米哈游天命科技有限公司 Game testing method, device, server and storage medium
CN111694744B (en) * 2020-06-11 2023-03-21 安然 Test development method based on monkey source code
CN111817916B (en) * 2020-07-02 2022-06-03 浙江同花顺智能科技有限公司 Test method, device, equipment and storage medium based on mobile terminal cluster
CN111897740B (en) * 2020-08-24 2023-06-13 抖音视界有限公司 User interface testing method and device, electronic equipment and computer readable medium
CN112612698A (en) * 2020-12-17 2021-04-06 平安普惠企业管理有限公司 Application program crash test method and related product
CN112882939B (en) * 2021-02-26 2022-09-02 北京百度网讯科技有限公司 Automatic testing method and device, electronic equipment and storage medium
CN113791974B (en) * 2021-08-25 2024-05-17 微梦创科网络科技(中国)有限公司 Explicit waiting method and device for user interface UI element
CN114978360A (en) * 2022-05-10 2022-08-30 紫光计算机科技有限公司 Automatic testing method and device for communication equipment, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5805792A (en) * 1989-07-31 1998-09-08 Texas Instruments Incorporated Emulation devices, systems, and methods
CN103530221A (en) * 2012-07-02 2014-01-22 北京大学 Method for mapping procedure behavior and interface operation in Android system
CN103823758A (en) * 2014-03-13 2014-05-28 北京金山网络科技有限公司 Browser testing method and device
CN104050076A (en) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 Testing method, device and system of application software on mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5805792A (en) * 1989-07-31 1998-09-08 Texas Instruments Incorporated Emulation devices, systems, and methods
CN103530221A (en) * 2012-07-02 2014-01-22 北京大学 Method for mapping procedure behavior and interface operation in Android system
CN104050076A (en) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 Testing method, device and system of application software on mobile terminal
CN103823758A (en) * 2014-03-13 2014-05-28 北京金山网络科技有限公司 Browser testing method and device

Also Published As

Publication number Publication date
CN104461900A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
CN104461900B (en) Test method, control server, test terminal and the system of user interface
CN108293081B (en) Deep linking of program playback to mobile application state through user interface events
CN104050076B (en) Application software testing method, apparatus and system on mobile terminal
WO2020155777A1 (en) Ui automated function testing method, testing device, testing apparatus, and storage medium
US10853232B2 (en) Adaptive system for mobile device testing
CN108647141A (en) Automatic test approach, device, computer-readable medium and electronic equipment
US10296444B1 (en) Methods and systems for testing mobile applications for android mobile devices
CN105808227B (en) A kind of fine arts resource file detection method and device
US9417992B2 (en) Web portal API test report generation
CN107015804B (en) Method and system for rapidly developing project by configuring API
CN106648556B (en) Method and device for front-end and back-end integrated development test
CN105868105A (en) Application traversal testing method and device, and mobile terminal
CN105653056B (en) The test method and device of input method
CN105183630B (en) Applied program testing method and device
CN109726098A (en) Interface test method, device and computer readable storage medium
JP2012133721A (en) Device and method for evaluating exhaustivity of a test
CN103559222B (en) Method and device for displaying page loading time in browsers
KR101335912B1 (en) The system and method for integrated management of test
CN110716853A (en) Test script recording method, application program testing method and related device
WO2017123203A1 (en) Determining visual testing coverages
US10877778B2 (en) Sequence detection and automation for complex portal environments
CN109684210A (en) A kind of website automation test method, device, equipment and readable storage medium storing program for executing
CN113094255A (en) Simulation test method, device and system for data interface
US9247013B2 (en) System for repetitively executing rules-based configurable business application operations
US10042638B2 (en) Evaluating documentation coverage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220719

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right