CN109753435A - A kind of method for testing software and device - Google Patents

A kind of method for testing software and device Download PDF

Info

Publication number
CN109753435A
CN109753435A CN201811642778.7A CN201811642778A CN109753435A CN 109753435 A CN109753435 A CN 109753435A CN 201811642778 A CN201811642778 A CN 201811642778A CN 109753435 A CN109753435 A CN 109753435A
Authority
CN
China
Prior art keywords
color
target
region
expected
target area
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.)
Granted
Application number
CN201811642778.7A
Other languages
Chinese (zh)
Other versions
CN109753435B (en
Inventor
戴亦斌
谢春鸿
景成新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Testin Information Technology Co Ltd
Original Assignee
Guangzhou Cloud Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Cloud Information Technology Co Ltd filed Critical Guangzhou Cloud Information Technology Co Ltd
Priority to CN201811642778.7A priority Critical patent/CN109753435B/en
Publication of CN109753435A publication Critical patent/CN109753435A/en
Application granted granted Critical
Publication of CN109753435B publication Critical patent/CN109753435B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

This application discloses a kind of method for testing software and devices.This method comprises: determining the target area in the screenshot of software under testing interface, the target area is the expected region including target widget;Determine that the target subregion in the target area, the target subregion are region shared by the default characteristic color of the target widget;If it is determined that the target subregion matches with expected regional scope, then the test operation to the target subregion is executed.As it can be seen that the application, with identification and to the test operation of the control, can effectively improve control recognition accuracy, and then improve test coverage and measuring accuracy by the way that characteristic color, and determining this feature color region shared by the screenshot of software under testing interface is arranged for control.

Description

A kind of method for testing software and device
Technical field
This application involves field of computer technology more particularly to a kind of method for testing software and device.
Background technique
Software test refers to the process of a kind of correctness, integrality, safety and quality for promoting identification software.
Current software test scheme, there are some controls to accurately identify, and causes software test effect poor Problem.Such as: for the control for occurring at random and disappearing in the short time, since control property information is less or test frame ability Deficiency causes to be difficult to accurately identify the control;For the control of carousel figure, although image recognition can recognize the figure currently shown Picture, but due to carousel fast speed, it may be after recognizing certain image, test operation will do it in next image, cause to survey Examination failure.
Accordingly, it is desirable to provide a kind of significantly more efficient software test scheme.
Summary of the invention
This specification embodiment provides a kind of software test scheme, for improving the recognition accuracy of control, and then improves Automatic test coverage rate and measuring accuracy.
This specification embodiment also provides a kind of method for testing software characterized by comprising
Determine that the target area in the screenshot of software under testing interface, the target area are the expected area including target widget Domain;
Determine that the target subregion in the target area, the target subregion are the default feature of the target widget Region shared by color;
If it is determined that the target subregion matches with expected regional scope, then the survey to the target subregion is executed Examination operation.
Optionally, the target area in the determining software under testing interface screenshot, comprising:
Obtain the corresponding test script in software under testing interface;
Based on the expected areas of test script record, the target area is determined;
Wherein, the expected areas is the area comprising the target widget divided in the software under testing interface in advance Domain.
Optionally, before determining the target subregion in the target area, further includes:
Determine that the color of object being selected, the color of object are the color in the expected areas;
If the color of object meets default characteristic condition, the default feature face is set by the color of object Color.
Optionally, further includes:
Determine that the corresponding magnification region of the expected areas, the magnification region include the expected areas;
Region between the boundary of the expected areas and the boundary of the magnification region is determined as peripheral region;
If it is determined that the accounting in the region of color of object described in the peripheral region does not transfinite, it is determined that the color of object Meet the default characteristic condition.
Optionally, further includes:
If the color of object meets default characteristic condition, by the region of color of object described in the expected areas Accounting is determined as the expected accounting.
Optionally, further includes:
According to the area of the target area and the target subregion, the target in the target area is determined The practical accounting in region;
If the practical accounting matches with the expected accounting, it is determined that the target subregion and the expected area Domain range matches.
Optionally, however, it is determined that the practical accounting is not matched that with the expected accounting, then repeats interception software under testing circle The screenshot in face, until target area and target subregion that practical accounting and expected accounting match are determined, alternatively, until super When.
Optionally, the target subregion in the determination target area, comprising:
Using region shared by the color to match in the target area with the default characteristic color as the target Subregion.
Optionally, further includes:
Based on pre-set color tolerance, the determining color to match with the default characteristic color;
Based on the pixel data of the target area, the picture of the color to match with the default characteristic color is determined Plain lattice;
Region shared by the pixel compartments is determined as area shared by the color to match with the default characteristic color Domain.
This specification embodiment also provides a kind of software testing device characterized by comprising
First determining module, for determining that the target area in the screenshot of software under testing interface, the target area are target Region where control is expected;
Second determining module, for determining the target subregion in the target area, the target subregion is described Region shared by the default characteristic color of target widget;
Test module, for if it is determined that the target subregion matches with expected regional scope, then execution to be to described The test operation of target subregion.
Optionally, the first determining module is specifically used for:
Obtain the corresponding test script in software under testing interface;Based on the expected areas of test script record, institute is determined State target area;
Wherein, the expected areas is the area comprising the target widget divided in the software under testing interface in advance Domain.
Optionally, further includes:
Color records module, for determining that the color of object being selected, the color of object are in the expected areas Color;If the color of object meets default characteristic condition, the default characteristic color is set by the color of object.
Optionally, color records module, is also used to:
Determine that the corresponding magnification region of the expected areas, the magnification region include the expected areas;It will be described pre- Region between the boundary of term area and the boundary of the magnification region is determined as peripheral region;If it is determined that in the peripheral region The accounting in the region of the color of object does not transfinite, it is determined that the color of object meets the default characteristic condition.
Optionally, color records module, is also used to:
If the color of object meets default characteristic condition, by the region of color of object described in the expected areas Accounting is determined as the expected accounting.
Optionally, further includes:
Matching module determines the target area for the area according to the target area and the target subregion In the target subregion practical accounting;If the practical accounting matches with the expected accounting, it is determined that the mesh Mark subregion matches with the expected regional scope.
Optionally, test module is also used to:
If it is determined that the practical accounting is not matched that with the expected accounting, then cutting for interception software under testing interface is repeated Figure, until target area and target subregion that practical accounting and expected accounting match are determined, alternatively, until time-out.
Optionally, the second determining module is specifically used for:
Using region shared by the color to match in the target area with the default characteristic color as the target Subregion.
Optionally, the second determining module is specifically used for:
Based on pre-set color tolerance, the determining color to match with the default characteristic color;Based on the target area Pixel data, determine the pixel compartments of the color to match with the default characteristic color;By pixel compartments institute occupied area Domain is determined as region shared by the color to match with the default characteristic color.
This specification embodiment also provides a kind of electronic equipment, which includes processor, memory and be stored in On the memory and the computer program that can run on the processor, the computer program are executed by the processor The step of Shi Shixian above-mentioned method for testing software.
This specification embodiment also provides a kind of computer readable storage medium, which is characterized in that described computer-readable Computer program is stored on storage medium, the computer program realizes above-mentioned method for testing software when being executed by processor Step.
This specification embodiment use at least one above-mentioned technical solution can reach it is following the utility model has the advantages that
By judging the characteristic color of control, and area shared by this feature color is detected in the screenshot of software under testing interface Domain, to execute the test operation to the region when determining that region shared by characteristic color and expected regional scope match, To complete the test operation to the control.Compared with prior art, control region, energy are identified by the characteristic color of control Control recognition accuracy is enough effectively improved, and then improves automatic test coverage rate and measuring accuracy.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present application, constitutes part of this application, this Shen Illustrative embodiments and their description please are not constituted an undue limitation on the present application for explaining the application.In the accompanying drawings:
Fig. 1 is a kind of schematic diagram for application scenarios that this specification provides;
Fig. 2 is a kind of flow diagram for method for testing software that one embodiment of this specification provides;
Positional diagram between each region that Fig. 3 provides for one embodiment of this specification;
Fig. 4 is a kind of structural schematic diagram for software testing device that one embodiment of this specification provides;
Fig. 5 is the structural schematic diagram for a kind of electronic equipment that one embodiment of this specification provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with the application specific embodiment and Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall in the protection scope of this application.
For the problem of the existing technology of background technology part statement, the present invention provides a kind of method for testing software, By judging the characteristic color of control, and region shared by this feature color is detected in the screenshot of software under testing interface, true Determine region shared by characteristic color and when expected regional scope matches, execute the test operation to the region, to complete pair The test operation of the control.Compared with prior art, control region is identified by the characteristic color of control, can effectively mentioned High control recognition accuracy, and then improve automatic test coverage rate and measuring accuracy.
Wherein, control refers to the encapsulation to data and method, such as: common hyperlink control in the page;The spy of control Sign color refers to the color that in the visible interface of control, can embody the color character at the interface;Test operation refers to based on test The operation that the control is carried out in the automatic test of script;Automatic test generally refers to the automation of software test.
Application scenarios of the invention are illustrated below.
It include: test platform 110, testing tool 120 and software under testing 130 in this application scene referring to Fig. 1;Wherein:
In the recording process of test script, test platform 110 obtains the interface screenshot of software under testing 130, and by testing Personnel intercept the region including certain control from the interface screenshot, are denoted as target area, and be recorded in test script;Then, A representative color is chosen from target area, as the characteristic color of the control, and then obtains this feature color in target Shared target subregion in region, and be recorded in test script.
In automatic test course, 110 read test script of test platform, and by testing tool 120 to software The interface screenshot is tested, with target subregion and the target subregion obtained in recording process checked in the interface screenshot Whether match, if so, executing the test operation to target subregion.
Wherein, test platform can be the platform that software test side provides;Testing tool refers to can by some tools It is shown in some simple problems of software intuitively in face of reader, tester can be made preferably to find out software error in this way Place.
Below in conjunction with attached drawing, the technical scheme provided by various embodiments of the present application will be described in detail.
Fig. 2 is a kind of flow diagram for software test scheme that one embodiment of this specification provides, referring to fig. 2, the party Method can specifically include:
Step 220 determines target area in the screenshot of software under testing interface, and it includes target control that the target area, which is expected, The region of part;A kind of its implementation can be with are as follows:
Obtain the corresponding test script in software under testing interface;Based on the expected areas of test script record, institute is determined State target area;Wherein, the expected areas is to be divided in the software under testing interface in advance comprising the target widget Region.Referring to Fig. 3, this implementation can specifically include following two parts:
It records part: software interface being projected in the mapping screen for recording wscript.exe, interface projected image 310 is obtained; Determine the expected areas 320 comprising target widget that tester draws a circle to approve in projected image, and the expected areas is in software circle Relative position in face is recorded in test script.
Part of detecting: the relative position based on the expected areas recorded in the test script determines that software under testing interface is cut Region corresponding with the relative position in figure, is denoted as target area.
As it can be seen that this implementation of step 220 will be by will ' theoretically ' include target during recording test script The expected areas of control is recorded in test script, as a result, can be automatic and accurate by test script in automatic test course Slave software under testing interface screenshot in find the corresponding target area of expected areas, for subsequent control identification support is provided.
Step 240 determines that target subregion in the target area, the target subregion are the target widget Region shared by default characteristic color;
It is understandable to be, before step 240 further include: the step of recording feature and its region, the step is specific It can be with are as follows:
Determine that the color of object being selected, the color of object are the color in the expected areas, it can be by tester It manually selects, is automatically selected after image analysis can also being carried out to expected areas by machine;If the color of object meets default spy Sign condition then sets the default characteristic color for the color of object, and determines color of object described in expected areas The accounting in region to be denoted as expected accounting, and characteristic color and expected accounting is recorded in test script, so that automation is surveyed Examination process uses;If the color of object is unsatisfactory for default characteristic condition, indicate that tester gets colors again.As a result, It can be that a characteristic color is arranged in control or carousel figure, and then can reach and accurately identify based on the different characteristic embodied on the UI of interface The purpose of control or carousel figure.
Wherein, judging whether color of object meets the implementation of default characteristic condition step can be with are as follows:
Determine that the corresponding magnification region of the expected areas, the magnification region include the expected areas;It will be described pre- Region between the boundary of term area and the boundary of the magnification region is determined as peripheral region;If it is determined that in the peripheral region The accounting in the region of the color of object does not transfinite, it is determined that the color of object meets the default characteristic condition;If it is determined that The accounting in the region of the color of object in the peripheral region transfinites, it is determined that the color of object is unsatisfactory for described default Characteristic condition.Referring to Fig. 3, specifically can be exemplified are as follows:
Assuming that the color of object chosen from expected areas 320 is black, then based on preset amplification rule, determine opposite Expected areas 320 puts twice magnification region 340;It checks between the boundary of magnification region 340 and the boundary of expected areas 320 Region (being denoted as peripheral region) in black region, and calculate whether accounting of the black region in the peripheral region transfinites (such as: whether accounting is more than 10%), if it is not, then recording the default characteristic color that black is target widget.It can apply as a result, To the terminal device of various models, it is contemplated that when region changes, by introducing the concept of magnification region, to avoid expected areas Influence of the feature to the feature region to be searched (i.e. target subregion) in the region of surrounding, to improve feature area The dividing precision in domain provides data for control accuracy of identification and supports.
Based on this, a kind of implementation of step 240 can be with are as follows:
Using region shared by the color to match in the target area with the default characteristic color as the target Subregion.Specifically it can be exemplified are as follows:
Based on pre-set color tolerance, the determining color to match with the default characteristic color;Based on the target area Pixel data, determine the pixel compartments of the color to match with the default characteristic color;By pixel compartments institute occupied area Domain is determined as region shared by the color to match with the default characteristic color.
Wherein, color tolerance refers to the selection range set when getting colors, and tolerance is bigger, and the range of selection is also got over Greatly, numerical value is between 0-255;Such as: the color of selection is blue, light blue and dark blue if setting color tolerance is 50 In the range of selected color.
Preferably, the color tolerance that can be chosen includes: to be approximately equal to, be higher than, being equal to option;Wherein, being approximately equal to can be exemplified Are as follows: hexadecimal color #38A1FD, color tolerance 20.
Step 260, if it is determined that the target subregion matches with expected regional scope, then execute to target The test operation in region.A kind of its implementation can be with are as follows:
According to the area of the target area and the target subregion, the target subregion in the target area is determined Practical accounting;If the practical accounting matches with the expected accounting, it is determined that the target subregion and expected area Domain range matches.That is, expection accounting of the region 330 of part record in expected areas 320 is being recorded in comparison, and automatic Change the practical accounting of the target subregion detected in test process in the target area, to determine whether the two is same or similar, If so, the test operation to the target subregion is executed, to complete the test operation to the target widget.As it can be seen that this reality Existing mode determines whether target subregion meets expected regional scope by the practical accounting of comparison and expected accounting, to avoid When being applied to the terminal device of various models, it is accurate to control identification that the size of target area and target subregion changes The influence of degree.
If it is determined that the practical accounting is not matched that with the expected accounting, then cutting for interception software under testing interface is repeated Figure, until target area and target area that practical accounting and expected accounting match are determined, alternatively, until time-out.That is, every Every preset time period, repetition intercepts the screenshot at the software under testing interface, and repeats above-mentioned steps 220 to step 240, to look into Whether the target subregion seen in the software under testing interface screenshot intercepted every time matches with expected regional scope, until finding Satisfactory target subregion, alternatively, until time-out.As a result, can terminal device initiate request software interface during, By repeatedly carrying out above-mentioned steps, to avoid caused by network delay etc. the problem of control recognition failures.
As it can be seen that the present embodiment passes through the characteristic color for judging control, and this feature is detected in the screenshot of software under testing interface Region shared by color, to execute to the area when determining that region shared by characteristic color and expected regional scope match The test operation in domain, to complete the test operation to the control.Compared with prior art, control is identified by the characteristic color of control Part region can effectively improve control recognition accuracy, and then improve automatic test coverage rate and measuring accuracy.
In addition, for simple description, therefore, it is stated as a series of action groups for above method embodiment It closes, but those skilled in the art should understand that, embodiment of the present invention is not limited by the described action sequence, because Embodiment according to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art It should be aware of, embodiment described in this description belongs to preferred embodiment, and related movement is not necessarily originally Necessary to invention embodiment.
Fig. 4 is a kind of structural schematic diagram for software testing device that one embodiment of this specification provides, referring to fig. 4, the dress Setting can specifically include: the first determining module 41, the second determining module 42 and test module 43, in which:
First determining module 41, for determining that the target area in the screenshot of software under testing interface, the target area are mesh Mark the region at the expected place of control;
Second determining module 42, for determining that the target subregion in the target area, the target subregion are institute State region shared by the default characteristic color of target widget;
Test module 43, for if it is determined that the target subregion matches with expected regional scope, then execution to be to institute State the test operation of target subregion.
Optionally, the first determining module 41, is specifically used for:
Obtain the corresponding test script in software under testing interface;Based on the expected areas of test script record, institute is determined State target area;
Wherein, the expected areas is the area comprising the target widget divided in the software under testing interface in advance Domain.
Optionally, further includes:
Color records module, for determining that the color of object being selected, the color of object are in the expected areas Color;If the color of object meets default characteristic condition, the default characteristic color is set by the color of object.
Optionally, color records module, is also used to:
Determine that the corresponding magnification region of the expected areas, the magnification region include the expected areas;It will be described pre- Region between the boundary of term area and the boundary of the magnification region is determined as peripheral region;If it is determined that in the peripheral region The accounting in the region of the color of object does not transfinite, it is determined that the color of object meets the default characteristic condition.
Optionally, color records module, is also used to:
If the color of object meets default characteristic condition, by the region of color of object described in the expected areas Accounting is determined as the expected accounting.
Optionally, device further include:
Matching module determines the target area for the area according to the target area and the target subregion In the target subregion practical accounting;If the practical accounting matches with the expected accounting, it is determined that the mesh Mark subregion matches with the expected regional scope.
Optionally, test module is also used to:
If it is determined that the practical accounting is not matched that with the expected accounting, then cutting for interception software under testing interface is repeated Figure, until target area and target subregion that practical accounting and expected accounting match are determined, alternatively, until time-out.
Optionally, the second determining module 42, is specifically used for:
Using region shared by the color to match in the target area with the default characteristic color as the target Subregion.
Optionally, the second determining module 42, is specifically used for:
Based on pre-set color tolerance, the determining color to match with the default characteristic color;Based on the target area Pixel data, determine the pixel compartments of the color to match with the default characteristic color;By pixel compartments institute occupied area Domain is determined as region shared by the color to match with the default characteristic color.
As it can be seen that the present embodiment passes through the characteristic color for judging control, and this feature is detected in the screenshot of software under testing interface Region shared by color, to execute to the area when determining that region shared by characteristic color and expected regional scope match The test operation in domain, to complete the test operation to the control.Compared with prior art, control is identified by the characteristic color of control Part region can effectively improve control recognition accuracy, and then improve automatic test coverage rate and measuring accuracy.Separately Outside, for above-mentioned apparatus embodiment, since it is substantially similar to method implementation, so be described relatively simple, Related place illustrates referring to the part of method implementation.Moreover, it should be noted that in each of the device of the invention In component, logical partitioning has been carried out to component therein according to the function that it to be realized, still, the present invention is not only restricted to this, It can according to need and all parts are repartitioned or are combined.
Fig. 5 is the structural schematic diagram for a kind of electronic equipment that one embodiment of this specification provides, and referring to Fig. 5, which is set Standby includes processor, internal bus, network interface, memory and nonvolatile memory, is also possible that other business certainly Required hardware.Processor from read in nonvolatile memory corresponding computer program into memory then run, Software testing device is formed on logic level.Certainly, other than software realization mode, other realization sides are not precluded in the application Formula, such as logical device or the mode of software and hardware combining etc., that is to say, that the executing subject of following process flow is simultaneously unlimited Due to each logic unit, it is also possible to hardware or logical device.
Network interface, processor and memory can be connected with each other by bus system.Bus can be ISA (Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard Architecture, expanding the industrial standard structure) bus etc..The bus can be divided into address bus, data/address bus, control always Line etc..Only to be indicated with a four-headed arrow in Fig. 5, it is not intended that an only bus or a type of convenient for indicating Bus.
Memory is for storing program.Specifically, program may include program code, and said program code includes computer Operational order.Memory may include read-only memory and random access memory, and provide instruction and data to processor.It deposits Reservoir may include high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-volatile Memory (non-volatile memory), for example, at least 1 magnetic disk storage.
Processor for executing the program of the memory storage, and specifically executes:
Determine that the target area in the screenshot of software under testing interface, the target area are the expected area including target widget Domain;
Determine that the target subregion in the target area, the target subregion are the default feature of the target widget Region shared by color;
If it is determined that the target subregion matches with expected regional scope, then the survey to the target subregion is executed Examination operation.
Software testing device or manager's (Master) node disclosed in the above-mentioned embodiment illustrated in fig. 4 such as the application execute Method can be applied in processor, or be realized by processor.Processor may be a kind of IC chip, have signal Processing capacity.During realization, each step of the above method can pass through the integrated logic circuit of the hardware in processor Or the instruction of software form is completed.Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be Digital Signal Processing Device (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute the application implementation Disclosed each method, step and logic diagram in example.General processor can be microprocessor or the processor can also be with It is any conventional processor etc..The step of method in conjunction with disclosed in the embodiment of the present application, can be embodied directly in hardware decoding Processor executes completion, or in decoding processor hardware and software module combination execute completion.Software module can position In random access memory, flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register In the storage medium of equal this fields maturation.The storage medium is located at memory, and processor reads the information in memory, in conjunction with it Hardware completes the step of above method.
The method that software testing device can also carry out Fig. 2, and realize the method that manager's node executes.
Based on identical innovation and creation, the embodiment of the present application also provides a kind of computer readable storage medium, the meter Calculation machine readable storage medium storing program for executing stores one or more programs, and one or more of programs are when by the electricity including multiple application programs When sub- equipment executes, so that the electronic equipment executes the method for testing software that the corresponding embodiment of Fig. 2 provides.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part explanation.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can With or may be advantageous.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product. Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal Replacement, improvement etc., should be included within the scope of the claims of this application.

Claims (10)

1. a kind of method for testing software characterized by comprising
Determine that the target area in the screenshot of software under testing interface, the target area are the expected region including target widget;
Determine that the target subregion in the target area, the target subregion are the default characteristic color of the target widget Shared region;
If it is determined that the target subregion matches with expected regional scope, then executes the test to the target subregion and grasp Make.
2. the method according to claim 1, wherein the target area in the determining software under testing interface screenshot Domain, comprising:
Obtain the corresponding test script in software under testing interface;
Based on the expected areas of test script record, the target area is determined;
Wherein, the expected areas is the region comprising the target widget divided in the software under testing interface in advance.
3. according to the method described in claim 2, it is characterized in that, determine the target subregion in the target area it Before, further includes:
Determine that the color of object being selected, the color of object are the color in the expected areas;
If the color of object meets default characteristic condition, the default characteristic color is set by the color of object.
4. according to the method described in claim 3, it is characterized by further comprising:
Determine that the corresponding magnification region of the expected areas, the magnification region include the expected areas;
Region between the boundary of the expected areas and the boundary of the magnification region is determined as peripheral region;
If it is determined that the accounting in the region of color of object described in the peripheral region does not transfinite, it is determined that the color of object meets The default characteristic condition.
5. according to the method described in claim 4, it is characterized by further comprising:
If the color of object meets default characteristic condition, by the accounting in the region of color of object described in the expected areas It is determined as the expected accounting.
6. according to the method described in claim 5, it is characterized by further comprising:
According to the area of the target area and the target subregion, the target subregion in the target area is determined Practical accounting;
If the practical accounting matches with the expected accounting, it is determined that the target subregion and the expected region model It encloses and matches.
7. according to the method described in claim 6, it is characterized in that,
If it is determined that the practical accounting is not matched that with the expected accounting, then the screenshot for intercepting software under testing interface is repeated, directly To the target area and target subregion for determining that practical accounting and expected accounting match, alternatively, until time-out.
8. the method according to claim 1, wherein the target subregion in the determination target area, Include:
Using region shared by the color to match in the target area with the default characteristic color as the target sub-district Domain.
9. according to the method described in claim 8, it is characterized by further comprising:
Based on pre-set color tolerance, the determining color to match with the default characteristic color;
Based on the pixel data of the target area, the pixel of the color to match with the default characteristic color is determined Lattice;
Region shared by the pixel compartments is determined as region shared by the color to match with the default characteristic color.
10. a kind of software testing device characterized by comprising
First determining module, for determining that the target area in the screenshot of software under testing interface, the target area are target widget Region where it is expected that;
Second determining module, for determining that the target subregion in the target area, the target subregion are the target Region shared by the default characteristic color of control;
Test module, for if it is determined that the target subregion matches with expected regional scope, then execution to be to the target The test operation of subregion.
CN201811642778.7A 2018-12-29 2018-12-29 Software testing method and device Active CN109753435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811642778.7A CN109753435B (en) 2018-12-29 2018-12-29 Software testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811642778.7A CN109753435B (en) 2018-12-29 2018-12-29 Software testing method and device

Publications (2)

Publication Number Publication Date
CN109753435A true CN109753435A (en) 2019-05-14
CN109753435B CN109753435B (en) 2022-02-01

Family

ID=66404526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811642778.7A Active CN109753435B (en) 2018-12-29 2018-12-29 Software testing method and device

Country Status (1)

Country Link
CN (1) CN109753435B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111079730A (en) * 2019-11-20 2020-04-28 北京云聚智慧科技有限公司 Method for determining area of sample image in interface image and electronic equipment
CN111949263A (en) * 2020-07-08 2020-11-17 中核武汉核电运行技术股份有限公司 Human factor engineering design verification method based on image recognition technology
CN115048309A (en) * 2022-06-27 2022-09-13 广州掌动智能科技有限公司 Non-intrusive APP software performance test method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2439628A2 (en) * 2010-10-06 2012-04-11 Samsung Electronics Co., Ltd. Methods for displaying a user interface on a remote control device and a remote control device applying the same
CN102830958A (en) * 2011-06-16 2012-12-19 奇智软件(北京)有限公司 Method and system for obtaining interface control information
US20140098931A1 (en) * 2012-10-04 2014-04-10 General Electric Company Dual display ct scanner user interface
CN105868100A (en) * 2015-12-22 2016-08-17 乐视网信息技术(北京)股份有限公司 Android system-based automatic test method and device
CN106445359A (en) * 2016-10-28 2017-02-22 合网络技术(北京)有限公司 Control controlling method and device
CN106445816A (en) * 2016-09-07 2017-02-22 美的智慧家居科技有限公司 Control execution method and apparatus
CN107205120A (en) * 2017-06-30 2017-09-26 维沃移动通信有限公司 The processing method and mobile terminal of a kind of image
CN107734325A (en) * 2017-10-31 2018-02-23 武汉华星光电技术有限公司 A kind of image processing method and its equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2439628A2 (en) * 2010-10-06 2012-04-11 Samsung Electronics Co., Ltd. Methods for displaying a user interface on a remote control device and a remote control device applying the same
CN102830958A (en) * 2011-06-16 2012-12-19 奇智软件(北京)有限公司 Method and system for obtaining interface control information
US20140098931A1 (en) * 2012-10-04 2014-04-10 General Electric Company Dual display ct scanner user interface
CN105868100A (en) * 2015-12-22 2016-08-17 乐视网信息技术(北京)股份有限公司 Android system-based automatic test method and device
CN106445816A (en) * 2016-09-07 2017-02-22 美的智慧家居科技有限公司 Control execution method and apparatus
CN106445359A (en) * 2016-10-28 2017-02-22 合网络技术(北京)有限公司 Control controlling method and device
CN107205120A (en) * 2017-06-30 2017-09-26 维沃移动通信有限公司 The processing method and mobile terminal of a kind of image
CN107734325A (en) * 2017-10-31 2018-02-23 武汉华星光电技术有限公司 A kind of image processing method and its equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111079730A (en) * 2019-11-20 2020-04-28 北京云聚智慧科技有限公司 Method for determining area of sample image in interface image and electronic equipment
CN111079730B (en) * 2019-11-20 2023-12-22 北京云聚智慧科技有限公司 Method for determining area of sample graph in interface graph and electronic equipment
CN111949263A (en) * 2020-07-08 2020-11-17 中核武汉核电运行技术股份有限公司 Human factor engineering design verification method based on image recognition technology
CN111949263B (en) * 2020-07-08 2024-05-14 中核武汉核电运行技术股份有限公司 Man-factor engineering design verification method based on image recognition technology
CN115048309A (en) * 2022-06-27 2022-09-13 广州掌动智能科技有限公司 Non-intrusive APP software performance test method and system
CN115048309B (en) * 2022-06-27 2023-03-07 广州掌动智能科技有限公司 Non-intrusive APP software performance test method and system

Also Published As

Publication number Publication date
CN109753435B (en) 2022-02-01

Similar Documents

Publication Publication Date Title
CN109871316A (en) A kind of control recognition methods and device
CN109542789B (en) Code coverage rate statistical method and device
CN109190539A (en) Face identification method and device
CN109753435A (en) A kind of method for testing software and device
CN107967209B (en) Method for detecting error in front-end webpage code, detection equipment and server
CN109684225A (en) A kind of method for testing software and device
CN109858542A (en) A kind of character identifying method and device
CN107218887B (en) Method and apparatus for measuring dimensions of an object
CN109614324A (en) A kind of method for generating test case and device
CN109033772A (en) A kind of input method and device of verification information
CN109308263A (en) A kind of small routine test method, device and equipment
CN109740352A (en) A kind of account processing method, device and electronic equipment
CN109102026A (en) A kind of vehicle image detection method, apparatus and system
CN115118627B (en) Temporary speed limiting server testing method and device
CN108304243A (en) Interface creating method, device, computer equipment and storage medium
CN109062793B (en) Test method and device of roller control and electronic equipment
CN110458394A (en) A kind of index measuring and calculating method and device based on Object related degree
CN109189677A (en) A kind of test method and device for variable value more new state
CN109542775B (en) Test script generation and execution method and device
EP3232405B1 (en) Image processing apparatus and method for processing images
CN109740336A (en) Recognition methods, device and the electronic equipment of a kind of verification information in picture
CN110213123A (en) A kind of flux monitoring method, device and equipment
CN110020780A (en) The method, apparatus and electronic equipment of information output
CN108650150A (en) A kind of data verification method and device
CN109063967A (en) A kind of processing method, device and the electronic equipment of air control scene characteristic tensor

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210719

Address after: 100016 no.4301, No.52 Jiuxianqiao hospital, Chaoyang District, Beijing

Applicant after: BEIJING TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Room 2016, building 2, No.8, Fenghuang Third Road, Zhongxin Guangzhou Knowledge City, Guangzhou 510260, Guangdong Province

Applicant before: GUANGZHOU TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant