The content of the invention
It is a primary object of the present invention to provide the method for testing and server of a kind of user interface, it is intended to improve user circle
The formation efficiency of the test script in face.
To achieve the above object, the method for testing of a kind of user interface provided by the invention, methods described include following step
Suddenly:
Test server receive that user terminal in preset time sends with the user interface that is shown on the user terminal
Corresponding preset kind log information, the preset kind log information are that the user terminal is directed to the user in response user
During the operation behavior of the user interface shown in terminal, the preset kind log information for the operation behavior detected and recorded, institute
Stating preset kind log information includes operational controls information, action type information;
The preset kind log information of reception is parsed, included with to parse each preset kind log information
Operational controls information and action type information;
The operational controls information and/or action type information parsed is returned according to predetermined classification rule
Class, to determine each control to be tested, and action type corresponding to each control to be tested;
According to predetermined control, action type and the mapping relations for testing code to be tested, determine each to be measured
Try to test code corresponding to control, and based on test code building test script corresponding to each control to be tested, to utilize life
Into test script the user interface shown on the user terminal is tested.
Preferably, the predetermined classification rule includes:
Action type information corresponding to the operational controls information that parses is sorted out, identical operational controls are believed
Action type information corresponding to breath is classified as same Attribute class, and action type information corresponding to different operational controls information is returned
For different attribute class;
Using operational controls corresponding to each Attribute class as control to be tested, and by all operation classes under each Attribute class
Respective operations type of the type as control to be tested corresponding to the Attribute class.
Preferably, the predetermined classification rule includes:
Analyze whether operational controls corresponding to each Attribute class are included in default list of controls to be tested, if so, then
Using operational controls corresponding to the Attribute class as control to be tested.
Preferably, this method also includes:
According to the configuration file of the user interface, all configuration controls corresponding to the user interface are determined;
The each control to be tested determined is compared with each configuration control, to filter out in all configuration controls
It is not the configuration control of control to be tested;
Prompting message is generated, to remind the configuration control addition test code to filter out, and/or, remind for screening
The configuration control gone out carries out necessity inspection.
Preferably, the operational controls information includes the control title of operation, and the action type information, which includes clicking on, to be grasped
Work, slide, rolling operation and/or drag operation.
In addition, to achieve the above object, the present invention also provides a kind of test server of user interface, the testing service
Device includes:
Receiving module is that user terminal in preset time is sent with user circle that is being shown on the user terminal for receiving
Preset kind log information corresponding to face, the preset kind log information are that the user terminal is directed to the use in response user
During the operation behavior of the user interface shown in the terminal of family, the preset kind log information for the operation behavior detected and recorded,
The preset kind log information includes operational controls information, action type information;
Parsing module, for being parsed to the preset kind log information of reception, to parse each preset kind day
The operational controls information and action type information that will information is included;
Classifying module, return for the operational controls information to parsing and/or action type information according to predetermined
Rule-like is sorted out, to determine each control to be tested, and action type corresponding to each control to be tested;
Generation module, for according to predetermined control to be tested, action type and the mapping relations for testing code, really
Test code corresponding to each control to be tested is made, and based on test code building test pin corresponding to each control to be tested
This, to be tested using the test script of generation the user interface shown on the user terminal.
Preferably, the predetermined classification rule includes:
Action type information corresponding to the operational controls information that parses is sorted out, identical operational controls are believed
Action type information corresponding to breath is classified as same Attribute class, and action type information corresponding to different operational controls information is returned
For different attribute class;
Using operational controls corresponding to each Attribute class as control to be tested, and by all operation classes under each Attribute class
Respective operations type of the type as control to be tested corresponding to the Attribute class.
Preferably, the predetermined classification rule includes:
Analyze whether operational controls corresponding to each Attribute class are included in default list of controls to be tested, if so, then
Using operational controls corresponding to the Attribute class as control to be tested.
Preferably, the test server also includes:
Determining module, for the configuration file according to the user interface, determine all configurations corresponding to the user interface
Control;
Comparing module, for each control to be tested determined to be compared with each configuration control, to filter out
It is not the configuration control of control to be tested in all configuration controls;
Prompting module, for generating prompting message, to remind the configuration control addition test code to filter out, and/or,
Remind and carry out necessity inspection for the configuration control filtered out.
Preferably, the operational controls information includes the control title of operation, and the action type information, which includes clicking on, to be grasped
Work, slide, rolling operation and/or drag operation.
The method of testing and server of user interface proposed by the present invention, by test server to user in preset time
Terminal the is sent preset kind log information with corresponding to user interface that is being shown on the user terminal is parsed, and is obtained
Operational controls information and action type information corresponding to each preset kind log information;And determine each control to be tested and
Corresponding action type;According to predetermined control, action type and the mapping relations for testing code, determine each to be measured
Try test code corresponding to control, and user is carried out based on code building test script is tested corresponding to each control to be tested
Interface detection.By being parsed thus according to the log information generated for the operation behavior of user on a user interface, and
Corresponding to operational controls information and action type acquisition of information to each control to be tested according to corresponding to the operation behavior of user
Code is tested, can be automatically according to code building test script be tested corresponding to each control to be tested of acquisition, without exploitation
Personnel's manual compiling test script, efficiency is higher and not error-prone, moreover, in the version iteration at subsequent user interface, only needs
Test script can be automatically generated by reacquiring test code corresponding to each control to be tested after iteration, maintenance cost compared with
It is low.
Embodiment
In order that technical problems, technical solutions and advantages to be solved are clearer, clear, tie below
Drawings and examples are closed, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only
To explain the present invention, it is not intended to limit the present invention.
The present invention provides a kind of method of testing of user interface.
Reference picture 1, Fig. 1 are the schematic flow sheet of the method for testing first embodiment of user interface of the present invention.
In the first embodiment, the method for testing of the user interface includes:
Step S10, test server receive that user terminal in preset time sends with showing on the user terminal
Preset kind log information corresponding to user interface, the preset kind log information are the user terminal in response user's pin
During to the operation behavior of the user interface shown on the user terminal, the preset kind daily record for the operation behavior detected and recorded
Information, the preset kind log information include operational controls information, action type information;
In the present embodiment, on the user terminal where the predetermined user interface for needing to be tested, by the use
Family terminal in real time or periodic monitor each time user be directed to the user interface operation behavior, if monitoring, user is directed to the user
One operation behavior at interface is responded, then the user terminal is detected and records the preset kind daily record corresponding to the operation behavior
Information, the preset kind log information include operational controls information (such as the control title of operation, mark etc.) and operation
Type information, the action type information include but is not limited to clicking operation, slide, rolling operation, drag operation, pressing behaviour
Make etc..
In one embodiment, the user terminal can monitor user be directed to the user interface operation behavior when,
System log message is transferred, and operational controls information and behaviour corresponding to the operation behavior are extracted from system log message
Make type information.In another embodiment, be provided with log information acquisition module on the user terminal in advance, pass through the day
Will information acquisition module is detected in real time or periodically and records user each time for corresponding to the operation behavior of the user interface
Operational controls information and action type information.
Test server receives the preset kind day that the user terminal is sent (for example, in nearest 30 days) in preset time
Will information, to know that user is for the operational controls information corresponding to the operation behavior of the user interface and operation class each time
Type information.
Step S20, the preset kind log information of reception is parsed, to parse each preset kind log information
Comprising operational controls information and action type information;
Step S30, rule is sorted out according to predetermined to the operational controls information and/or action type information parsed
Sorted out, to determine each control to be tested, and action type corresponding to each control to be tested;
The test server parses to the preset kind log information of reception, parses each preset kind daily record
The operational controls information and action type information recorded in information.To user is directed to the user interface each time in preset time
Operational controls information and action type information corresponding to operation behavior are sorted out, and can such as be incited somebody to action by each operational controls information
Same class is classified as operational controls are same or like, can also by action type information by action type it is same or like return
For same class, can also be closed by predetermined same test code with a variety of operational controls information or the corresponding of action type information
System, the operational controls of a variety of operational controls information corresponding with same test code or action type information are classified as same class,
Etc..Of a sort operational controls are as a control to be tested after sorting out, it is determined that in the preset kind log information received
Each control to be tested, and the action type corresponding to each control to be tested.
Step S40, according to predetermined control, action type and the mapping relations for testing code to be tested, determine
Test code corresponding to each control to be tested, and test code building test script corresponding to each control to be tested is based on,
To be tested using the test script of generation the user interface shown on the user terminal.
After determining each control to be tested and its corresponding action type in the preset kind log information of reception,
Each control pair to be tested can be determined according to predetermined different controls, action type and the mapping relations for testing code
The test code answered.Due to the test code corresponding to same control and its corresponding action type be it is changeless, therefore,
The mapping relations between different controls, action type and test code can be predefined, are determining control to be tested and its right
After the action type answered, you can according to predetermined mapping relations, draw control to be tested and its corresponding action type
Corresponding modular test code.Determine to test after code corresponding to each control to be tested successively, you can to each
Test code corresponding to control to be tested the shirtsleeve operation such as is spliced, combined to generate final test script, to utilize
The test script of generation carries out the test of various action types to the user interface shown on the user terminal.
The present embodiment user terminal in preset time is sent by test server with being shown on the user terminal
User interface corresponding to preset kind log information parsed, obtain operating corresponding to each preset kind log information
Control information and action type information;And determine each control to be tested and corresponding action type;According to predetermined
Control, action type and the mapping relations for testing code, test code corresponding to each control to be tested is determined, and based on each
Code building test script is tested corresponding to individual control to be tested to carry out ui testing.By existing thus according to for user
The log information that operation behavior in user interface is generated is parsed, and control is operated according to corresponding to the operation behavior of user
Test code, can be treated automatically according to each of acquisition corresponding to part information and action type acquisition of information to each control to be tested
Test control corresponding to test code building test script, without developer's manual compiling test script, efficiency it is higher and
It is not error-prone, moreover, in the version iteration at subsequent user interface, each control pair to be tested after iteration only need to be reacquired
The test code answered can automatically generate test script, and maintenance cost is relatively low.
Further, in other embodiments, the predetermined classification rule includes:
Action type information corresponding to the operational controls information that parses is sorted out, identical operational controls are believed
Action type information corresponding to breath is classified as same Attribute class, and action type information corresponding to different operational controls information is returned
For different attribute class;
Using operational controls corresponding to each Attribute class as control to be tested, and by all operation classes under each Attribute class
Respective operations type of the type as control to be tested corresponding to the Attribute class.
In the present embodiment when the operational controls information to parsing and action type information are sorted out, with operational controls
Information, which is defined, to be sorted out, can be by identical control title and its right such as when control title of the operational controls information for operation
The action type information answered is classified as same Attribute class, and different control titles and its corresponding action type information are classified as not belonging to together
Property class.Using operational controls corresponding to same control title as control to be tested, and by all operations under same control title
Respective operations type of the type as the control to be tested.Due to the test corresponding to operational controls corresponding to same control title
Code all same is similar, therefore, identical control title and its corresponding action type information is classified as into same Attribute class, can incite somebody to action
The corresponding test same or analogous operational controls of code are classified as one kind so that subsequently according to predetermined control, operation
, only need to be according to same generic operation when type and the mapping relations of test code determine test code corresponding to each control to be tested
The different operating type of control finds test code corresponding to each action type, and without to each identical or different operation
The operational controls of control information are searched, and simplify search procedure, determine test code corresponding to each control to be tested
It is more efficient.
Further, in other embodiments, the predetermined rule of sorting out also includes:
Analyze whether operational controls corresponding to each Attribute class are included in default list of controls to be tested, if so, then
Using operational controls corresponding to the Attribute class as control to be tested.
In the present embodiment, action type information corresponding to identical operational controls information is being classified as same Attribute class, will
Action type information corresponding to different operational controls information is classified as after different attribute class, also to behaviour corresponding to each Attribute class
Screened as control, whether operational controls are included in default list of controls to be tested as corresponding to can analyze each Attribute class
In, if so, just using operational controls corresponding to the Attribute class as control to be tested.So, user can be according in practical application
Test is needed to set a list of controls to be tested, such as can be different according to the emphasis point tested every time, can be increased or be deleted to be measured
Try the control list to be tested in list of controls, you can control the control to be tested corresponding to the test code subsequently determined to be somebody's turn to do
Control to be tested needed for secondary test, the self-defined acquisition of test code is realized, can more flexibly generate required test pin
This, practicality is higher.
As shown in Fig. 2 second embodiment of the invention proposes a kind of method of testing of user interface, in the base of above-described embodiment
On plinth, also include after above-mentioned steps S30:
Step S50, according to the configuration file of the user interface, determine all configuration controls corresponding to the user interface;
Step S60, each control to be tested determined is compared with each configuration control, to filter out all match somebody with somebody
Put in control be not control to be tested configuration control;
Step S70, prompting message is generated, to remind the configuration control addition test code to filter out, and/or, remind
Necessity inspection is carried out for the configuration control filtered out.
In the present embodiment, sort out rule according to predetermined in the operational controls information to parsing and action type information
After then being sorted out and determining each control to be tested, further, always according to the configuration file of the user interface, it is determined that
Go out all configuration controls corresponding to the user interface, and each control to be tested determined and each configuration control are compared
It is right, with filter out it is all configuration controls in be not control to be tested configuration control.Because each control to be tested is based on use
Family is determined for the operation behavior of the user interface, and user is possible to not have for the operation behavior of the user interface
All controls being related in the user interface.Therefore, the user interface is tested comprehensively, then it is each by what is determined
Control to be tested is compared with all configuration controls corresponding to the user interface, and it is not to be measured to filter out in all configuration controls
The configuration control of control is tried, the configuration control filtered out is that user is not involved with for the operation behavior of the user interface
The user interface on control.Then generate prompting message and such as send prompting message to predetermined terminal, to remind as sieve
The configuration control addition test code selected, and/or, remind and carry out necessity inspection for the configuration control filtered out, think
It is necessary the configuration control addition test code tested, and the test code of addition is corresponding with each control to be tested
Test code combines to form final complete test script together, more comprehensively to test user interface.
The present invention further provides a kind of test server of user interface.
Reference picture 3, Fig. 3 are the high-level schematic functional block diagram of the test server first embodiment of user interface of the present invention.
In the first embodiment, the test server of the user interface includes:
Receiving module 01 is that user terminal in preset time is sent with user that is being shown on the user terminal for receiving
Preset kind log information corresponding to interface, the preset kind log information are that the user terminal is responding user for being somebody's turn to do
During the operation behavior of the user interface shown on user terminal, the preset kind daily record letter for the operation behavior detected and recorded
Breath, the preset kind log information include operational controls information, action type information;
In the present embodiment, on the user terminal where the predetermined user interface for needing to be tested, by the use
Family terminal in real time or periodic monitor each time user be directed to the user interface operation behavior, if monitoring, user is directed to the user
One operation behavior at interface is responded, then the user terminal is detected and records the preset kind daily record corresponding to the operation behavior
Information, the preset kind log information include operational controls information (such as the control title of operation, mark etc.) and operation
Type information, the action type information include but is not limited to clicking operation, slide, rolling operation, drag operation, pressing behaviour
Make etc..
In one embodiment, the user terminal can monitor user be directed to the user interface operation behavior when,
System log message is transferred, and operational controls information and behaviour corresponding to the operation behavior are extracted from system log message
Make type information.In another embodiment, be provided with log information acquisition module on the user terminal in advance, pass through the day
Will information acquisition module is detected in real time or periodically and records user each time for corresponding to the operation behavior of the user interface
Operational controls information and action type information.
Test server receives the preset kind day that the user terminal is sent (for example, in nearest 30 days) in preset time
Will information, to know that user is for the operational controls information corresponding to the operation behavior of the user interface and operation class each time
Type information.
Parsing module 02, for being parsed to the preset kind log information of reception, to parse each preset kind
The operational controls information and action type information that log information is included;
Classifying module 03, for the operational controls information to parsing and/or action type information according to predetermined
Sort out rule to be sorted out, to determine each control to be tested, and action type corresponding to each control to be tested;
The test server parses to the preset kind log information of reception, parses each preset kind daily record
The operational controls information and action type information recorded in information.To user is directed to the user interface each time in preset time
Operational controls information and action type information corresponding to operation behavior are sorted out, and can such as be incited somebody to action by each operational controls information
Same class is classified as operational controls are same or like, can also by action type information by action type it is same or like return
For same class, can also be closed by predetermined same test code with a variety of operational controls information or the corresponding of action type information
System, the operational controls of a variety of operational controls information corresponding with same test code or action type information are classified as same class,
Etc..Of a sort operational controls are as a control to be tested after sorting out, it is determined that in the preset kind log information received
Each control to be tested, and the action type corresponding to each control to be tested.
Generation module 04, for according to predetermined control to be tested, action type and the mapping relations for testing code,
Test code corresponding to each control to be tested is determined, and based on test code building test corresponding to each control to be tested
Script, to be tested using the test script of generation the user interface shown on the user terminal.
After determining each control to be tested and its corresponding action type in the preset kind log information of reception,
Each control pair to be tested can be determined according to predetermined different controls, action type and the mapping relations for testing code
The test code answered.Due to the test code corresponding to same control and its corresponding action type be it is changeless, therefore,
The mapping relations between different controls, action type and test code can be predefined, are determining control to be tested and its right
After the action type answered, you can according to predetermined mapping relations, draw control to be tested and its corresponding action type
Corresponding modular test code.Determine to test after code corresponding to each control to be tested successively, you can to each
Test code corresponding to control to be tested the shirtsleeve operation such as is spliced, combined to generate final test script, to utilize
The test script of generation carries out the test of various action types to the user interface shown on the user terminal.
The present embodiment user terminal in preset time is sent by test server with being shown on the user terminal
User interface corresponding to preset kind log information parsed, obtain operating corresponding to each preset kind log information
Control information and action type information;And determine each control to be tested and corresponding action type;According to predetermined
Control, action type and the mapping relations for testing code, test code corresponding to each control to be tested is determined, and based on each
Code building test script is tested corresponding to individual control to be tested to carry out ui testing.By existing thus according to for user
The log information that operation behavior in user interface is generated is parsed, and control is operated according to corresponding to the operation behavior of user
Test code, can be treated automatically according to each of acquisition corresponding to part information and action type acquisition of information to each control to be tested
Test control corresponding to test code building test script, without developer's manual compiling test script, efficiency it is higher and
It is not error-prone, moreover, in the version iteration at subsequent user interface, each control pair to be tested after iteration only need to be reacquired
The test code answered can automatically generate test script, and maintenance cost is relatively low.
Further, in other embodiments, the predetermined classification rule includes:
Action type information corresponding to the operational controls information that parses is sorted out, identical operational controls are believed
Action type information corresponding to breath is classified as same Attribute class, and action type information corresponding to different operational controls information is returned
For different attribute class;
Using operational controls corresponding to each Attribute class as control to be tested, and by all operation classes under each Attribute class
Respective operations type of the type as control to be tested corresponding to the Attribute class.
In the present embodiment when the operational controls information to parsing and action type information are sorted out, with operational controls
Information, which is defined, to be sorted out, can be by identical control title and its right such as when control title of the operational controls information for operation
The action type information answered is classified as same Attribute class, and different control titles and its corresponding action type information are classified as not belonging to together
Property class.Using operational controls corresponding to same control title as control to be tested, and by all operations under same control title
Respective operations type of the type as the control to be tested.Due to the test corresponding to operational controls corresponding to same control title
Code all same is similar, therefore, identical control title and its corresponding action type information is classified as into same Attribute class, can incite somebody to action
The corresponding test same or analogous operational controls of code are classified as one kind so that subsequently according to predetermined control, operation
, only need to be according to same generic operation when type and the mapping relations of test code determine test code corresponding to each control to be tested
The different operating type of control finds test code corresponding to each action type, and without to each identical or different operation
The operational controls of control information are searched, and simplify search procedure, determine test code corresponding to each control to be tested
It is more efficient.
Further, in other embodiments, the predetermined rule of sorting out also includes:
Analyze whether operational controls corresponding to each Attribute class are included in default list of controls to be tested, if so, then
Using operational controls corresponding to the Attribute class as control to be tested.
In the present embodiment, action type information corresponding to identical operational controls information is being classified as same Attribute class, will
Action type information corresponding to different operational controls information is classified as after different attribute class, also to behaviour corresponding to each Attribute class
Screened as control, whether operational controls are included in default list of controls to be tested as corresponding to can analyze each Attribute class
In, if so, just using operational controls corresponding to the Attribute class as control to be tested.So, user can be according in practical application
Test is needed to set a list of controls to be tested, such as can be different according to the emphasis point tested every time, can be increased or be deleted to be measured
Try the control list to be tested in list of controls, you can control the control to be tested corresponding to the test code subsequently determined to be somebody's turn to do
Control to be tested needed for secondary test, the self-defined acquisition of test code is realized, can more flexibly generate required test pin
This, practicality is higher.
As shown in figure 4, second embodiment of the invention proposes a kind of test server of user interface, in above-described embodiment
On the basis of, in addition to:
Determining module 05, for the configuration file according to the user interface, determine all corresponding to the user interface match somebody with somebody
Put control;
Comparing module 06, for each control to be tested determined to be compared with each configuration control, with screening
Go out it is all configuration controls in be not control to be tested configuration control;
Prompting module 07, for generating prompting message, code is tested to remind to add for the configuration control filtered out, and/
Or, remind and carry out necessity inspection for the configuration control filtered out.
In the present embodiment, sort out rule according to predetermined in the operational controls information to parsing and action type information
After then being sorted out and determining each control to be tested, further, always according to the configuration file of the user interface, it is determined that
Go out all configuration controls corresponding to the user interface, and each control to be tested determined and each configuration control are compared
It is right, with filter out it is all configuration controls in be not control to be tested configuration control.Because each control to be tested is based on use
Family is determined for the operation behavior of the user interface, and user is possible to not have for the operation behavior of the user interface
All controls being related in the user interface.Therefore, the user interface is tested comprehensively, then it is each by what is determined
Control to be tested is compared with all configuration controls corresponding to the user interface, and it is not to be measured to filter out in all configuration controls
The configuration control of control is tried, the configuration control filtered out is that user is not involved with for the operation behavior of the user interface
The user interface on control.Then generate prompting message and such as send prompting message to predetermined terminal, to remind as sieve
The configuration control addition test code selected, and/or, remind and carry out necessity inspection for the configuration control filtered out, think
It is necessary the configuration control addition test code tested, and the test code of addition is corresponding with each control to be tested
Test code combines to form final complete test script together, more comprehensively to test user interface.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or device including a series of elements not only include those key elements, and
And also include the other element being not expressly set out, or also include for this process, method, article or device institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Other identical element also be present in the process of key element, method, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to realized by hardware, but a lot
In the case of the former be more preferably embodiment.Based on such understanding, technical scheme is substantially in other words to existing
The part that technology contributes can be embodied in the form of software product, and the computer software product is stored in a storage
In medium (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone, calculate
Machine, server, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
Above by reference to the preferred embodiments of the present invention have been illustrated, not thereby limit to the interest field of the present invention.On
State that sequence number of the embodiment of the present invention is for illustration only, do not represent the quality of embodiment.Patrolled in addition, though showing in flow charts
Order is collected, but in some cases, can be with the step shown or described by being performed different from order herein.
Those skilled in the art do not depart from the scope of the present invention and essence, can have a variety of flexible programs to realize the present invention,
It can be used for another embodiment for example as the feature of one embodiment and obtain another embodiment.All technologies with the present invention
The all any modification, equivalent and improvement made within design, all should be within the interest field of the present invention.