CN109783389A - Element control automatic test approach, device and electronic equipment - Google Patents
Element control automatic test approach, device and electronic equipment Download PDFInfo
- Publication number
- CN109783389A CN109783389A CN201910060546.9A CN201910060546A CN109783389A CN 109783389 A CN109783389 A CN 109783389A CN 201910060546 A CN201910060546 A CN 201910060546A CN 109783389 A CN109783389 A CN 109783389A
- Authority
- CN
- China
- Prior art keywords
- module
- element control
- script
- focus
- control
- 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
Landscapes
- Stored Programmes (AREA)
Abstract
The embodiment of the present application provides a kind of element control automatic test approach, device and electronic equipment, the module No. of module to be tested is obtained according to the layout format of the element control in module to be measured, it obtains preconfigured focus corresponding with the module No. of module to be measured and follows script, preconfigured mission script corresponding with task to be tested is obtained according to task to be tested.Script and mission script is followed to be combined to obtain test script the focus of acquisition.The control ID for obtaining each element control in the element control in module to be measured successively tests the function of each element control by the control ID of each element control using the test script of acquisition.The automatic testing scheme follows script and mission script by being pre-configured with different focuses, can be spliced and combined according to the actual situation to script to be quickly obtained corresponding test script in official testing.Also, each element control can be accurately positioned in such a way that focus follows to realize the test to element control.
Description
Technical field
The present invention relates to software testing technology fields, in particular to a kind of element control automatic test approach, device
And electronic equipment.
Background technique
The progress of mobile technology has driven smart television in more various development, nowadays, APP in smart television
(Application, application program) is varied, while the workload of the adaptation test of software function and screen resolution is also got over
Come bigger.Since the diversity of intelligent television end element control is laid out, writing for automatic test script needs tester to have
There is higher program capability, carrys out biggish workload to the work belt of tester.Currently, lacking one kind can more be accurately positioned
To element control, and convenient and fast testing scheme.
Summary of the invention
In view of this, the purpose of the application is, a kind of element control automatic test approach, device and electronic equipment are provided
To improve the above problem.
The embodiment of the present application provides a kind of element control automatic test approach and is used for the element on the page of terminal device
Control is tested, which comprises
The module of the module to be measured is obtained according to the layout format of the element control in the module to be measured on the page
Number, it obtains preconfigured focus corresponding with the module No. of the module to be measured and follows script;
Obtain the control ID of each element control in the element control in the module to be measured;
Preconfigured mission script corresponding with the task to be tested is obtained according to task to be tested, and by the coke
Point follows script and the mission script to be combined to obtain test script;
Using the test script of acquisition, and by the control ID of each element control successively to the function of each element control
It can be carried out test.
Optionally, the method also includes being pre-configured with the step of focus follows script, which includes:
Configuring the first focus follows script and the second focus to follow script, wherein first focus follows script pair
Ying Yu has the first module of the first layout format, second focus follow script correspond to the second layout format the
Two modules;
Obtain the module No. of the first module in the terminal device and the module No. of the second module;
Script is followed to be associated the module No. of first module and first focus, and by second module
Module No. follow script to be associated with second focus.
Optionally, the layout format of the element control in the module to be measured according on the page obtains described to be measured
The module No. of module, obtain the step of preconfigured focus corresponding with the module No. of the module to be measured follows script it
Before, the method also includes:
For each module on the page, the element control in the module is obtained according to the module No. of the module
Quantity;
Corresponding digital collection is generated according to the quantity of the element control;
The control ID of each element control is generated according to each digital and described module No. in the digital collection,
And in the ID list corresponding with the module No. that the control ID of generation deposit is pre-created.
Optionally, in the element control obtained in the module to be measured the step of the control ID of each element control, packet
It includes:
The module No. for obtaining the module to be measured obtains and the module pair to be measured according to the module No. of the module to be measured
The ID list answered;
The control ID of each element control from the element control successively obtained in the ID list in the module to be measured.
Optionally, the method also includes:
Obtain traversal number when testing to the element control in the module to be measured;
It detects traversal number element control whether corresponding with the preset module to be measured and recommends digit phase
Together;
If they are the same, it is determined that the quantity test of the element control in the terminal device is normal;
If not identical, it is determined that the quantity of the element control in the terminal device is tested abnormal.
Optionally, described using the test script obtained, and by the control ID of each element control successively to each described
The step of function of element control is tested, comprising:
Script is followed according to the focus in the test script of acquisition, is successively navigated to by the control ID of each element control
Each element control;
Functional test is carried out to the element control of positioning extremely according to the mission script in the test script, and described in detection
Whether the execution movement of element control keeps strokes with default execution;
If consistent, it is determined that the functional test of the element control is normal;
If inconsistent, it is determined that the functional test of the element control is abnormal.
The embodiment of the present application also provides a kind of element control automatic testing equipment, the member on the page to terminal device
Plain control is tested, and described device includes:
Focus follows script to obtain module, for the layout version according to the element control in the module to be measured on the page
Formula obtains the module No. of the module to be measured, obtains preconfigured focus corresponding with the module No. of the module to be measured and follows
Script;
ID obtains module, for obtaining the control ID of each element control in the element control in the module to be measured;
Test script obtains module, preconfigured corresponding with the task to be tested for being obtained according to task to be tested
Mission script, and follow script and the mission script to be combined to obtain test script the focus;
Test module, for the test script using acquisition, and by the control ID of each element control successively to each institute
The function of stating element control is tested.
Optionally, described device further includes that the configuration module of script is followed for being pre-configured with focus, the configuration module
It is specifically used for:
Configuring the first focus follows script and the second focus to follow script, wherein first focus follows script pair
Ying Yu has the first module of the first layout format, second focus follow script correspond to the second layout format the
Two modules;
Obtain the module No. of the first module in the terminal device and the module No. of the second module;
Script is followed to be associated the module No. of first module and first focus, and by second module
Module No. follow script to be associated with second focus.
The embodiment of the present application also provides a kind of electronic equipment, comprising: processor, storage medium and bus, the storage are situated between
Matter is stored with the executable machine readable instructions of the processor, when electronic equipment operation, the processor and the storage
By bus communication between medium, the processor executes the machine readable instructions, automatic with the element control for executing above-mentioned
The step of test method.
The embodiment of the present application also provides a kind of readable storage medium storing program for executing, is stored with computer program on the readable storage medium storing program for executing,
The computer program executes the step of above-mentioned element control automatic test approach when being run by processor.
Element control automatic test approach, device and electronic equipment provided by the embodiments of the present application, according in module to be measured
The layout format of element control obtain the module No. of module to be measured, obtain preconfigured corresponding with the module No. of module to be measured
Focus follow script, obtain the control ID of each element control in the element control in module to be measured.And according to task to be tested
Obtain preconfigured mission script corresponding with task to be tested.Script and mission script is followed to carry out group the focus of acquisition
It closes to obtain test script.Using the test script of acquisition, by the control ID of each element control successively to the function of each element control
It can be carried out test.The automatic testing scheme follows script and mission script by being pre-configured with different focuses, formally to survey
When examination, script can be spliced and combined according to the actual situation to be quickly obtained corresponding test script.Also, by focus with
With mode each element control can be accurately positioned to realize the test to element control.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate
Appended attached drawing, is described in detail below.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached
Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair
The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this
A little attached drawings obtain other relevant attached drawings.
Fig. 1 is one of the flow chart of element control automatic test approach provided by the embodiments of the present application.
Fig. 2 is the two of the flow chart of element control automatic test approach provided by the embodiments of the present application.
Fig. 3 is the layout format schematic diagram of element control provided by the embodiments of the present application.
Fig. 4 is the three of the flow chart of element control automatic test approach provided by the embodiments of the present application.
Fig. 5 is the functional block diagram of element control automatic testing equipment provided by the embodiments of the present application.
Fig. 6 is the structural block diagram of electronic equipment provided by the embodiments of the present application.
Icon: 110- processor;120- memory;130- communication interface;140- bus;500- element control is tested automatically
Device;501- focus follows script to obtain module;502-ID obtains module;503- test script obtains module;504- tests mould
Block;505- configuration module.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete
Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist
The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.
Therefore, the detailed description of the embodiment of the present invention provided in the accompanying drawings is not intended to limit below claimed
The scope of the present invention, but be merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art
Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.
Fig. 1 is please referred to, Fig. 1 is a kind of flow chart of element control automatic test approach provided by the present application, the element control
Part automatic test approach can be applied in electronic equipment, can be realized using relevant software and hardware, below will be to the side
Each step that method includes is described in detail.
Step S110 obtains the module according to the layout format of the element control in the module to be measured on the page
Module No. obtains preconfigured focus corresponding with the module No. of the module to be measured and follows script.
Currently, mobile terminal, such as smart television etc., display screen stock size is larger, can lay on the display screen
Element control quantity it is also more and more, also become increasingly complex for the test job of element control.Element control is located in
When the Android 4.4 of smart phone and its later version, usually using UiAutomator directly acquire element control ID,
The mode of Name, Xpath carry out the positioning of element control, but are applied to such as smart television when mobile terminal, this side
Formula will lead to the positioning mistake of element control, the phenomenon that can not find element control occurs.The display screen of smart phone is usually to adopt
It is shown with the mode of screen sliding.And in the element control automatic test of smart television, screen sliding mode is not suitable for intelligent electricity
Element control diversity depending on end waterfall stream mode is laid out, and will lead to the loss of page focus.Therefore, how to obtain applicable
Test script is simultaneously accurately located to each element control to carry out the major issue that functional test is raising testing efficiency.
Referring to Fig. 2, in the present embodiment, before formally being tested, element control automatic test approach further include with
Lower step:
Step S101, configuration the first focus follow script and the second focus to follow script, wherein first focus with
Correspond to the first module with the first layout format with script, second focus, which follows script to correspond to, has the second layout
Second module of format.
Step S102 obtains the module No. of the first module in the terminal device and the module No. of the second module.
The module No. of first module and first focus are followed script to be associated by step S103, and by institute
The module No. and second focus for stating the second module follow script to be associated.
Element control on the display screen has a difference in arrangement and size, generally can by element control by function or
Element control is carried out subregion by the different of classification etc., to constitute different modules.And the element control in modules is being laid out
On may and arrangement identical there is also the size of the element control in exception, such as certain module in a row, and in some modules
Element control it is different in size, and multirow may be arranged in, or there are also the difference between other modules and module,
It is not repeated one by one in the present embodiment.
Difference layout format will imply that the difference of the positioning method in element control therefore in the present embodiment, can be pre-
First the layout format according to the element control in module configures different focuses and follows script, in order to be applicable to different cloth
The module of office's format.
Optionally, can be pre-configured with the first focus follows script and the second focus to follow script, wherein described first is burnt
Point follow script correspond to first layout format the first module, and the second focus follow script correspond to have the second cloth
Second module of office's format.The size that the module of the first layout format can be the element control for including is identical, and arranges
The size of the module of align, the element control that the module of the second layout format may include is not exactly the same, is arranged in more
Capable module, as shown in Figure 3.It should be noted that herein by way of example only, it in practical applications, can be according to specific need
It asks and is accordingly arranged.Also, the second layout format is not limited to a kind of format, can be comprising a variety of layout versions
Formula, and the second focus follows script to be also not limited to a kind of script, can be and corresponds respectively to have different layout formats
The focus of second layout format follows script.
Element control in multiple modules in modules may have differences in layout, and between module and module
There is also the positional relationships up and down, between left and right in layout.In the present embodiment, modules have corresponding module No., should
Module No. is to be configured according to the layout format of the element control in module.
It can get the module No. of modules, and by the module No. of above-mentioned the first module with the first layout format
Script is followed to be associated with first focus, by the module No. of above-mentioned the second module with the second layout format and institute
Stating the second focus follows script to be associated.In this way, it is subsequent when being tested, then it can be according to the tool of module to be tested
Body situation calls corresponding script to be tested.Specifically, it when obtaining the module No. of modules, can be connect by request page
Mouthful, to obtain page interface data, to obtain the module No. of the module on current page and the quantity of module.
In the present embodiment, not only modules have corresponding module No., and the element control in modules
With corresponding control ID, in order to can precise positioning to corresponding element control tested.
Optionally, related tool can be first passed through in advance generates the control ID that can distribute to each element control in terminal device,
Referring to Fig. 4, can specifically be realized by following steps:
Step S201 is obtained in the module for each module on the page according to the module No. of the module
The quantity of element control.
Step S202 generates corresponding digital collection according to the quantity of the element control.
Step S203, according to each number and each element control of module No. generation in the digital collection
Control ID, and will be in the ID list corresponding with the module No. of the module to be measured that is pre-created of the control ID of generation deposit.
In multiple modules on the page, the identical module module No. having the same of layout format, wherein module No. is by two
Part forms, such as by common segment " id_module_ " and difference part " 1 ", to form " id_module_1 ".It is each
In the case that module No. determines, i.e., the layout format of the element control in module determines, then can determine the element in the module
The quantity of control.The element control in corresponding digital collection, such as some module is produced according to the quantity of element control
Quantity is 8, then the digital collection comprising number 1-8 can be generated.
It, can be according to each digital and described module No. in the digital collection when generating the control ID of element control
Generate corresponding control ID, such as extract the number 1 in digital collection, by the common segment " _ view " of number 1 and control ID into
Row combination, with composition " _ view1 ".Obtained result is formed with module No., then constitutes final control ID " id_
module_1_view1".It then include in the module of 8 element controls, the control ID of each element control can be " id_
module_1_view1”-“id_module_1_view8”。
The control ID of each element control of generation is saved to the ID list corresponding with the module No. being pre-created
In.
In the present embodiment, when testing, it can be obtained according to the layout format of the element control in module to be measured to be measured
The module No. of module obtains preconfigured focus corresponding with the module No. of the module to be measured and follows script.Specifically, it examines
The layout format for surveying the element control in module to be measured is the first layout format or the second layout format.If the first layout version
Formula then obtains the first focus corresponding with the first layout format and follows script.If the second layout format, then obtain and the second cloth
Corresponding second focus of office's format follows script.
Step S120 obtains the control ID of each element control in the element control in the module to be measured.
Step S130 obtains preconfigured mission script corresponding with the task to be tested according to task to be tested,
And script and the mission script is followed to be combined to obtain test script the focus.
Step S140, using the test script of acquisition, and by the control ID of each element control successively to each member
The function of plain control is tested.
In the present embodiment, it can also configure multiple mission scripts corresponding to different test assignments in advance, tested
When, then preconfigured mission script corresponding with task to be tested can be obtained according to task to be tested.In this way, can be by acquisition
Focus follows script and mission script to be spliced and combined to obtain test script.
In the present embodiment, for module to be measured, each element control in the element control in the module to be measured can get
Control ID.And using the test script obtained, successively the function of element control is tested by the control ID of each element control.
Specifically, the module No. that can get the module to be measured, according to the module No. of the module to be measured obtain with it is described
The corresponding ID list of module to be measured.The each element control from the element control successively obtained in the ID list in the module to be measured
The control ID of part.
Specifically, script can be followed according to the focus in the test script of acquisition, by the control ID of each element control
Successively navigate to each element control.Function is carried out to the element control of positioning extremely according to the mission script in the test script
It can test, and whether the execution movement for detecting the element control keeps strokes with default execution.If the execution of element control is dynamic
Make to keep strokes with default execution, it is determined that the functional test of the element control is normal.If element control execution movement with
Default execution movement is inconsistent, it is determined that the functional test of the element control is abnormal.
For example, some element control is that the element control with " broadcasting ", " pause " function detects this yuan in test
Whether the execution movement of plain control keeps strokes with execution such as preset broadcasting, pauses.If consistent, it is determined that the element control
Functional test is normal, otherwise, it determines the functional test of the element control is abnormal.
In the present embodiment, other than needing the function to each element control to test, also need to detect module to be measured
In element control it is whole quantitatively whether normal.Optionally, to the element control in the module to be measured when can obtain test
The traversal number of part, the traversal number then embody the quantity of the element control in module to be measured.Detecting the traversal number is
No element control corresponding with the preset module to be measured recommends digit identical.If they are the same, it is determined that the terminal is set
The quantity test of element control in standby is normal.If not identical, it is determined that the quantity of the element control in the terminal device is surveyed
Examination is abnormal.
Pass through the detection of the quantity to the element control in terminal device, it may be determined that element control in terminal device is set
Whether set is to be configured by preset configuration requirement.Avoid the region for occurring display blank on the page.
Referring to Fig. 5, being the application element control automatic testing equipment 500 that another embodiment provides in fact, the element control
Part automatic testing equipment 500 is applied in electronic equipment, and the element control automatic testing equipment 500 includes that focus follows script
Obtain module 501, ID obtains module 502, test script obtains module 503 and test module 504.
The focus follows script to obtain module 501, for according to the element control in the module to be measured on the page
Layout format obtain the module No. of the module to be measured, obtain preconfigured corresponding with the module No. of the module to be measured
Focus follows script.It is appreciated that the focus, which follows script to obtain module 501, can be used for executing above-mentioned steps S110, about
It is above-mentioned to the related content of step S110 that the focus follows the detailed implementation of script acquisition module 501 to be referred to.
The ID obtains module 502, for obtaining the control of each element control in the element control in the module to be measured
ID.It is appreciated that the ID, which obtains module 502, can be used for executing above-mentioned steps S120, the detailed of module 502 is obtained about the ID
Implementation is referred to above-mentioned to the related content of step S120.
The test script obtains module 503, for according to task to be tested obtain it is preconfigured with it is described to be tested
The corresponding mission script of task, and follow script and the mission script to be combined to obtain test script the focus.
It is appreciated that the test script, which obtains module 503, can be used for executing above-mentioned steps S130, module is obtained about the test script
503 detailed implementation is referred to above-mentioned to the related content of step S130.
The test module 504, for the test script using acquisition, and successively by the control ID of each element control
The function of each element control is tested.It is appreciated that the test module 504 can be used for executing above-mentioned steps
S140, the detailed implementation about the test module 504 are referred to above-mentioned to the related content of step S140.
Optionally, in the present embodiment, described device further includes that the configuration module of script is followed for being pre-configured with focus
505, the configuration module 505 can be specifically used for:
Configuring the first focus follows script and the second focus to follow script, wherein first focus follows script pair
Ying Yu has the first module of the first layout format, second focus follow script correspond to the second layout format the
Two modules.
Obtain the module No. of the first module in the terminal device and the module No. of the second module.
Script is followed to be associated the module No. of first module and first focus, and by second module
Module No. follow script to be associated with second focus.
Referring to Fig. 6, being the structural schematic diagram of a kind of electronic equipment provided by the embodiments of the present application.The equipment includes storage
Device 120 and processor 110.Wherein, memory 120 is for storing one or more computer instruction, one or more computer
Instruction is executed by processor 110, to realize above-mentioned element control automatic test approach.
Electronic equipment shown in fig. 6 further includes bus 140 and communication interface 130, processor 110, communication interface 130 and is deposited
Reservoir 120 is connected by bus 140.
Wherein, memory 120 may include high-speed random access memory (RAM, Random Access Memory),
It may further include non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.By extremely
A few communication interface 130 (can be wired or wireless) is realized logical between the system network element and at least one other network element
Letter connection, can be used internet, wide area network, local network, Metropolitan Area Network (MAN) etc..
Bus 140 can be isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, number
According to bus, control bus etc..Only to be indicated with a four-headed arrow in Fig. 5, it is not intended that an only bus convenient for indicating
Or a type of bus.
Wherein, memory 120 is for storing program, and the processor 110 executes the journey after receiving and executing instruction
Sequence, method performed by aforementioned disclosure embodiment any embodiment can be applied in processor 110, or by handling
Device 110 is realized.
Processor 110 may be a kind of IC chip, the processing capacity with signal.It is above-mentioned during realization
Each step of method can be completed by the integrated logic circuit of the hardware in processor 110 or the instruction of software form.On
The processor 110 stated can be general processor, including central processing unit (Central Processing Unit, abbreviation
CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital
Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific Integrated
Circuit, abbreviation ASIC), ready-made programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or
Person other programmable logic device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute sheet
Disclosed each method, step and logic diagram in disclosed embodiment.General processor can be microprocessor or this at
Reason device is also possible to any conventional processor etc..The step of method in conjunction with disclosed in disclosure embodiment, can direct body
Now executes completion for hardware decoding processor, or in decoding processor hardware and software module combine and execute completion.It is soft
Part module can be located at random access memory, and flash memory, read-only memory, programmable read only memory or electrically erasable programmable are deposited
In the storage medium of this fields such as reservoir, register maturation.The storage medium is located at memory 120, and processor 110 reads storage
Information in device 120, in conjunction with the step of its hardware completion preceding method embodiment.
The embodiment of the present application also provides a kind of readable storage medium storing program for executing, the readable storage medium storing program for executing is stored with computer and can hold
The element control automatic test approach in above-mentioned any means embodiment can be performed in row instruction, the computer executable instructions.
The element control automatic testing equipment 500 and electronic equipment that disclosure embodiment provides, with above embodiment
The element control automatic test approach technical characteristic having the same of offer reaches so also can solve identical technical problem
Identical technical effect.
In conclusion element control automatic test approach, device and electronic equipment provided by the embodiments of the present application, according to
The layout format for the element control surveyed in module obtains the module No. of module to be measured, obtains the preconfigured mould with module to be measured
The corresponding focus of block number follows script, and obtains preconfigured task foot corresponding with task to be tested according to task to be tested
This.Script and mission script is followed to be combined to obtain test script the focus of acquisition.Obtain the element in module to be measured
The control ID of each element control in control, using the test script of acquisition, by the control ID of each element control successively to each element
The function of control is tested.The automatic testing scheme follows script and mission script by being pre-configured with different focuses, with
In official testing, can be spliced and combined according to the actual situation to be quickly obtained corresponding test script.Also, pass through focus
Each element control can be accurately positioned to realize the test to element control in the mode followed.
In embodiment provided herein, it should be understood that disclosed device and method, it can also be by other
Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown
Architectural framework in the cards, function and the behaviour of devices in accordance with embodiments of the present invention, method and computer program product
Make.In this regard, each box in flowchart or block diagram can represent a part of a module, section or code, institute
The a part for stating module, section or code includes one or more executable instructions for implementing the specified logical function.
It should also be noted that function marked in the box can also be to be different from attached drawing in some implementations as replacement
The sequence marked occurs.For example, two continuous boxes can actually be basically executed in parallel, they sometimes can also be by
Opposite sequence executes, and this depends on the function involved.It is also noted that each box in block diagram and or flow chart,
And the combination of the box in block diagram and or flow chart, hardware can be based on the defined function of execution or the dedicated of movement
System realize, or can realize using a combination of dedicated hardware and computer instructions.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or equipment for including a series of elements not only includes those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or equipment institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including institute
State in the process, method, article or equipment of element that there is also other identical elements.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should also be noted that similar label and letter exist
Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing
It is further defined and explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.
Claims (10)
1. a kind of element control automatic test approach, the element control on the page to terminal device is tested, special
Sign is, which comprises
The module No. of the module to be measured is obtained according to the layout format of the element control in the module to be measured on the page, is obtained
It obtains preconfigured focus corresponding with the module No. of the module to be measured and follows script;
Obtain the control ID of each element control in the element control in the module to be measured;
Obtain preconfigured mission script corresponding with the task to be tested according to task to be tested, and by the focus with
It is combined with script and the mission script to obtain test script;
Using the test script of acquisition, and by each element control control ID successively to the function of each element control into
Row test.
2. element control automatic test approach according to claim 1, which is characterized in that the method also includes matching in advance
The step of focus follows script is set, which includes:
Configuring the first focus follows script and the second focus to follow script, wherein first focus follows script to correspond to
The first module with the first layout format, second focus follow script to correspond to the second mould with the second layout format
Block;
Obtain the module No. of the first module in the terminal device and the module No. of the second module;
Script is followed to be associated the module No. of first module and first focus, and by the mould of second module
Block number follows script to be associated with second focus.
3. element control automatic test approach according to claim 1, which is characterized in that described according on the page
The layout format of element control in module to be measured obtains the module No. of the module to be measured, obtain it is preconfigured with it is described to
Before the step of corresponding focus of module No. of survey module follows script, the method also includes:
For each module on the page, the number of the element control in the module is obtained according to the module No. of the module
Amount;
Corresponding digital collection is generated according to the quantity of the element control;
The control ID of each element control is generated according to each digital and described module No. in the digital collection, and will
In the ID list corresponding with the module No. that the control ID deposit of generation is pre-created.
4. element control automatic test approach according to claim 3, which is characterized in that described to obtain the module to be measured
In interior element control the step of the control ID of each element control, comprising:
The module No. for obtaining the module to be measured obtains corresponding with the module to be measured according to the module No. of the module to be measured
ID list;
The control ID of each element control from the element control successively obtained in the ID list in the module to be measured.
5. element control automatic test approach according to claim 1, which is characterized in that the method also includes:
Obtain traversal number when testing to the element control in the module to be measured;
Detecting traversal number element control whether corresponding with the preset module to be measured recommends digit identical;
If they are the same, it is determined that the quantity test of the element control in the terminal device is normal;
If not identical, it is determined that the quantity of the element control in the terminal device is tested abnormal.
6. element control automatic test approach according to claim 1, which is characterized in that described to utilize the test foot obtained
This, and the step of successively function of each element control is tested by the control ID of each element control, comprising:
Script is followed according to the focus in the test script of acquisition, successively navigates to each institute by the control ID of each element control
State element control;
Functional test is carried out to the element control of positioning extremely according to the mission script in the test script, and detects the element
Whether the execution movement of control keeps strokes with default execution;
If consistent, it is determined that the functional test of the element control is normal;
If inconsistent, it is determined that the functional test of the element control is abnormal.
7. a kind of element control automatic testing equipment, the element control on the page to terminal device is tested, special
Sign is that described device includes:
Focus follows script to obtain module, for being obtained according to the layout format of the element control in the module to be measured on the page
To the module No. of the module to be measured, obtains preconfigured focus corresponding with the module No. of the module to be measured and follow foot
This;
ID obtains module, for obtaining the control ID of each element control in the element control in the module to be measured;
Test script obtain module, for according to task to be tested obtain it is preconfigured with described task corresponding to be tested
Business script, and follow script and the mission script to be combined to obtain test script the focus;
Test module, for the test script using acquisition, and by the control ID of each element control successively to each member
The function of plain control is tested.
8. automatic testing equipment according to claim 7, which is characterized in that described device further includes for being pre-configured with coke
Point follows the configuration module of script, and the configuration module is specifically used for:
Configuring the first focus follows script and the second focus to follow script, wherein first focus follows script to correspond to
The first module with the first layout format, second focus follow script to correspond to the second mould with the second layout format
Block;
Obtain the module No. of the first module in the terminal device and the module No. of the second module;
Script is followed to be associated the module No. of first module and first focus, and by the mould of second module
Block number follows script to be associated with second focus.
9. a kind of electronic equipment characterized by comprising processor, storage medium and bus, the storage medium storage is
The executable machine readable instructions of processor are stated, when electronic equipment operation, are led between the processor and the storage medium
Bus communication is crossed, the processor executes the machine readable instructions, to execute member as claimed in any one of claims 1 to 6
The step of plain control automatic test approach.
10. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program on the readable storage medium storing program for executing, the computer
The step of element control automatic test approach as claimed in any one of claims 1 to 6 is executed when program is run by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910060546.9A CN109783389A (en) | 2019-01-22 | 2019-01-22 | Element control automatic test approach, device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910060546.9A CN109783389A (en) | 2019-01-22 | 2019-01-22 | Element control automatic test approach, device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109783389A true CN109783389A (en) | 2019-05-21 |
Family
ID=66501956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910060546.9A Pending CN109783389A (en) | 2019-01-22 | 2019-01-22 | Element control automatic test approach, device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783389A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010159A (en) * | 2021-03-23 | 2021-06-22 | 中国建设银行股份有限公司 | Script-based task processing method and device |
CN113127354A (en) * | 2021-04-21 | 2021-07-16 | 武汉思普崚技术有限公司 | Automatic testing method, device and equipment based on Web UI and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103365779A (en) * | 2013-07-09 | 2013-10-23 | 广东欧珀移动通信有限公司 | Software test method and system |
WO2014137014A1 (en) * | 2013-03-08 | 2014-09-12 | (주)인프라웨어테크놀러지 | Auto-verification method of smart application using terminal automatic execution control |
CN105718370A (en) * | 2016-01-21 | 2016-06-29 | 上海斐讯数据通信技术有限公司 | Android equipment test method and test device |
CN106021099A (en) * | 2016-05-12 | 2016-10-12 | 上海联彤网络通讯技术有限公司 | System and method for achieving UI automatic test of intelligent terminal |
CN106528416A (en) * | 2016-11-03 | 2017-03-22 | 上海斐讯数据通信技术有限公司 | android platform-based automation testing method and system |
CN108235761A (en) * | 2017-03-21 | 2018-06-29 | 深圳中兴力维技术有限公司 | The method and device of automatic detection control |
CN108427646A (en) * | 2018-04-13 | 2018-08-21 | 中国民航信息网络股份有限公司 | Android App automated test frames construction method based on Appium and device |
-
2019
- 2019-01-22 CN CN201910060546.9A patent/CN109783389A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014137014A1 (en) * | 2013-03-08 | 2014-09-12 | (주)인프라웨어테크놀러지 | Auto-verification method of smart application using terminal automatic execution control |
CN103365779A (en) * | 2013-07-09 | 2013-10-23 | 广东欧珀移动通信有限公司 | Software test method and system |
CN105718370A (en) * | 2016-01-21 | 2016-06-29 | 上海斐讯数据通信技术有限公司 | Android equipment test method and test device |
CN106021099A (en) * | 2016-05-12 | 2016-10-12 | 上海联彤网络通讯技术有限公司 | System and method for achieving UI automatic test of intelligent terminal |
CN106528416A (en) * | 2016-11-03 | 2017-03-22 | 上海斐讯数据通信技术有限公司 | android platform-based automation testing method and system |
CN108235761A (en) * | 2017-03-21 | 2018-06-29 | 深圳中兴力维技术有限公司 | The method and device of automatic detection control |
CN108427646A (en) * | 2018-04-13 | 2018-08-21 | 中国民航信息网络股份有限公司 | Android App automated test frames construction method based on Appium and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010159A (en) * | 2021-03-23 | 2021-06-22 | 中国建设银行股份有限公司 | Script-based task processing method and device |
CN113127354A (en) * | 2021-04-21 | 2021-07-16 | 武汉思普崚技术有限公司 | Automatic testing method, device and equipment based on Web UI and storage medium |
CN113127354B (en) * | 2021-04-21 | 2023-08-11 | 武汉思普崚技术有限公司 | Automatic test method, device, equipment and storage medium based on Web UI |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109766879A (en) | Generation, character detection method, device, equipment and the medium of character machining model | |
CN107122301A (en) | Interface detection method and device | |
CN104978270A (en) | Automatic software testing method and apparatus | |
CN105632348A (en) | LED display screen configuration method and device | |
CN107274442A (en) | A kind of image-recognizing method and device | |
CN109375971B (en) | Page layout method and device, storage medium and electronic device | |
US20140351718A1 (en) | Information processing device, information processing method, and computer-readable medium | |
CN106776319B (en) | Automatic test method and device | |
CN106528430B (en) | Application program detection method and device and electronic equipment | |
CN107239403A (en) | A kind of positioning problems method and apparatus | |
CN106326120A (en) | Regression testing method and device for application software and electronic equipment | |
CN111427760B (en) | Page test method, device, equipment and storage medium | |
CN109783389A (en) | Element control automatic test approach, device and electronic equipment | |
CN105868639A (en) | Kernel vulnerability repair method and device | |
CN110096413A (en) | A kind of disk localization method, system and electronic equipment and storage medium | |
CN105632270A (en) | Data processing method and data processing device based on exam | |
CN109753435A (en) | A kind of method for testing software and device | |
CN104809053A (en) | Control style testing method and device | |
CN111833060B (en) | Information tracing method and device, storage medium and electronic equipment | |
CN109388564A (en) | A kind of test method, device and electronic equipment | |
CN109426674A (en) | A kind of printed circuit board detecting method and system | |
CN116521148A (en) | Code generation method and device, nonvolatile storage medium and electronic equipment | |
CN106293671B (en) | Method and device for generating component template | |
CN113961296B (en) | Page element layout method and device, readable medium and electronic equipment | |
CN111124903A (en) | Element coordinate automatic testing method based on visual system and storage medium |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190521 |