Summary of the invention
The embodiment of the present application provides a kind of method of testing and equipment, in order to solve UI present in prior artAutomatization's framework test efficiency comparison is low, the problem that stability is poor.
On the one hand, a kind of method of testing that the embodiment of the present application provides, the method includes:
From at least one picture being pre-configured with, select and target software need the user interface of testThe picture joined, wherein said picture is the sectional drawing of the control in the user interface needing test;
Determine the operation that the picture of selection is corresponding, and according to the operation determined, described user interface is carried outTest.
Owing to can be changed at attribute by images match mode orient control, the software page loads and prolongsTime etc. situation when occurring also will not orient control failure, thus improve UI automatization framework test efficiency withAnd stability.
Optionally, determine the operation that the picture of selection is corresponding, including:
According to picture set in advance and the corresponding relation of operation, determine the operation that the picture of selection is corresponding.
Owing to can determine that the picture of selection is corresponding according to picture set in advance and the corresponding relation of operationOperation such that it is able to accurately determine the operation that the picture of selection is corresponding.
Optionally, select from least one picture being pre-configured with and target software needs the user testedBefore the picture of interphase match, also include:
Determine that described target software runs on the equipment supporting described target software.
Owing to, after determining that described target software runs on the equipment supporting described target software, carrying out pictureCoupling, thus add the application scenarios of test.
Optionally, select from least one picture being pre-configured with and target software needs the user testedBefore the picture of interphase match, also include:
If it is determined that described target software needs to run in the simulator supporting described target software, from supporting instituteState and the simulator of target software runs described target software.
Owing to determining that described target software needs in the simulator supporting described target software after operation, energyEnough from the simulator supporting described target software, run described target software, it is not necessary to run manually,Thus add the efficiency of test.
Optionally, before running described target software from the simulator supporting described target software, also include:
Determine the store path of the installation procedure of described target software;
According to the described store path determined, described simulator runs described installation procedure described mesh is installedMark software.
Owing to can automatically install described target software, thus add the efficiency of test.
Optionally, select from least one picture being pre-configured with and target software needs the user testedBefore the picture of interphase match, also include:
After receiving the reading instruction controlling server transmission, download from code server and survey with needsThe code information corresponding to user interface of examination, in order to automatically to test.
On the other hand, a kind of test equipment that the embodiment of the present application provides, this equipment includes:
Select module, for selecting from least one picture being pre-configured with and target software needing testUser interface coupling picture, wherein said picture be need test user interface in control cutFigure;
Processing module, for determining the operation that the picture of selection is corresponding, and according to the operation determined, describedTest in user interface.
Optionally, described processing module specifically for:
When the operation that the picture determining selection is corresponding, according to picture set in advance and the corresponding pass of operationSystem, determines the operation that the picture of selection is corresponding.
Optionally, described selection module is additionally operable to:
After determining that described target software runs on the equipment supporting described target software, from be pre-configured withAt least one picture selects the picture mated with the user interface needing test in target software.
Optionally, described selection module is additionally operable to:
From at least one picture being pre-configured with, select and target software need the user interface of testBefore the picture joined, however, it is determined that described target software needs to transport in the simulator supporting described target softwareOK, from the simulator supporting described target software, described target software is run.
Optionally, described selection module is additionally operable to:
Determine the store path of the installation procedure of described target software;According to the described store path determined,Described simulator runs described installation procedure described target software is installed;From the mould supporting described target softwareIntend device runs described target software.
Optionally, described equipment also includes:
Control module, for receive control server send reading instruction after, from code server underCarry the code information that the user interface carrying out testing with needs is corresponding, and control according to described code information describedModule and described processing module is selected to test.
Detailed description of the invention
The embodiment of the present application selects to need test in target software from least one picture being pre-configured withThe picture of user interface coupling, and according to operation corresponding to picture selected, enterprising in described user interfaceRow test, wherein said picture is the sectional drawing of the control in the user interface needing test.Owing to passing throughImages match mode orient control, changes at attribute, the software page loads when the situation such as time delay occurs alsoWill not orient control failure, thus improve UI automatization framework test efficiency and stability.
Wherein, the target software of the embodiment of the present application can be the software supporting ios device;Can also be to prop upHold the software of other equipment.
Below in conjunction with Figure of description, the embodiment of the present application is described in further detail.
As it is shown in figure 1, the embodiment of the present application method of testing includes:
Step 101, from least one picture being pre-configured with select with target software in need test useThe picture of family interphase match, wherein said picture is the sectional drawing of the control in the user interface needing test;
Step 102, determine the operation that the picture of selection is corresponding, and according to the operation determined, described userOperate on interface.
The user interface needing test in target software is carried out sectional drawing, a user by the embodiment of the present application in advanceCan there be a sectional drawing at interface, it is possibility to have multiple sectional drawings.Optionally, each sectional drawing at least includes oneControl.
Such as user interface includes the control such as input frame, button, can cut a figure by input frame and buttonAll include;Can also cut two figures respectively, one includes input frame, and one includes button.
When testing, owing to test environment is different, it is possible to target software needs supporting described targetRun on the equipment of software;It is likely to need in described simulator, run described installation procedure and described mesh is installedMark software.And different test environment subsequent processes is different.
Based on this, when carrying out ui testing, need to judge that described target software is the most described in supportRun on the equipment of target software.
Whether objectives software runs on the equipment supporting described target software can be by manually joining in advancePut;Can also automatically detect.
In the equipment supporting described target software, run described target software under introducing separately below and propping upHold the detailed process running described target software in the simulator of described target software.
Process one, support described target software equipment in run described target software.
If it is determined that run described target software in the equipment supporting described target software, can be directly from advanceAt least one picture first configured selects the picture mated with the user interface needing test in target software.
Illustrate with ios software, need user first to run ios software before testing, such as can useThe equipment supporting described target software is projected on test equipment, the most just by the mode of Veency+realVNCIt is that reality test equipment can control to support the ios software run on the equipment of described target software.AfterwardsJust can perform the scheme of the embodiment of the present application.
It is of course also possible to transported from the equipment supporting described target software by the executive agent of the embodiment of the present applicationRow ios software.
When mating, if the resolution of the user interface of the resolution of the picture being pre-configured with and displayInconsistent, the rate that can reduce that the match is successful, so needing to ensure the resolution of picture that is pre-configured with and displayThe resolution of user interface keeps consistent.The resolution of the picture being such as pre-configured with if 1920*1080,Then needing the resolution ensureing the user interface of display is also 1920*1080.
Due to when carrying out sectional drawing before, it may be possible to operational objective in the equipment supporting described target softwareThe sectional drawing carried out after software, it is also possible to run described target in the simulator supporting described target software softThe sectional drawing carried out after part.
If the sectional drawing carried out after operational objective software in the equipment supporting described target software, it is not necessary to adjustThe resolution of the user interface of whole display;
If the sectional drawing carried out after running described target software in the simulator supporting described target software, needThe resolution adjustment of the user interface of display is become consistent with the resolution of described simulator.
Adjustment mode can be by manually continuing adjustment, it is also possible to the config option automatically called in equipment is adjustedWhole.
Ensure the resolution of picture being pre-configured with keep with the resolution of the user interface of display consistent after,Can be carried out picture match.
Picture match is currently displaying user interface and each the picture being pre-configured with to be mated.Look forTo the picture including currently displaying all or part of user interface.Concrete matching way has a variety of, such asMay refer to current picture match mode, it would however also be possible to employ the mode of similar recognition of face.
Assume that currently displaying user interface has " sequence " button.Due to before can be by needs when sectional drawingControl in the page of test all carries out sectional drawing, comprises currently displaying so having one in sectional drawing beforeThe picture of " sequence " button in user interface, this picture is found by the purpose of coupling exactly.
In force, the corresponding relation of picture and operation can be configured in advance, according to picture set in advance and behaviourThe corresponding relation made, determines the operation that the picture of selection is corresponding.Owing to each picture can include at least oneControl, and the operation difference that different controls is corresponding.Such as sequence control needs operation to be performed to be to select notSame ordering rule (such as exchange hand sequence, credit rating sequence etc.), and click on rank button;Search controlPart needs operation to be performed to be to input search word in the search box, and clicks on search button.
Based on this, need the operation for different picture configuration correspondences, so after matching picture, just knowRoad carries out any operation in currently displaying user interface.
Operation corresponding to picture such as comprising search control is to input search word in the search box, and clicks on and searchRope button.After matching the picture comprising search control, determine that needs are in search according to above-mentioned corresponding relationFrame inputs search word, and clicks on search button, and input in the search box of currently displaying user interfaceSearch word, and simulate click search button, thus realize the search control to currently displaying user interfaceTest.
Process two, support described target software simulator in run described target software.
For process two, a kind of mode is the artificial simulation that target software is installed to support described target softwareIn device, and run.
In order to improve automatization's efficiency further, can manually be installed to target software support that described target is softIn the simulator of part, machine automatically run.
Concrete, after determining and running described target software in the simulator supporting described target software, fromSupport the simulator of described target software runs described target software.
Optionally, automatically run except machine, it is also possible to described target software is installed automatically by machine.
Concrete, determine after running described target software in the simulator supporting described target software, determineThe store path of the installation procedure of described target software;According to the described store path determined, in described simulationDevice runs described installation procedure described target software is installed, and from the simulator supporting described target softwareRun described target software.
Optionally, when installing described target software, software corresponding for described store path is extracted,And by the api interface provided inside Instruments Open Framework, described simulator runs described peaceDress program installs described target software.
From support described target software simulator run described target software after, from be pre-configured with toA few picture selects the picture mated with the user interface needing test in target software.
When mating, if the resolution of the user interface of the resolution of the picture being pre-configured with and displayInconsistent, the rate that can reduce that the match is successful, so needing to ensure the resolution of picture that is pre-configured with and displayThe resolution of user interface keeps consistent.The resolution of the picture being such as pre-configured with if 1920*1080,Then needing the resolution ensureing the user interface of display is also 1920*1080.
Due to when carrying out sectional drawing before, it may be possible to operational objective in the equipment supporting described target softwareThe sectional drawing carried out after software, it is also possible to run described target in the simulator supporting described target software softThe sectional drawing carried out after part.
If the sectional drawing carried out after operational objective software in the simulator supporting described target software, it is not necessary toAdjust the resolution of the user interface of display;
If the sectional drawing carried out after running described target software in the equipment supporting described target software, needThe resolution adjustment of the user interface of display is become consistent with the resolution of described simulator.
Adjustment mode can be by manually continuing adjustment, it is also possible to the config option automatically called in equipment is adjustedWhole.
Ensure the resolution of picture being pre-configured with keep with the resolution of the user interface of display consistent after,Can be carried out picture match.
Picture match is currently displaying user interface and each the picture being pre-configured with to be mated.Look forTo the picture including currently displaying all or part of user interface.Concrete matching way has a variety of, such asMay refer to current picture match mode, it would however also be possible to employ the mode of similar recognition of face.
Assume that currently displaying user interface has " sequence " button.Due to before can be by needs when sectional drawingControl in the page of test all carries out sectional drawing, comprises currently displaying so having one in sectional drawing beforeThe picture of " sequence " button in user interface, this picture is found by the purpose of coupling exactly.
In force, the corresponding relation of picture and operation can be configured in advance, according to picture set in advance and behaviourThe corresponding relation made, determines the operation that the picture of selection is corresponding.Owing to each picture can include at least oneControl, and the operation difference that different controls is corresponding.Such as sequence control needs operation to be performed to be to select notSame ordering rule (such as exchange hand sequence, credit rating sequence etc.), and click on rank button;Search controlPart needs operation to be performed to be to input search word in the search box, and clicks on search button.
Based on this, need the operation for different picture configuration correspondences, so after matching picture, just knowRoad carries out any operation in currently displaying user interface.
Operation corresponding to picture such as comprising search control is to input search word in the search box, and clicks on and searchRope button.After matching the picture comprising search control, determine that needs are in search according to above-mentioned corresponding relationFrame inputs search word, and clicks on search button, and input in the search box of currently displaying user interfaceSearch word, and simulate click search button, thus realize the search control to currently displaying user interfaceTest.
Wherein, the embodiment of the present application additionally provides a kind of test system framework, as in figure 2 it is shown, this system frameFrame includes controlling server (i.e. jenkins server in figure), code server (i.e. SVN in figure)With at least one test equipment (i.e. Mac agent equipment in figure).
The executive agent of the method for above-mentioned Fig. 1 tests equipment exactly.
In force, manually storing in code server by the code performing test, test equipment is by readingReplace code and can be achieved with the process of Fig. 1.
Owing to the embodiment of the present application can support that multiple test equipment tests user interface simultaneously, it is desirable to have oneCarry out the equipment of test dispatching.
Optionally, control server is after receiving test command, and the test equipment of notice current idle is testedUser interface.
Optionally, the code address that test command includes needing testing device downloads code is corresponding;
Accordingly, test equipment is after receiving the reading instruction controlling server transmission, according to the code receivedAddress downloads the code of correspondence from code server, and the code running download realizes test process.
Control server can in real time or the cycle checks whether available free test equipment (being i.e. completed),If it has, then continue the user interface of the test equipment test of notice current idle, until be there is a need to testUser interface all complete test.
Based on said system framework, the embodiment of the present application also provides for a kind of method of test dispatching.
Technical scheme that an example introduction under the embodiment of the present application complete is set forth below.
As it is shown on figure 3, the embodiment of the present application four method of testing includes:
Step 301, control server determine the most available free test equipment.
The user interface that step 302, the test equipment of control server notice current idle are tested.
Step 303, test equipment are after receiving the reading instruction controlling server transmission, from code serverMiddle download with need to carry out the code information that the user interface tested is corresponding, and hold according to the code information downloadedRow subsequent step.
Step 304, test equipment judge whether target software runs on the equipment supporting described target software,If it is, perform step 305;Otherwise, step 307 is performed.
Step 305, test equipment select to need in target software from least one picture being pre-configured withThe picture of the user interface coupling of test.
Step 306, test equipment determine the operation that the picture of selection is corresponding, and according to the operation determined,Test in described user interface, and after test completes, wait server to be controlled to send and read instruction.
Step 307, test equipment determine the store path of the installation procedure of described target software.
Step 308, test equipment, according to the described store path determined, run described in described simulatorInstallation procedure installs described target software.
Step 309, test equipment run described target software from the simulator supporting described target software.
Step 310, test equipment select to need in target software from least one picture being pre-configured withThe picture of the user interface coupling of test.
Step 311, test equipment determine the operation that the picture of selection is corresponding, and according to the operation determined,Test in described user interface, and after test completes, wait server to be controlled to send and read instruction.
Based on same inventive concept, the embodiment of the present application additionally provides a kind of test equipment, due to this equipmentThe principle of solution problem is similar to the embodiment of the present application method of testing, therefore the enforcement side of may refer to of this equipmentThe enforcement of method, repeats no more in place of repetition.
As shown in Figure 4, the embodiment of the present application test equipment includes:
Select module 401, for selecting to need in target software from least one picture being pre-configured withThe picture of the user interface coupling of test, wherein said picture is the control in the user interface needing testSectional drawing;
Processing module 402, for determining the operation that the picture of selection is corresponding, and according to the operation determined,Test in described user interface.
The user interface needing test in target software is carried out sectional drawing, a user by the embodiment of the present application in advanceCan there be a sectional drawing at interface, it is possibility to have multiple sectional drawings.Optionally, each sectional drawing at least includes oneControl.
Such as user interface includes the control such as input frame, button, can cut a figure by input frame and buttonAll include;Can also cut two figures respectively, one includes input frame, and one includes button.
When testing, owing to test environment is different, it is possible to target software needs supporting described targetRun on the equipment of software;It is likely to need in described simulator, run described installation procedure and described mesh is installedMark software.And different test environment subsequent processes is different.
Based on this, when carrying out ui testing, need to judge that described target software is the most described in supportRun on the equipment of target software.
Whether objectives software runs on the equipment supporting described target software can be by manually joining in advancePut;Can also automatically detect.
In the equipment supporting described target software, run described target software under introducing separately below and propping upHold the detailed process running described target software in the simulator of described target software.
Process one, support described target software equipment in run described target software.
Described selection module 401 is additionally operable to:
After determining that described target software runs on the equipment supporting described target software, can be directly from advanceAt least one picture first configured selects the picture mated with the user interface needing test in target software.
Illustrate with ios software, need user first to run ios software before testing, such as can useThe equipment supporting described target software is projected on test equipment, the most just by the mode of Veency+realVNCIt is that reality test equipment can control to support the ios software run on the equipment of described target software.AfterwardsJust can select to need in target software from least one picture being pre-configured with by described selection module 401The picture of user interface coupling to be tested.
It is of course also possible to by the selection module 401 of the embodiment of the present application from the equipment supporting described target softwareUpper operation ios software.
When mating, if the resolution of the user interface of the resolution of the picture being pre-configured with and displayInconsistent, the rate that can reduce that the match is successful, so needing to ensure the resolution of picture that is pre-configured with and displayThe resolution of user interface keeps consistent.The resolution of the picture being such as pre-configured with if 1920*1080,Then needing the resolution ensureing the user interface of display is also 1920*1080.
Due to when carrying out sectional drawing before, it may be possible to operational objective in the equipment supporting described target softwareThe sectional drawing carried out after software, it is also possible to run described target in the simulator supporting described target software softThe sectional drawing carried out after part.
If the sectional drawing carried out after operational objective software in the equipment supporting described target software, it is not necessary to adjustThe resolution of the user interface of whole display;
If the sectional drawing carried out after running described target software in the simulator supporting described target software, needThe resolution adjustment of the user interface of display is become consistent with the resolution of described simulator.
Adjustment mode can be by manually continuing adjustment, it is also possible to is automatically called in equipment by selecting module 401Config option is adjusted.
Ensure the resolution of picture being pre-configured with keep with the resolution of the user interface of display consistent after,Can be carried out picture match.
Picture match is currently displaying user interface and each the picture being pre-configured with to be mated.Look forTo the picture including currently displaying all or part of user interface.Concrete matching way has a variety of, such asMay refer to current picture match mode, it would however also be possible to employ the mode of similar recognition of face.
Assume that currently displaying user interface has " sequence " button.Due to before can be by needs when sectional drawingControl in the page of test all carries out sectional drawing, comprises currently displaying so having one in sectional drawing beforeThe picture of " sequence " button in user interface, this picture is found by the purpose of coupling exactly.
In force, can configure the corresponding relation of picture and operation in advance, processing module 402 is according to setting in advanceFixed picture and the corresponding relation of operation, determine the operation that the picture of selection is corresponding.Owing to each picture canIncluding at least one control, and the operation difference that different controls is corresponding.Such as sequence control needs executionOperation is to select different ordering rules (such as exchange hand sequence, credit rating sequence etc.), and clicks on sequenceButton;Search control needs operation to be performed to be to input search word in the search box, and clicks on search button.
Based on this, need the operation for different picture configuration correspondences, so after matching picture, just knowRoad carries out any operation in currently displaying user interface.
Operation corresponding to picture such as comprising search control is to input search word in the search box, and clicks on and searchRope button.After matching the picture comprising search control, determine that needs are in search according to above-mentioned corresponding relationFrame inputs search word, and clicks on search button, and input in the search box of currently displaying user interfaceSearch word, and simulate click search button, thus realize the search control to currently displaying user interfaceTest.
Process two, support described target software simulator in run described target software.
For process two, a kind of mode is the artificial simulation that target software is installed to support described target softwareIn device, and run.
In order to improve automatization's efficiency further, can manually be installed to target software support that described target is softIn the simulator of part, machine automatically run.
Concrete, described selection module 401 selects and target software from least one picture being pre-configured withBefore the picture of the middle user interface coupling needing test, however, it is determined that described target software needs in support describedThe simulator of target software runs, from the simulator supporting described target software, runs described target softPart.
Optionally, automatically run except machine, it is also possible to described target software is installed automatically by machine.
Concrete, described selection module 401 determines the store path of the installation procedure of described target software;RootAccording to the described store path determined, described simulator runs the described target of described installation procedure installation softPart;Described target software is run from the simulator supporting described target software.
Optionally, when installing described target software, described selection module 401 is corresponding by described store pathSoftware extract, and by the api interface provided inside Instruments Open Framework, at described mouldIntend that device runs described installation procedure and described target software is installed.
After running described target software from the simulator supporting described target software, described selection module401 select to mate with the user interface needing test in target software from least one picture being pre-configured withPicture.
When mating, if the resolution of the user interface of the resolution of the picture being pre-configured with and displayInconsistent, the rate that can reduce that the match is successful, so needing to ensure the resolution of picture that is pre-configured with and displayThe resolution of user interface keeps consistent.The resolution of the picture being such as pre-configured with if 1920*1080,Then needing the resolution ensureing the user interface of display is also 1920*1080.
Due to when carrying out sectional drawing before, it may be possible to operational objective in the equipment supporting described target softwareThe sectional drawing carried out after software, it is also possible to run described target in the simulator supporting described target software softThe sectional drawing carried out after part.
If the sectional drawing carried out after operational objective software in the simulator supporting described target software, it is not necessary toAdjust the resolution of the user interface of display;
If the sectional drawing carried out after running described target software in the equipment supporting described target software, needThe resolution adjustment of the user interface of display is become consistent with the resolution of described simulator.
Adjustment mode can be by manually continuing adjustment, it is also possible to is automatically called equipment by described selection module 401In config option be adjusted.
Ensure the resolution of picture being pre-configured with keep with the resolution of the user interface of display consistent after,Can be carried out picture match.
Picture match is currently displaying user interface and each the picture being pre-configured with to be mated.Look forTo the picture including currently displaying all or part of user interface.Concrete matching way has a variety of, as long asThe mode that two pictures compare can be carried out and be all suitable for the embodiment of the present application, such as can use compare picture andThe pixel-wise of user interface carries out images match.
Assume that currently displaying user interface has " sequence " button.Due to before can be by needs when sectional drawingControl in the page of test all carries out sectional drawing, comprises currently displaying so having one in sectional drawing beforeThe picture of " sequence " button in user interface, this picture is found by the purpose of coupling exactly.
In force, can configure the corresponding relation of picture and operation in advance, processing module 402 is according to setting in advanceFixed picture and the corresponding relation of operation, determine the operation that the picture of selection is corresponding.Owing to each picture canIncluding at least one control, and the operation difference that different controls is corresponding.Such as sequence control needs executionOperation is to select different ordering rules (such as exchange hand sequence, credit rating sequence etc.), and clicks on sequenceButton;Search control needs operation to be performed to be to input search word in the search box, and clicks on search button.
Based on this, need the operation for different picture configuration correspondences, so after matching picture, just knowRoad carries out any operation in currently displaying user interface.
Operation corresponding to picture such as comprising search control is to input search word in the search box, and clicks on and searchRope button.After matching the picture comprising search control, determine that needs are in search according to above-mentioned corresponding relationFrame inputs search word, and clicks on search button, and input in the search box of currently displaying user interfaceSearch word, and simulate click search button, thus realize the search control to currently displaying user interfaceTest.
Optionally, the equipment of the embodiment of the present application also includes:
Control module 403, for after receiving the reading instruction controlling server transmission, from code serverMiddle download with need to carry out the code information that the user interface tested is corresponding, and control according to described code informationDescribed selection module 401 and described processing module 402 are tested.
It is to say, the content that selection module 401 described above and described processing module 402 perform is all by controllingMolding block 403 controls.
The mode controlled can be to notify how described selection module 401 and described processing module 402 perform,Can also be code information to be sent to described selection module 401 and described processing module 402, by described choosingSelect module 401 and described processing module 402 and perform aforesaid operations according to code information.
Obviously, those skilled in the art can carry out various change and modification without deviating from this Shen to the applicationSpirit and scope please.So, if the application these amendment and modification belong to the application claim andWithin the scope of its equivalent technologies, then the application is also intended to comprise these change and modification.