CN108549604A - A kind of test script generation method, device, terminal device and storage medium - Google Patents
A kind of test script generation method, device, terminal device and storage medium Download PDFInfo
- Publication number
- CN108549604A CN108549604A CN201810321733.3A CN201810321733A CN108549604A CN 108549604 A CN108549604 A CN 108549604A CN 201810321733 A CN201810321733 A CN 201810321733A CN 108549604 A CN108549604 A CN 108549604A
- Authority
- CN
- China
- Prior art keywords
- operating
- identification object
- contacts
- reference identification
- test script
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of test script generation method, device, terminal device and storage mediums.The method includes:The operating of contacts in terminal interface is obtained, and present position determines reference identification object in the terminal interface based on the operating of contacts;According to the position of the reference identification object and the operating of contacts in the terminal interface present position, determine the relative position of operating point and the reference identification object;Test script is generated according to the reference identification object, the operating point and the relative position of the reference identification object and the operating of contacts.Utilize this method, reference identification object can be gone out based on the location determination of operating of contacts, the relative position of operating of contacts and reference identification object is then obtained, to generate test script, to significantly more efficient reduction operating of contacts, and it can effectively improve the applicability of test script.
Description
Technical field
The present embodiments relate to software testing technology field more particularly to a kind of test script generation method, device, ends
End equipment and storage medium.
Background technology
Currently, with the development of software technology, software test is widely used.The existing test applied to terminal
Scenario generation method is all based on sectional drawing and the mode of record screen is realized.Generate test script process be:Automatization test system
By manually being operated to terminal interface, and sectional drawing and record screen are carried out to terminal interface during operation, to be based on cutting
The user's operation of the picture and acquisition that take generates automatic test script.
However, based on the test script that existing test script generation method generates, test is required when carrying out terminal test
Environment and environment strict conformance when generation test script, even if the theme of the terminal interface unrelated with test content or color are not
Unanimously, it can all cause sectional drawing content inconsistent and can not compare.In addition, existing software is all multi-platform, the wind of each platform
Lattice are all similar, although the layout of terminal interface is almost consistent, handle how much logic and styles can all have
Difference.Existing test script generation method to test environment by having strict requirements, so can not be applied to different put down
Platform, so as to cause the redundancy of test script workload is generated.
Invention content
A kind of test script generation method, device, terminal device and storage medium provided by the invention, can effectively carry
The applicability of high test script reduces the workload for generating test script.
In a first aspect, an embodiment of the present invention provides a kind of test script generation methods, including:
The operating of contacts in terminal interface is obtained, and true based on operating of contacts present position in the terminal interface
Determine reference identification object;
According to the position of the reference identification object and the operating of contacts, present position, determination are grasped in the terminal interface
Make relative position of the point with the reference identification object;
The relative position with the reference identification object and the operating of contacts according to the reference identification object, the operating point
Generate test script.
Second aspect, the embodiment of the present invention additionally provide a kind of test script generating means, including:
With reference to determining module, for obtaining the operating of contacts in terminal interface, and based on the operating of contacts at the end
Present position determines reference identification object in the interface of end;
Relative position determining module is used for position and the operating of contacts according to the reference identification object in the terminal
Present position in interface determines the relative position of operating point and the reference identification object;
Script generation module, for opposite with the reference identification object according to the reference identification object, the operating point
Position and the operating of contacts generate test script.
The third aspect, the embodiment of the present invention additionally provide a kind of terminal device, including:
One or more processors;
Storage device, for storing one or more programs;
One or more of programs are executed by one or more of processors so that one or more of processors
Realize test script generation method provided in an embodiment of the present invention.
Fourth aspect, the embodiment of the present invention additionally provide a kind of computer readable storage medium, are stored thereon with computer
Program, the program realize test script generation method provided in an embodiment of the present invention when being executed by processor.
An embodiment of the present invention provides a kind of test script generation method, device, terminal device and storage mediums, obtain first
The operating of contacts in terminal interface is taken, and reference identification is determined in present position in the terminal interface based on the operating of contacts
Object;Then according to the position of the reference identification object and the operating of contacts, present position, determination are grasped in the terminal interface
Make relative position of the point with the reference identification object;Finally marked according to the reference identification object, the operating point and the reference
The relative position and the operating of contacts for knowing object generate test script.It, can be based on operating of contacts using above-mentioned technical proposal
Location determination goes out reference identification object, then obtains the relative position of operating of contacts and reference identification object, to generate test script.From
And operating point can be accurately positioned based on the relative position of operating point and reference identification object, the test script of generation can be made to have more
Applicability.When carrying out terminal test based on the test script, operating of contacts can be effectively restored based on test script, from
And the operating point obviated caused by the different-effect that different system or different platform generate terminal layout or interface display is fixed
The problem of bit-errors.
Description of the drawings
Fig. 1 is a kind of flow diagram for test script generation method that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow diagram of test script generation method provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of structural schematic diagram for test script generating means that the embodiment of the present invention three provides;
Fig. 4 is a kind of structural schematic diagram for terminal device that the embodiment of the present invention four provides.
Specific implementation mode
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail
The processing described as flow chart or method.Although operations (or step) are described as the processing of sequence by flow chart,
Many of which operation can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of operations can be pacified again
Row.The processing can be terminated when its operations are completed, it is also possible to the additional step being not included in attached drawing.Institute
It states processing and can correspond to method, function, regulation, subroutine, subprogram etc..
Embodiment one
Fig. 1 is a kind of flow diagram for test script generation method that the embodiment of the present invention one provides, and this method can fit
The case where for generating test script, such as be suitable for generate terminaloriented interface automatic test script the case where, this method
It can be executed by test script generating means, wherein the device can be by software and or hardware realization, and is typically integrated in terminal
In equipment.Terminal device can be the equipment such as computer, Intelligent flat and mobile phone in the present embodiment.
As described in Figure 1, a kind of test script generation method that the embodiment of the present invention one provides, includes the following steps:
Operating of contacts in S101, acquisition terminal interface, and it is residing in the terminal interface based on the operating of contacts
Location determination reference identification object.
In the present embodiment, terminal interface can be understood as generating the equipment of test script when getting operating of contacts
Interface.Operating of contacts can be understood as the command information in terminal interface, and wherein described instruction information can be used for terminal circle
Each functional block is operated in face.Reference identification object can be understood as the reference information for marking contact operating position.
The operating of contacts in terminal interface can be obtained in this step by way of recording and shielding, can also monitor to act on
Sectional drawing is carried out to current interface when operating of contacts in terminal interface, to obtain generating the operating of contacts moment on terminal interface
Image obtains operating of contacts present position in the terminal interface by carrying out image recognition to the image.
It is understood that operating of contacts present position in the terminal interface can be understood as operating of contacts described
Coordinate information in terminal interface, e.g., using the terminal interface lower left corner as coordinate origin, operating of contacts residing position in terminal interface
It can be (1 2) to set, and the wherein unit of transverse and longitudinal coordinate can be determined based on the size of terminal interface.
In the present embodiment, operating of contacts is obtained in terminal interface behind present position, this step can be by analyzing eventually
Image when end equipment executes operating of contacts determines reference identification object.Specifically, this step can be in the images by distance
The nearest marker of the operating of contacts, which is used as, refers to marker, can also be based on operating of contacts present position in terminal interface
It chooses the changeless marker in position in terminal interface to be used as with reference to marker, for positioning the operating of contacts in terminal
Present position in interface.
S102, according to the position and the operating of contacts of the reference identification object in the terminal interface present position,
Determine the relative position of operating point and the reference identification object.
In the present embodiment, operating point can be understood as the position that terminal interface generates operating of contacts.Relative position can
To be interpreted as using reference identification object as object of reference, coordinate of the operating point relative to reference identification object.
In general, after determining reference identification object, this step can be based on reference identification object present position in terminal interface
Determine the relative position of operating point and reference identification object.Wherein the position of reference identification object can be obtained by analysing terminal interface
It is determined to acquired image when operating of contacts.
In general, this step can by the position of reference identification object and operating point in the terminal interface present position into
Row mathematical operation, to determine the relative position of operating point and reference identification object.It such as, can be by the position of reference identification object and behaviour
Make the point coordinate difference of present position or coordinate and opposite with the reference identification object as operating point in the terminal interface
Position.
This step determines that operating point and the relative position of reference identification object can make positioning when carrying out operation point location
It is more accurate, to make test script can adapt in different operating system and different platforms.
S103, according to the reference identification object, the operating point and the reference identification object relative position and described touch
Point operation generates test script.
In the present embodiment, test script can be understood as the instruction for carrying out terminal test during terminal test
Collection.Wherein, terminal test may include the test to terminal webpage program or desktop programs.
Wherein, may include in test script multiple reference identification objects, operating point and reference identification object relative position and
Operating of contacts, there are correspondences for reference identification object, the relative position of operating point and reference identification object and operating of contacts, with reference to mark
Different relative positions can be corresponded to by knowing object, and reference identification object and relative position can uniquely determine out operating of contacts.
In general, according to the reference identification object, the relative position of the operating point and the reference identification object and described
It, can be by the reference identification object, the relative position and residing operating of contacts during operating of contacts generates test script
It is stored according to preset order, wherein as long as preset order, which is not construed as limiting, to carry out automation survey using test script
Operating of contacts is restored during examination.
A kind of test script generation method that the embodiment of the present invention one provides obtains the contact behaviour in terminal interface first
Make, and present position determines reference identification object in the terminal interface based on the operating of contacts;Then according to the reference
The position of marker and the operating of contacts present position in the terminal interface, determine operating point and the reference identification object
Relative position;Finally according to the reference identification object, the relative position of the operating point and the reference identification object and described
Operating of contacts generates test script.Using the above method, reference identification object can be gone out based on the location determination of operating of contacts, then
The relative position information of operating of contacts and reference identification object is obtained, to generate test script.So as to be based on operating point and ginseng
Operating point is accurately positioned in the relative position for examining marker, the test script of generation can be made to have more applicability, in different operations
Under system, operating of contacts can be gone out based on test script accurate reproduction, to obviate different system or different platform to terminal
Layout or interface display generate different-effect caused by operating point Wrong localization the problem of.
Embodiment two
Fig. 2 is a kind of flow diagram of test script generation method provided by Embodiment 2 of the present invention, the present embodiment two
It is optimized on the basis of the various embodiments described above.In the present embodiment, the operating of contacts will be based in the terminal interface
Middle present position determines reference identification object, is further detailed as:It is residing in the terminal interface according to the operating of contacts
Position, determination nearest reference word information in present position in the terminal interface apart from the operating of contacts;By the ginseng
It examines text information and is determined as reference identification object.
Further, the present embodiment is also in the position and the operating of contacts according to the reference identification object described
Present position in terminal interface, after the relative position for determining operating point and the reference identification object, advanced optimize including for:
Obtain the terminal interface picture after operation;After the operation being obtained to the terminal interface picture progress Text region after the operation
Terminal interface picture in text information, and using text information in the terminal interface picture after the operation as reference base picture
Middle marker;Correspondingly, by described according to the reference identification object, the relative position of the operating point and the reference identification object
With the operating of contacts generate terminal test script, advanced optimize for:According to the reference identification object, the operating point and institute
It states marker in relative position, the operating of contacts and the reference base picture of reference identification object and generates terminal test script.
On the basis of above-mentioned optimization, before operating of contacts of the present embodiment in the acquisition terminal interface, optimization packet
It includes:Obtain former terminal interface images;Text region is carried out to the former terminal interface images and obtains the former terminal surface chart
Text information in piece, and using the text information in the former terminal interface images as marker in initial baseline picture;Phase
It answers, is grasped described according to the reference identification object, the operating point and the relative position of the reference identification object, the contact
Make and the reference base picture in marker generate terminal test script, advanced optimize for:According to the reference identification object, described
Marker and initial baseline in operating point and the relative position of the reference identification object, the operating of contacts, the reference base picture
Marker generates terminal test script in picture.
On the basis of above-mentioned optimization, the present embodiment grasps the position according to the reference identification object and the contact
Make the present position in the terminal interface, determines the relative position of operating point and the reference identification object, be specifically optimized for:It will
The position of the reference identification object and the operating of contacts make the difference present position in the terminal interface, obtain operating point and institute
State the relative position of reference identification object.
Further, the present embodiment described according to the reference identification object, the phase of operating point and the reference identification object
After generating test script to position and the operating of contacts, optimization includes:Terminal test is carried out according to the test script;
And/or send the test script.
The not yet detailed content of the present embodiment please refers to embodiment one.
As shown in Fig. 2, a kind of test script generation method provided by Embodiment 2 of the present invention, includes the following steps:
S201, former terminal interface images are obtained.
In the present embodiment, former terminal interface can be understood as generating the equipment of test script before executing operating of contacts
Interface.Former terminal interface images can be understood as the image information that terminal device executes operating of contacts front interface.This step can
Former terminal interface images are obtained to be instructed by sectional drawing, to obtain initial baseline data (marker in such as initial baseline picture),
The initial baseline data are used for when carrying out terminal test using test script, and whether verification former terminal interface is tested with generation
Former terminal interphase match when script.
It should be noted that when carrying out terminal test using test script, the former terminal interface of terminal device need with
The former terminal interface of terminal device is consistent during generation test script.Wherein, it unanimously can be understood as automatic test course
Marker and marker in former terminal interface during generation automatic test script match in the terminal interface of Central Plains.
S202, the letter of the word in the former terminal interface images is obtained to former terminal interface images progress Text region
Breath, and using the text information in the former terminal interface images as marker in initial baseline picture.
In the present embodiment, marker can be understood as based on the word in former terminal interface images in initial baseline picture
Initial baseline data acquired in information.Marker can be during terminal test as execution in the initial baseline picture
Reference data before operating of contacts.
After obtaining former terminal interface images, this step can be obtained by carrying out Text region to former terminal interface images
Text information included in former terminal interface images, using as marker in initial baseline picture.
It should be noted that text information can only include word, it can also be including the position corresponding to word and each word
It sets.If only including word in the text information, during carrying out terminal test using test script, it is only necessary to verify
Whether word matches;If the text information includes word and the corresponding position of each word, using test foot
It needs to verify word during this progress terminal test and whether the corresponding position of each word matches.
Operating of contacts in S203, acquisition terminal interface.
S204, according to the operating of contacts, present position, determination exist apart from the operating of contacts in the terminal interface
The nearest reference word information in present position in the terminal interface.
When determining reference identification object, figure that this step is acquired when can be by getting operating of contacts to terminal device
As carrying out image recognition, the reference word information nearest apart from the operating of contacts is determined, to obtain being used for positioning operation point
Reference identification object.Wherein, may include the position of reference word and reference word in reference word information.
S205, the reference word information is determined as reference identification object.
After determining the reference word information nearest apart from the operating of contacts, this step can be by the reference word
Information, which is used as, refers to marker, for positioning operation point.
S206, the position of the reference identification object and the operating of contacts are done present position in the terminal interface
Difference obtains the relative position of operating point and the reference identification object.
The position of reference identification object may be embodied in reference identification object in this step, can also be by being obtained to terminal device
Acquired image carries out image analysis to determine when getting operating of contacts.
When determining relative position, this step can be by the position of reference identification object and operating of contacts in the terminal interface
Middle present position makes the difference, and obtains relative position, and wherein position can indicate that the present embodiment can be with terminal by the form of coordinate
Interface is coordinate system, and it is coordinate origin to take any one apex angle of terminal interface.
S207, the terminal interface picture after operation is obtained.
In the present embodiment, the equipment that the terminal interface picture after operation can be understood as generating test script is executing
Interface after operating of contacts.Terminal interface picture after operation can be understood as the figure that terminal device carries out interface after operating of contacts
As information.This step can instruct the terminal interface picture after obtaining operation by sectional drawing, to obtain terminating reference data (such as base
Marker in quasi- picture), the end reference data is used for when carrying out terminal test using test script, after verification operation
Whether terminal interface matches with the terminal interface after operation when generating test script.
S208, the terminal interface figure after the operation is obtained to the terminal interface picture progress Text region after the operation
Text information in piece, and using text information in the terminal interface picture after the operation as marker in reference base picture.
In the present embodiment, the text in terminal interface picture after marker can be understood as based on operation in reference base picture
End reference data acquired in word information.Marker can be used as during terminal test and execute in the reference base picture
Reference data after operating of contacts.
After obtaining the terminal interface picture after operating, this step can be by carrying out the terminal interface picture after operation
Text region operated after the terminal interface picture text information that is included, using as marker in reference base picture.
It should be noted that text information can only include word, it can also be including the position corresponding to word and each word
It sets.If only including word in the text information, during carrying out terminal test using test script, it is only necessary to verify
Whether word matches;If the text information includes word and the corresponding position of each word, using test foot
It needs to verify word during this progress terminal test and whether the corresponding position of each word matches.
S209, the relative position according to the reference identification object, the operating point with the reference identification object, the contact
Operation, marker generates terminal test script in marker and initial baseline picture in the reference base picture.
In the present embodiment, according to the reference identification object, the operating point and the reference identification object relative position,
Marker generates the process of terminal test script in marker and initial baseline picture in the operating of contacts, the reference base picture
In, the reference identification object, the operating point and the relative position of the reference identification object, the operating of contacts, the benchmark
As long as in picture in marker and initial baseline picture the storage order of marker be not construed as limiting can using test script into
Marker in initial baseline picture is effectively obtained when row terminal test executes whether operating of contacts front interface conforms to verify
Ask, have when executing operating of contacts obtain the reference identification object, the operating point and the reference identification object relative position
With the operating of contacts to restore operating of contacts, and it can effectively obtain in reference base picture and identify after having executed operating of contacts
Object, whether interface meets the requirements after executing operating of contacts with verification.
S210, terminal test is carried out according to the test script;And/or send the test script.
After generating terminal test script, this step can run the terminal test script to realize pair on the terminal device
The test script can also be sent to other-end equipment by the automatic test of terminal, be somebody's turn to do with being run in other-end equipment
Test script is to complete the test of other-end.Wherein, other-end can be understood as the terminal device in addition to this terminal device.
It is worth noting that, obtaining the operation of marker in initial baseline picture in the present embodiment and obtaining in reference base picture
The execution sequence of the operation of marker does not limit, as long as initial baseline can be obtained before terminal device executes operating of contacts
Marker in picture obtains marker in reference base picture after terminal device has executed operating of contacts.
Test script generation method in the present embodiment can be understood as the foot at the terminaloriented interface based on Text region
This generation method.In general, the existing scenario generation method applied to terminal interface is all based on sectional drawing and the mode of record screen is real
It is existing.In realization first by manually being operated to terminal interface, and record screen and sectional drawing are carried out to generate automation to operation
Test script, later when carrying out terminal test using test script, testing results script is realized to manually-operated recovery,
And record screen and sectional drawing are carried out during operation, by comparing the correctness recorded screen and sectional drawing and judge terminal test twice.
It needs the content of sectional drawing twice and record screen completely the same during being judged, can just think that terminal test is correct, and
It can not be suitable for discrepant platform.If these difference quilts cannot be ensured by only carrying out automatic test on a platform
It tests, if the deployment test in each different platform, it is necessary to manually be operated on each platform
One time, it thus will produce many redundancy sex works.
Pass through the opposite position according to the reference identification object, the operating point and the reference identification object in the present embodiment
It sets, marker generates terminal test foot in marker and the initial baseline picture in the operating of contacts, the reference base picture
Originally it can effectively solve the above problems.
Illustratively, test script generating process is as follows in the present embodiment:First to initial terminal interface sectional drawing, pass through text
Word identification technology obtains the text information in sectional drawing and preservation, as initial baseline data (marker in initial baseline picture);
Then operation of the user to terminal interface is obtained, and generates test script and (proceeds by test operation as obtained enabled instruction, count
The relative position between mouse and neighbouring text information is calculated and preserves, to obtain test script).Test script has recorded operating point
Relative position, operating of contacts (such as mouse action) and the reference word information of (such as mouse).Wherein test script is to operating point
Positioning is obtained by the relative position between operating point and reference word information.Finally to terminating the terminal interface (end after operation
Hold interface) sectional drawing is carried out, and Text region is carried out to the picture that sectional drawing obtains, to obtain and preserve the text information in the picture
As end reference data (marker in reference base picture).
The test script is not based on picture itself and is compared when carrying out result comparison, but is based on word
Way of contrast compared, to comparison result it is more accurate, test environment can flexibly change, and effectively reduce work
The redundancy of amount.When carrying out operating of contacts reduction, the absolute coordinate for being not based on operating point is restored, but based on operation
The significantly more efficient reduction operating of contacts of relative position of point and reference identification object is flat so as to get rid of different system or difference
The different-effect that platform is laid out terminal or interface display generates, and the problem of cause sectional drawing that cannot be compared.
It should be noted that initial baseline data and end reference data may be embodied in test script, can not also wrap
It is contained in test script, as long as capable of obtaining initial baseline data in terminal test, terminating reference data.
Correspondingly, the process for carrying out terminal test based on the test script is as follows:Test starts first, to initial terminal circle
Face sectional drawing obtains the text information in sectional drawing to sectional drawing by character recognition technology.With the text information in initial baseline data
It is compared, successful match then continues, otherwise test crash.Then by testing results script, automatic test is carried out.
(then e.g., analysing terminal interface sectional drawing obtains test script, passes through mouse and word to obtain text information and module position
The relative position of information calculates mouse in present terminal interface coordinate.Mouse is finally restored according to the mouse action in test script
Mark operation).Last test terminates, and terminating interface (terminal interface after operation) to terminal carries out sectional drawing, and word is carried out to sectional drawing
Identification obtains the text information in sectional drawing.Text information in sectional drawing is compared with the text information terminated in reference data
Compared with successful match is then successfully tested, otherwise test crash.
A kind of test script generation method provided by Embodiment 2 of the present invention, embody the operation for determining reference identification object and
Determine that relative position operates, additionally optimization is increased in determining reference base picture and identified in marker operation, initial baseline picture
Object operates and test script processing operation.Using this method, initial baseline can be obtained before terminal device carries out operating of contacts
Marker in picture, to be tested the former terminal interface of terminal device during terminal test, to improve terminal test
Efficiency;When carrying out operating of contacts, obtain corresponding reference identification object, operating point and reference identification object relative position information
And operating of contacts, to carry out more accurately orienting operating point in test process to terminal using test script;In terminal
Equipment carry out operating of contacts after obtain reference base picture in marker, with during terminal test to the terminal interface after operation into
Row test, to verify whether terminal test succeeds.In addition, using this method only need verify initial baseline picture in marker and
Marker in reference base picture, arithmetic speed is fast, can adapt to, in different operating system and platform, reduce generation test script
Workload.
Embodiment three
Fig. 3 is a kind of structural schematic diagram for test script generating means that the embodiment of the present invention three provides, and the present embodiment can
Suitable for generate test script the case where, such as be suitable for generate terminaloriented interface automatic test script the case where, wherein
The device can be by software and or hardware realization, and is typically integrated on terminal device.Terminal device can be in the present embodiment
The equipment such as computer, Intelligent flat and mobile phone.
As shown in figure 3, the test script generating means include:With reference to determining module 31,32 and of relative position determining module
Script generation module 33.
Wherein, with reference to determining module 31, exist for obtaining the operating of contacts in terminal interface, and based on the operating of contacts
Present position determines reference identification object in the terminal interface;
Relative position determining module 32 is used for position and the operating of contacts according to the reference identification object at the end
Present position in interface is held, determines the relative position of operating point and the reference identification object;
Script generation module 33, for the phase according to the reference identification object, the operating point and the reference identification object
Test script is generated to position and the operating of contacts.
In the present embodiment, which obtains touching in terminal interface by reference to determining module first
Point operation, and present position determines reference identification object in the terminal interface based on the operating of contacts;Then by opposite
Position determination module present position in the terminal interface according to the position and the operating of contacts of the reference identification object, really
Determine the relative position of operating point and the reference identification object;Finally by script generation module according to the reference identification object, institute
The relative position and the operating of contacts for stating operating point and the reference identification object generate test script.
A kind of test script generating means that the present embodiment three provides, can go out reference based on the location determination of operating of contacts
Then marker obtains the relative position information of operating of contacts and reference identification object, to generate test script.So as to be based on
Operating point is accurately positioned in operating point and the relative position of reference identification object, and the test script of generation can be made to have more applicability,
Under different operating system, operating of contacts can be gone out based on test script accurate reproduction, to obviate different system or difference
Platform to terminal be laid out or interface display generate different-effect caused by operating point Wrong localization the problem of.
Further, it with reference to determining module 31, is further specifically optimized for:According to the operating of contacts in terminal circle
Present position in face, determination nearest reference word information in present position in the terminal interface apart from the operating of contacts;
The reference word information is determined as reference identification object.
Further, the test script generating means further include:
Picture acquisition module after operation, for obtaining the terminal interface picture after operating;
Datum identifier acquisition module obtains the behaviour for carrying out Text region to the terminal interface picture after the operation
The text information in terminal interface picture after work, and using text information in the terminal interface picture after the operation as benchmark
Marker in picture;
Correspondingly, script generation module 33, is further specifically optimized for:According to the reference identification object, the operating point
Terminal test foot is generated with marker in the relative position of the reference identification object, the operating of contacts and the reference base picture
This.
On the basis of above-mentioned optimization, which further includes:
Original picture acquisition module, for obtaining former terminal interface images;
Initial marking acquisition module obtains former terminal circle for carrying out Text region to the former terminal interface images
Text information in the picture of face, and using the text information in the former terminal interface images as being identified in initial baseline picture
Object;
Correspondingly, script generation module 33, is further specifically optimized for:According to the reference identification object, the operating point
With marker and the initial baseline figure in the relative position of the reference identification object, the operating of contacts, the reference base picture
Marker generates terminal test script in piece.
Based on the above-mentioned technical proposal, relative position determining module 32, is specifically used for:By the position of the reference identification object and
The operating of contacts makes the difference present position in the terminal interface, obtains the opposite position of operating point and the reference identification object
It sets.
Further, the test script generating means, also optimization include:
Tester Beyond Line is used for described according to the reference identification object, the phase of operating point and the reference identification object
After generating test script to position and the operating of contacts, terminal test is carried out according to the test script;And/or
Sending module is used for described according to the reference identification object, the opposite position of operating point and the reference identification object
It sets after generating test script with the operating of contacts, sends the test script.
Above-mentioned test script generating means can perform the test script generation method that any embodiment of the present invention is provided, tool
For the corresponding function module of execution method and advantageous effect.
Example IV
Fig. 4 is a kind of structural schematic diagram for terminal device that the embodiment of the present invention four provides.As shown in figure 4, the present invention is real
Applying the terminal device that example four provides includes:One or more processors 41 and storage device 42;Processor in the terminal device
41 can be one or more, in Fig. 4 by taking a processor 41 as an example;Storage device 42 is for storing one or more programs;
One or more of programs are executed by one or more of processors 41 so that one or more of processors 41 are realized
Test script generation method as described in any in the embodiment of the present invention.
The terminal device can also include:Input unit 43 and output device 44.
Processor 41, storage device 42, input unit 43 and output device 44 in terminal device can by bus or
Other modes connect, in Fig. 4 for being connected by bus.
Storage device 42 in the terminal device is used as a kind of computer readable storage medium, can be used for storing one or more
A program, described program can be software program, computer executable program and module, such as the embodiment of the present invention one or two institutes
Corresponding program instruction/the module of test script generation method is provided (for example, in attached test script generating means shown in Fig. 3
Module, including:With reference to determining module 31, relative position determining module 32 and script generation module 33).Processor 41 passes through operation
Software program, instruction and the module being stored in storage device 42, to execute terminal device various function application and
Test script generation method in above method embodiment is realized in data processing.
Storage device 42 may include storing program area and storage data field, wherein storing program area can storage program area,
Application program needed at least one function;Storage data field can be stored uses created data etc. according to equipment.In addition,
Storage device 42 may include high-speed random access memory, can also include nonvolatile memory, for example, at least a magnetic
Disk storage device, flush memory device or other non-volatile solid state memory parts.In some instances, storage device 42 can be into one
Step includes the memory remotely located relative to processor 41, these remote memories can pass through network connection to equipment.On
The example for stating network includes but not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Input unit 43 can be used for receiving the number or character information of input, and generate the user setting with terminal device
And the related key signals input of function control.Output device 44 may include that display screen etc. shows equipment.
Also, when one or more included program of above-mentioned terminal device is held by one or more of processors 41
When row, program proceeds as follows:The operating of contacts in terminal interface is obtained, and based on the operating of contacts in terminal circle
Present position determines reference identification object in face;According to the position of the reference identification object and the operating of contacts in terminal circle
Present position in face determines the relative position of operating point and the reference identification object;According to the reference identification object, the operation
Point generates test script with the relative position of the reference identification object and the operating of contacts.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium, it is stored thereon with computer program, it should
For executing a kind of test script generation method when program is executed by processor, this method includes:Obtain touching in terminal interface
Point operation, and present position determines reference identification object in the terminal interface based on the operating of contacts;According to the reference
The position of marker and the operating of contacts present position in the terminal interface, determine operating point and the reference identification object
Relative position;The relative position with the reference identification object and the contact according to the reference identification object, the operating point
Operation generates test script.
Optionally, it can be also used for executing one kind that any embodiment of the present invention is provided when which is executed by processor
The technical solution of test script generation method.By the description above with respect to embodiment, those skilled in the art can be with
It is well understood, the present invention can be realized by software and required common hardware, naturally it is also possible to by hardware realization, but
The former is more preferably embodiment in many cases.Based on this understanding, technical scheme of the present invention is substantially right in other words
The part that the prior art contributes can be expressed in the form of software products, which can be stored in
In computer readable storage medium, such as the floppy disk of computer, read-only memory (Read-Only Memory, ROM), arbitrary access
Memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are making
It obtains a computer equipment (can be personal computer, server or the network equipment etc.) and executes each embodiment of the present invention
The method.
Note that above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The present invention is not limited to specific embodiments described here, can carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out to the present invention by above example
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
May include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.
Claims (10)
1. a kind of test script generation method, which is characterized in that including:
The operating of contacts in terminal interface is obtained, and present position determines ginseng in the terminal interface based on the operating of contacts
Examine marker;
According to the position of the reference identification object and the operating of contacts in the terminal interface present position, determine operating point
With the relative position of the reference identification object;
It is generated according to the reference identification object, the operating point and the relative position of the reference identification object and the operating of contacts
Test script.
2. according to the method described in claim 1, it is characterized in that, described be based on the operating of contacts in the terminal interface
Present position determines reference identification object, including:
According to the operating of contacts in the terminal interface present position, determine apart from the operating of contacts in terminal circle
The nearest reference word information in present position in face;
The reference word information is determined as reference identification object.
3. according to the method described in claim 1, it is characterized in that, in the position according to the reference identification object and described
Operating of contacts present position in the terminal interface determines that operating point with after the relative position of the reference identification object, is gone back
Including:
Obtain the terminal interface picture after operation;
Text region is carried out to the terminal interface picture after the operation and obtains the text in the terminal interface picture after the operation
Word information, and using the text information in the terminal interface picture after the operation as marker in reference base picture;
Correspondingly, described according to the reference identification object, the relative position of the operating point and the reference identification object and described
Operating of contacts generates terminal test script, including:
According to the reference identification object, relative position, the operating of contacts and the institute of the operating point and the reference identification object
It states marker in reference base picture and generates terminal test script.
4. according to the method described in claim 3, it is characterized in that, it is described acquisition terminal interface in operating of contacts before,
Further include:
Obtain former terminal interface images;
Text region is carried out to the former terminal interface images and obtains the text information in the former terminal interface images, and by institute
The text information in former terminal interface images is stated as marker in initial baseline picture;
Correspondingly, it is described according to the reference identification object, the operating point and the reference identification object relative position, described touch
Marker generates terminal test script in point operation and the reference base picture, including:
According to the reference identification object, relative position of the operating point and the reference identification object, the operating of contacts, described
Marker generates terminal test script in marker and the initial baseline picture in reference base picture.
5. according to the method described in claim 1, it is characterized in that, the position according to the reference identification object and described touching
Point operation present position in the terminal interface, determines the relative position of operating point and the reference identification object, including:
The position of the reference identification object and the operating of contacts are made the difference present position in the terminal interface, operated
The relative position of point and the reference identification object.
6. according to the method described in claim 1, it is characterized in that, described according to the reference identification object, the operating point
After generating test script with the relative position of the reference identification object and the operating of contacts, further include:
Terminal test is carried out according to the test script;And/or send the test script.
7. a kind of test script generating means, which is characterized in that including:
With reference to determining module, for obtaining the operating of contacts in terminal interface, and based on the operating of contacts in terminal circle
Present position determines reference identification object in face;
Relative position determining module is used for position and the operating of contacts according to the reference identification object in the terminal interface
Middle present position determines the relative position of operating point and the reference identification object;
Script generation module, for the relative position according to the reference identification object, the operating point and the reference identification object
Test script is generated with the operating of contacts.
8. device according to claim 7, which is characterized in that further include:
Tester Beyond Line is used for described according to the reference identification object, the opposite position of operating point and the reference identification object
It sets after generating test script with the operating of contacts, terminal test is carried out according to the test script;And/or
Sending module, for it is described according to the reference identification object, operating point and the reference identification object relative position and
After the operating of contacts generates test script, the test script is sent.
9. a kind of terminal device, which is characterized in that including:
One or more processors;
Storage device, for storing one or more programs;
One or more of programs are executed by one or more of processors so that one or more of processors are realized
Test script generation method as described in any in claim 1-6.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor
The test script generation method as described in claim 1-6 is any is realized when execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810321733.3A CN108549604A (en) | 2018-04-11 | 2018-04-11 | A kind of test script generation method, device, terminal device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810321733.3A CN108549604A (en) | 2018-04-11 | 2018-04-11 | A kind of test script generation method, device, terminal device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108549604A true CN108549604A (en) | 2018-09-18 |
Family
ID=63514531
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810321733.3A Pending CN108549604A (en) | 2018-04-11 | 2018-04-11 | A kind of test script generation method, device, terminal device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108549604A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109918000A (en) * | 2019-03-12 | 2019-06-21 | 苏州乐模软件科技有限公司 | Electrode patterning Fulfill testing report automatically method and generation system |
CN110347598A (en) * | 2019-07-10 | 2019-10-18 | 上海达梦数据库有限公司 | A kind of test script generation method, device, server and storage medium |
CN111143188A (en) * | 2018-11-02 | 2020-05-12 | 中移(杭州)信息技术有限公司 | Method and equipment for automatically testing application |
CN113282502A (en) * | 2021-06-04 | 2021-08-20 | 青岛海尔科技有限公司 | Script generation method, device, storage medium and electronic device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101571922A (en) * | 2008-05-04 | 2009-11-04 | 中兴通讯股份有限公司 | Character recognition tool for mobile terminal automation testing and method thereof |
CN103365779A (en) * | 2013-07-09 | 2013-10-23 | 广东欧珀移动通信有限公司 | Software test method and system |
US20140165040A1 (en) * | 2012-12-07 | 2014-06-12 | Sugarcrm Inc. | Test script generation for application image validation |
CN104636247A (en) * | 2013-11-12 | 2015-05-20 | 财团法人资讯工业策进会 | Testing device and testing method thereof |
CN104951393A (en) * | 2014-03-25 | 2015-09-30 | 中国电信股份有限公司 | Testing method and device |
CN104978270A (en) * | 2015-07-03 | 2015-10-14 | 上海触乐信息科技有限公司 | Automatic software testing method and apparatus |
US20150339213A1 (en) * | 2014-05-21 | 2015-11-26 | Cgi Technologies And Solutions Inc. | Automated testing of an application system |
CN105550114A (en) * | 2015-12-23 | 2016-05-04 | 广东欧珀移动通信有限公司 | Automated testing method and apparatus and mobile terminal |
-
2018
- 2018-04-11 CN CN201810321733.3A patent/CN108549604A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101571922A (en) * | 2008-05-04 | 2009-11-04 | 中兴通讯股份有限公司 | Character recognition tool for mobile terminal automation testing and method thereof |
US20140165040A1 (en) * | 2012-12-07 | 2014-06-12 | Sugarcrm Inc. | Test script generation for application image validation |
CN103365779A (en) * | 2013-07-09 | 2013-10-23 | 广东欧珀移动通信有限公司 | Software test method and system |
CN104636247A (en) * | 2013-11-12 | 2015-05-20 | 财团法人资讯工业策进会 | Testing device and testing method thereof |
CN104951393A (en) * | 2014-03-25 | 2015-09-30 | 中国电信股份有限公司 | Testing method and device |
US20150339213A1 (en) * | 2014-05-21 | 2015-11-26 | Cgi Technologies And Solutions Inc. | Automated testing of an application system |
CN104978270A (en) * | 2015-07-03 | 2015-10-14 | 上海触乐信息科技有限公司 | Automatic software testing method and apparatus |
CN105550114A (en) * | 2015-12-23 | 2016-05-04 | 广东欧珀移动通信有限公司 | Automated testing method and apparatus and mobile terminal |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111143188A (en) * | 2018-11-02 | 2020-05-12 | 中移(杭州)信息技术有限公司 | Method and equipment for automatically testing application |
CN111143188B (en) * | 2018-11-02 | 2023-09-22 | 中移(杭州)信息技术有限公司 | Method and equipment for automatically testing application |
CN109918000A (en) * | 2019-03-12 | 2019-06-21 | 苏州乐模软件科技有限公司 | Electrode patterning Fulfill testing report automatically method and generation system |
CN110347598A (en) * | 2019-07-10 | 2019-10-18 | 上海达梦数据库有限公司 | A kind of test script generation method, device, server and storage medium |
CN110347598B (en) * | 2019-07-10 | 2023-11-28 | 上海达梦数据库有限公司 | Test script generation method and device, server and storage medium |
CN113282502A (en) * | 2021-06-04 | 2021-08-20 | 青岛海尔科技有限公司 | Script generation method, device, storage medium and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107562610B (en) | Method, device, terminal and medium for acquiring page loading time | |
CN108549604A (en) | A kind of test script generation method, device, terminal device and storage medium | |
CN108536597A (en) | A kind of terminal test method, device, terminal device and storage medium | |
WO2018010552A1 (en) | Test method and device | |
US8527950B2 (en) | Verification of software applications | |
CN108923997B (en) | Cloud service node automatic testing method and device based on python | |
CN111708785B (en) | Big data mining processing method and device and cloud platform | |
CN104461693B (en) | Virtual machine update method and system under a kind of desktop cloud computing environment | |
CN111831564A (en) | Regression testing method and device and computing equipment | |
CN104375934B (en) | Method for testing reliability of Android mobile phone software | |
CN111459796A (en) | Automatic testing method and device, computer equipment and storage medium | |
CN109032864A (en) | A kind of method and system of NVMe SSD hot plug test | |
CN105550114A (en) | Automated testing method and apparatus and mobile terminal | |
CN111143188A (en) | Method and equipment for automatically testing application | |
CN109614325B (en) | Method and device for determining control attribute, electronic equipment and storage medium | |
US20140033179A1 (en) | Application testing | |
CN109101412B (en) | Test file generation method, test file generation device, test file testing method, test file testing device, storage medium and computer equipment | |
CN111240967A (en) | Code generation method and device | |
CN105302715B (en) | The acquisition methods and device of application program user interface | |
CN109240928A (en) | Test method, device, equipment and storage medium | |
CN101105769A (en) | Chip validation pretreatment method and device | |
CN108334445A (en) | Page elements localization method, positioning device, test equipment and storage medium | |
CN111008140B (en) | Cross-platform UI (user interface) automatic testing method and device | |
CN104021071A (en) | Method and system for obtaining process lifecycles | |
CN113821438A (en) | Application response performance test method and system and computing equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180918 |
|
RJ01 | Rejection of invention patent application after publication |