Summary of the invention
Record the problems referred to above existed for existing script, a kind of the script recording system and the method that are intended to realize discharging the automatic recording script of manpower are now provided.
Concrete technical scheme is as follows:
A kind of script recording system, is applied in the test of mobile terminal, comprises:
One acquiring unit, connects mobile terminal to be tested, in order to obtain the current screen image of described mobile terminal to be measured;
One display unit, connects described acquiring unit, and described display unit provides an indicating template, and described indicating template is in order to show described current screen image;
One processing unit, connects described acquiring unit and described display unit respectively, in order to the size relationship of current screen image of the image and described mobile terminal to be measured that calculate the display of described indicating template;
One input block, connects described display unit, inputs cursor operations signal in order on the image that shows at described indicating template;
One control module, connects described input block, described display unit and described processing unit respectively, in order to according to described size relationship described cursor operations signal to be converted to the coordinate information relative to described mobile terminal to be measured, and exports;
One record cell, connects described control module, in order to record the coordinate information that cursor operation signal operates on described indicating template, to form test script.
Preferably, described acquiring unit is in order to obtain the current screen image of described mobile terminal to be measured in the predetermined space moment.
Preferably, described coordinate information, in order to described cursor operations signal to be converted to the coordinate information relative to described indicating template operates, to be converted to the coordinate information relative to described mobile terminal to be measured according to described size relationship, and to export by described control module.
Preferably, the coordinate information relative to described mobile terminal to be measured is sent to described mobile terminal to be measured by adb order by described control module, to call the operation corresponding to position of the described mobile terminal to be measured of the capable click of default jar contracted affreightment.
A kind of script method for recording, is applied in the test of mobile terminal, provides an indicating template, comprise the steps:
S1. the current screen image of mobile terminal to be measured is obtained;
S2. on described indicating template, described current screen image is shown;
S3. the size relationship of the image of described indicating template display and the current screen image of described mobile terminal to be measured is calculated;
S4. be received in described indicating template display image on input cursor operations signal;
S5. described cursor operations signal is converted to the coordinate information relative to described mobile terminal to be measured according to described size relationship, and exports;
S6. the coordinate information that cursor operation signal operates on described indicating template is recorded, to form test script.
Preferably, in described step S1, obtain the current screen image of described mobile terminal to be measured in the predetermined space moment.
Preferably, the detailed process of described step S5 is: described cursor operations signal is converted to the coordinate information relative to described indicating template operates, described coordinate information is converted to the coordinate information relative to described mobile terminal to be measured according to described size relationship, and exports.
Preferably, in described step S5, the coordinate information relative to described mobile terminal to be measured is sent to described mobile terminal to be measured by adb order, to call the operation corresponding to position of the described mobile terminal to be measured of the capable click of default jar contracted affreightment.
A kind of test macro, apply script recording system described above, comprising:
One mechanical arm, connects described control module, and described control module, according to the described coordinate information in described record cell, controls the operation corresponding to position that described mobile terminal to be measured clicked by described mechanical arm.
A kind of method of testing, applies script method for recording described above, provides a mechanical arm, comprising: according to the described coordinate information in described test script, controls the operation corresponding to position that described mobile terminal to be measured clicked by described mechanical arm.
The beneficial effect of technique scheme:
In the technical program, script recording system adopts processing unit can obtain the image of display unit display and the size relationship of mobile terminal current screen image to be measured, utilize control module cursor operations signal can be converted to coordinate information relative to mobile terminal to be measured, the coordinate information of cursor operation signal can be recorded by record cell, to form test script, manpower automatic recording script can be discharged.Script method for recording is by obtaining the current screen image of mobile terminal to be measured with the size relationship of the current screen image of the image and mobile terminal to be measured that calculate indicating template display, thus cursor operations signal is converted to the coordinate information relative to mobile terminal to be measured according to size relationship, to export, mobile terminal to be measured is tested accordingly, manpower automatic recording script can be discharged.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite of not making creative work, all belongs to the scope of protection of the invention.
It should be noted that, when not conflicting, the embodiment in the present invention and the feature in embodiment can combine mutually.
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
As shown in Figure 1, a kind of script recording system, is applied in the test of mobile terminal, comprises:
One acquiring unit 1, connects mobile terminal to be tested, in order to obtain the current screen image of mobile terminal to be measured;
One display unit 2, connect acquiring unit 1, display unit 2 provides an indicating template, and indicating template is in order to show current screen image;
One processing unit 4, connects acquiring unit 1 and display unit 2 respectively, in order to the size relationship of the current screen image of the image and mobile terminal to be measured that calculate indicating template display;
One input block 3, connects display unit 2, inputs cursor operations signal in order on the image that shows at indicating template;
One control module 5, connects input block 3, display unit 2 and processing unit 4 respectively, in order to according to size relationship cursor operations signal to be converted to the coordinate information relative to mobile terminal to be measured, and exports;
One record cell 6, connection control unit 5, in order to record the coordinate information that cursor operation signal operates on indicating template, to form test script.
A progressive ground, coordinate information is recorded in txt file by record cell 6, records a test case, and txt file is exactly one and records content for script.
In the present embodiment, script recording system adopts processing unit 4 can obtain the image of display unit 2 display and the size relationship of mobile terminal current screen image to be measured, utilize control module 5 cursor operations signal can be converted to coordinate information relative to mobile terminal to be measured, the coordinate information of cursor operation signal can be recorded by record cell 6, to form test script, manpower automatic recording script can be discharged.
In a preferred embodiment, acquiring unit 1 is in order to obtain the current screen image of mobile terminal to be measured in the predetermined space moment.
In the present embodiment, acquiring unit 1 can comprise a timer, is shown on indicating template to make the snapshot picture of acquiring unit 1 timing acquisition mobile terminal to be measured.Thus reach the function of real-time recording mobile terminal screen image to be measured.
In a preferred embodiment, coordinate information, in order to cursor operations signal to be converted to the coordinate information relative to indicating template operates, to be converted to the coordinate information relative to mobile terminal to be measured according to size relationship, and to export by control module 5.
In the present embodiment, by the algorithm process of processing unit 4, the proportionate relationship of the screen size that the indicating template calculating mobile terminal screen size to be measured and display unit 2 shows, the changing coordinates information adopting control module 5 cursor to be clicked indicating template is converted to the coordinate information relative to the current screen clicking mobile terminal to be measured, and exports corresponding click signal.
In a preferred embodiment, the coordinate information relative to mobile terminal to be measured is sent to mobile terminal to be measured by adb order by control module 5, to call the capable operation corresponding to position clicking mobile terminal to be measured of default jar contracted affreightment.
In the present embodiment, control module 5 is wrapped by the jar that adb command calls is compiled to run the correspondence position clicking mobile terminal screen to be measured.
As shown in Figure 2, a kind of script method for recording, is applied in the test of mobile terminal, provides an indicating template, comprises the steps:
S1. the current screen image of mobile terminal to be measured is obtained;
S2. on indicating template, current screen image is shown;
S3. the size relationship of the image of indicating template display and the current screen image of mobile terminal to be measured is calculated;
S4. be received in indicating template display image on input cursor operations signal;
S5. cursor operations signal is converted to the coordinate information relative to mobile terminal to be measured according to size relationship, and exports;
S6. the coordinate information that cursor operation signal operates on indicating template is recorded, to form test script.
A progressive ground, can be recorded in txt file by coordinate information, record a test case, and txt file is exactly one and records content for script.
In the present embodiment, script method for recording is by obtaining the current screen image of mobile terminal to be measured with the size relationship of the current screen image of the image and mobile terminal to be measured that calculate indicating template display, thus cursor operations signal is converted to the coordinate information relative to mobile terminal to be measured according to size relationship, to export, mobile terminal to be measured is tested accordingly, manpower automatic recording script can be discharged.
In a preferred embodiment, in step sl, the current screen image of mobile terminal to be measured is obtained in the predetermined space moment.
In the present embodiment, a timer can be provided, with the snapshot picture of timing acquisition mobile terminal to be measured, and be shown on indicating template.Thus reach the function of real-time recording mobile terminal screen image to be measured.
In a preferred embodiment, the detailed process of step S5 is: cursor operations signal is converted to the coordinate information relative to indicating template operates, and coordinate information is converted to the coordinate information relative to mobile terminal to be measured, and exports according to size relationship.
In the present embodiment, pass through algorithm process, the proportionate relationship of the screen size that the indicating template calculating mobile terminal screen size to be measured and display unit 2 shows, changing coordinates information cursor being clicked indicating template is converted to the coordinate information of the current screen relative to click mobile terminal to be measured, and exports corresponding click signal.
In a preferred embodiment, in step s 5, the coordinate information relative to mobile terminal to be measured is sent to mobile terminal to be measured by adb order, to call the capable operation corresponding to position clicking mobile terminal to be measured of default jar contracted affreightment.
In the present embodiment, wrapped by the jar that adb command calls is compiled to run the correspondence position clicking mobile terminal screen to be measured.
A kind of test macro, apply script recording system described above, comprising:
One mechanical arm, connection control unit 5, control module 5, according to the coordinate information in record cell 6, controls the operation corresponding to position that mobile terminal to be measured clicked by mechanical arm.
In the present embodiment, script recording system can carry out automatic test on third-party testing platform, coordinate information in txt file in record cell 6 can be changed into by control module 5 language that mechanical arm can identify, run by UART (UniversalAsynchronousReceiver/Transmitter, universal asynchronous receiving-transmitting transmitter) protocol integrated test system mechanical arm; Coordinate corresponding on mobile terminal screen to be measured is clicked according to the coordinate information in txt file to make mechanical arm.To realize continual and steady test, release manpower, promotes the object of Consumer's Experience.
Composition graphs 3 illustrates the course of work of test macro: mechanical arm adopts 220V mains-supplied, mechanical arm automatically resets to test initial point, start test script, first linear module 7 of mechanical arm and the second linear module 8 click the relevant position of mobile terminal 9 screen to be measured according to the coordinate information in test script, after having tested, test initial point got back to by mechanical arm, terminates test.
A kind of method of testing, applies script method for recording described above, provides a mechanical arm, comprising: according to the described coordinate information in described test script, controls the operation corresponding to position that described mobile terminal to be measured clicked by described mechanical arm.
In the present embodiment, script method for recording can carry out automatic test on third-party testing platform, by the coordinate information in the txt file of record being changed into the language that mechanical arm can identify, is run by UART protocol integrated test system mechanical arm; Coordinate corresponding on mobile terminal screen to be measured is clicked according to the coordinate information in txt file to make mechanical arm.To realize continual and steady test, release manpower, promotes the object of Consumer's Experience.
The foregoing is only preferred embodiment of the present invention; not thereby embodiments of the present invention and protection domain is limited; to those skilled in the art; should recognize and all should be included in the scheme that equivalent replacement done by all utilizations instructions of the present invention and diagramatic content and apparent change obtain in protection scope of the present invention.