CN109783351A - Interface detection method, apparatus and computer readable storage medium - Google Patents

Interface detection method, apparatus and computer readable storage medium Download PDF

Info

Publication number
CN109783351A
CN109783351A CN201811526437.3A CN201811526437A CN109783351A CN 109783351 A CN109783351 A CN 109783351A CN 201811526437 A CN201811526437 A CN 201811526437A CN 109783351 A CN109783351 A CN 109783351A
Authority
CN
China
Prior art keywords
interface
test
abnormal
standard
color value
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
Application number
CN201811526437.3A
Other languages
Chinese (zh)
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.)
Chongqing Financial Assets Exchange LLC
Original Assignee
Chongqing Financial Assets Exchange LLC
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 Chongqing Financial Assets Exchange LLC filed Critical Chongqing Financial Assets Exchange LLC
Priority to CN201811526437.3A priority Critical patent/CN109783351A/en
Publication of CN109783351A publication Critical patent/CN109783351A/en
Pending legal-status Critical Current

Links

Abstract

The present invention relates to functional tests, disclose a kind of interface detection method, this method comprises: determining the target software of pending interface detection, and automatic test script corresponding with target software is obtained, executes automatic test script and interface detection is carried out to target software;During executing automatic test script, the interface of target software is recorded, and according to preset time point or mark point, is stored after recording multiple continuous test interface figures of interception in the video obtained;Test interface figure is analyzed according to preset anomalous identification rule, to determine abnormal interface, and test report is generated according to the abnormal interface identified from whole test interface figures.The present invention also proposes a kind of interface detection device and a kind of computer readable storage medium.The present invention solves the technical issues of interface detection inefficiency in the prior art.

Description

Interface detection method, apparatus and computer readable storage medium
Technical field
The present invention relates to functional test technical field more particularly to a kind of interface detection method, apparatus and computer-readable Storage medium.
Background technique
In the development process of software, need to carry out various tests to software, to guarantee that the software after distribution can be just It is often used, wherein just including to carry out UI (User Interface, user interface) test to software, was tested with timely discovery The UI mistake that occurs in journey is simultaneously modified.Currently used UI test method is by tester by checking wrong screenshot Mode carries out positioning problems, but not only test speed is low for this test mode, but also is manually determining test process The phenomenon of positioning mistake is easy to appear during position, in conclusion at present by tester by checking the side of wrong screenshot Formula carries out positioning problems, leads to the inefficiency of interface detection.
Summary of the invention
The present invention provides a kind of interface detection method, apparatus and computer readable storage medium, main purpose are to solve Certainly in the prior art interface detection inefficiency the technical issues of.
To achieve the above object, the present invention also provides a kind of interface detection methods, this method comprises:
It determines the target software of pending interface detection, and obtains automatic test foot corresponding with the target software This, executes the automatic test script and carries out interface detection to the target software;
During executing the automatic test script, the interface of the target software is recorded, and according to Preset time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained;
The test interface figure is analyzed according to preset anomalous identification rule, with determining abnormal interface, and according to The abnormal interface identified from whole test interface figures generates test report.
Optionally, described that the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes:
The interface element for extracting predetermined position on test interface figure, obtains the attribute value of the interface element;
The standard attribute value for determining the interface element, judge obtain symbolic animal of the birth year value and the standard attribute value whether one It causes;
If inconsistent, determine that the corresponding interface of the test interface figure is abnormal interface, and tests boundary according to from whole The abnormal interface identified in the figure of face generates test report.
Optionally, described that the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes:
According to the mapping relations between preset automatic test script and standard interface figure, searches and used with test process The corresponding standard interface figure of automatic test script;
The test interface figure of storage and the standard interface figure are compared, with obtain the test interface figure with it is described Diversity factor between standard interface figure;
If the diversity factor between the test interface figure and the standard interface figure is greater than preset threshold, by corresponding survey Surface chart is tried as abnormal surface chart;
The abnormal interface of the target software is determined according to the abnormal surface chart, and according to from whole test interface figures The abnormal interface identified generates test report.
Optionally, the test interface figure by storage is compared with the standard interface figure, to obtain the test The step of diversity factor between surface chart and the standard interface figure includes:
The first color value of predetermined position is extracted from test interface figure;
It determines standard interface figure corresponding with the test interface figure, and extracts from the standard interface figure and preset with described The second color value at the identical position in position;
First color value and second color value are compared, to determine the first color value and the second color value Between diversity factor, using the diversity factor between first color value and second color value as the test interface figure with Diversity factor between the standard interface figure.
Optionally, the step of first color value that predetermined position is extracted from test interface figure includes:
The test interface figure is divided into the figure block of the first preset quantity;
According to preset sample rate, the figure block of the second preset quantity is selected from first preset quantity;
The first face of predetermined position from the figure block for extracting selection in the image block of second preset quantity Color value.
In addition, to achieve the above object, the present invention also provides a kind of interface detection device, which includes memory and place Device is managed, is stored with the interface detection program that can be run on the processor, the interface detection program quilt in the memory The processor realizes following steps when executing:
It determines the target software of pending interface detection, and obtains automatic test foot corresponding with the target software This, executes the automatic test script and carries out interface detection to the target software;
During executing the automatic test script, the interface of the target software is recorded, and according to Preset time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained;
The test interface figure is analyzed according to preset anomalous identification rule, with determining abnormal interface, and according to The abnormal interface identified from whole test interface figures generates test report.
Optionally, described that the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes:
The interface element for extracting predetermined position on test interface figure, obtains the attribute value of the interface element;
The standard attribute value for determining the interface element, judge obtain symbolic animal of the birth year value and the standard attribute value whether one It causes;
If inconsistent, determine that the corresponding interface of the test interface figure is abnormal interface, and tests boundary according to from whole The abnormal interface identified in the figure of face generates test report.
Optionally, described that the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes:
According to the mapping relations between preset automatic test script and standard interface figure, searches and used with test process The corresponding standard interface figure of automatic test script;
The test interface figure of storage and the standard interface figure are compared, with obtain the test interface figure with it is described Diversity factor between standard interface figure;
If the diversity factor between the test interface figure and the standard interface figure is greater than preset threshold, by corresponding survey Surface chart is tried as abnormal surface chart;
The abnormal interface of the target software is determined according to the abnormal surface chart, and according to from whole test interface figures The abnormal interface identified generates test report.
Optionally, the test interface figure by storage is compared with the standard interface figure, to obtain the test The step of diversity factor between surface chart and the standard interface figure includes:
The first color value of predetermined position is extracted from test interface figure;
It determines standard interface figure corresponding with the test interface figure, and extracts from the standard interface figure and preset with described The second color value at the identical position in position;
First color value and second color value are compared, to determine the first color value and the second color value Between diversity factor, using the diversity factor between first color value and second color value as the test interface figure with Diversity factor between the standard interface figure.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Interface detection program is stored on storage medium, the interface detection program can be executed by one or more processor, with reality Now the step of interface detection method as described above.
Interface detection method, apparatus proposed by the present invention and computer readable storage medium, determine pending interface detection Target software, and obtain corresponding with target software automatic test script, execution automatic test script is to target software Carry out interface detection;During executing automatic test script, the interface of target software is recorded, and according to default Time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained;According to preset Anomalous identification rule analyzes test interface figure, to determine abnormal interface, and identifies according to from whole test interface figures Abnormal interface out generates test report.The program by the runnable interface to tested software by being regarded during the test Frequency is recorded, and according to preset anomalous identification rule, is analyzed test interface figure, to determine abnormal interface and generate survey Examination report carries out positioning problems without tester manually, improves testing efficiency.
Detailed description of the invention
Fig. 1 is the flow diagram for the interface detection method that one embodiment of the invention provides;
Fig. 2 is the schematic diagram of internal structure for the interface detection device that one embodiment of the invention provides;
Fig. 3 is the module diagram for the interface detection device median surface test program that one embodiment of the invention provides.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of interface detection method.It is the interface detection that one embodiment of the invention provides shown in referring to Fig.1 The flow diagram of method.This method can be executed by a device, which can be by software and or hardware realization.
In the present embodiment, interface detection method includes:
Step S10 determines the target software of pending interface detection, and obtains automation corresponding with the target software Test script executes the automatic test script and carries out interface detection to the target software.
Step S20 records the interface of the target software during executing the automatic test script System, and according to preset time point or mark point, it is deposited after recording multiple continuous test interface figures of interception in the video obtained Storage.
Step S30 analyzes the test interface figure according to preset anomalous identification rule, to determine abnormal boundary Face, and test report is generated according to the abnormal interface identified from whole test interface figures.
Scheme in the present embodiment can be applied to the interface detection in software test, and realize in interface detection, The intelligent positioning at the abnormal interface of software, without artificially being monitored to test process, during the test or after the completion of test Abnormal interface in identification software test and test report can be generated based on abnormal interface.Specifically, according to software test need It wants, writes the automatic test script for test in advance.After startup interface test, loads and run the automation and survey Training sheet, and video record is carried out to the interface of tested software during executing automatic test script.According to default Time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained.It is tested in storage When surface chart, the filename of test interface figure is ordered by sequence of the elder generation after using number according to the time in video Name, and store to predeterminable area.
Further, there can be the following two kinds implementation about preset anomalous identification rule:
Mode one, it is described the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes following refinement step:
The interface element for extracting predetermined position on test interface figure, obtains the attribute value of the interface element;Determine institute The standard attribute value for stating interface element judges whether the symbolic animal of the birth year value obtained and the standard attribute value are consistent;If inconsistent, sentence Determining the corresponding interface of the test interface figure is abnormal interface, and according to the abnormal interface identified from whole test interface figures Generate test report.
Mode two, it is described the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes following refinement step:
According to the mapping relations between preset automatic test script and standard interface figure, searches and used with test process The corresponding standard interface figure of automatic test script;
The test interface figure of storage and the standard interface figure are compared, with obtain the test interface figure with it is described Diversity factor between standard interface figure;
If the diversity factor between the test interface figure and the standard interface figure is greater than preset threshold, by corresponding survey Surface chart is tried as abnormal surface chart;
The abnormal interface of the target software is determined according to the abnormal surface chart, and according to from whole test interface figures The abnormal interface identified generates test report.
In the embodiment, standard interface figure is pre-set, wherein standard interface figure are as follows: software normal operation Under surface chart.One automatic test script corresponds to multiple continuous standard interface figures.
Further, as an implementation, the automatic test script includes that multiple groups need sequentially in time The operating procedure of execution;Interface progress during executing the automatic test script, to the target software It records, and according to preset time point or mark point, after recording multiple continuous test interface figures of interception in the video obtained The step of storage, specifically includes:
During executing the automatic test script, executed in the automatic test script according to preset order The multiple groups operating procedure for including;
During the test, the interface of the target software is recorded, and after the completion of one group of operating procedure executes, According to preset time point or mark point, multiple continuous test interface figures are intercepted in the video obtained from recording;
It will be stored after the test interface figure of interception and the association of corresponding operating procedure.
It, can be when executing automatic test script, by automatic test in order to improve test speed in the embodiment Script is divided into the continuous operating procedure of multiple groups, can be from the execution operating procedure after the completion of one group of operating procedure executes Interception test interface figure in the video of acquisition is recorded in the process.And after interception obtains test interface figure, corresponding mark is obtained Quasi- surface chart compares operation.
For a target software, there may be multiple interface detection processes, an interface detection process corresponds to one A automatic test script, an automatic test script correspond to one group of standard interface figure.Therefore, it can pre-establish automatic Change the mapping relations between test script and standard interface figure and storage, when the test interface figure that needs obtain test compares Clock synchronization directly corresponds to the associated standard interface figure of automatic test script according to above-mentioned mapping relationship searching and is compared.Alternatively, In other embodiments, standard interface figure corresponding with automatic test script is stored into pre-set path, and will The path information storage is needing to carry out the test interface figure that test obtains into the configuration file of the automatic test script When comparison, it is compared according to the corresponding standard interface figure of path searching in the configuration file of script.
Further, the test interface figure by storage is compared with the standard interface figure, to obtain the survey The step of trying the diversity factor between surface chart and the standard interface figure may include following refinement step:
The first color value of predetermined position is extracted from test interface figure;
It determines standard interface figure corresponding with the test interface figure, and extracts from the standard interface figure and preset with described The second color value at the identical position in position;
First color value and second color value are compared, to determine the first color value and the second color value Between diversity factor, using the diversity factor between first color value and second color value as the test interface figure with Diversity factor between the standard interface figure.
The program in such a way that color value compares come to diversity factor between test interface figure and standard interface figure, wherein face Color value be include the numerical value being made of tri- color value of RGB of image.It can also on this basis further comprise the transparent of image Spend the numerical value constituted.Wherein, color value includes that the hexadecimal numbers of six digits can be used to indicate, every double figures can be distinguished It is expressed as one of tri- color value of RGB attribute.
Further, the step of first color value that predetermined position is extracted from test interface figure includes: by institute State the figure block that test interface figure is divided into the first preset quantity;According to preset sample rate, from first preset quantity Select the figure block of the second preset quantity;From the figure block for extracting selection in the image block of second preset quantity First color value of predetermined position.
Further, before the step of described from the color value for extracting predetermined position in the test interface figure, institute The method of stating, which further comprises the steps of:, adjusts the image resolution ratio of the test interface figure and the image resolution ratio of the standard interface figure For identical image resolution ratio;It is described from the test interface figure extract predetermined position color value the step of include: from Adjusted the color value that predetermined position is extracted in the test interface figure of image resolution ratio.
Further, as an implementation, during executing the automatic test script, when detecting When stating the flag node in test script, the corresponding prompt information of the flag node is obtained, the prompt information is added to In the present frame picture of the video of recording, the prompt information includes current operating procedure information.In this way, When tester is when playing back video, the implementation progress that the prompt information shown in video determines test can be passed through.
The interface detection method that the present embodiment proposes determines the target software of pending interface detection, and acquisition and target The corresponding automatic test script of software executes automatic test script and carries out interface detection to target software;It is automatic executing During changing test script, the interface of target software is recorded, and according to preset time point or mark point, from recording It is stored after intercepting multiple continuous test interface figures in the video of acquisition;According to preset anomalous identification rule to test interface figure It is analyzed, to determine abnormal interface, and test report is generated according to the abnormal interface identified from whole test interface figures. The program, which passes through, carries out video record by the runnable interface to tested software during the test, and according to preset exception Recognition rule analyzes test interface figure, to determine abnormal interface and generate test report, without tester manually into Row positioning problems improve testing efficiency.
The present invention also provides a kind of interface detection devices.Referring to shown in Fig. 2, surveyed for the interface that one embodiment of the invention provides The schematic diagram of internal structure that trial assembly is set.
In the present embodiment, interface detection device 1 can be PC (Personal Computer, PC), can also be with It is the terminal devices such as smart phone, tablet computer, portable computer.The interface detection device 1 includes at least memory 11, processing Device 12, network interface 13 and communication bus.
Wherein, memory 11 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory, Hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetic storage, disk, CD etc..Memory 11 It can be the internal storage unit of interface detection device 1, such as the hard disk of the interface detection device 1 in some embodiments.It deposits Reservoir 11 is also possible in further embodiments on the External memory equipment of interface detection device 1, such as interface detection device 1 The plug-in type hard disk of outfit, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) Card, flash card (Flash Card) etc..Further, memory 11 can also both include the storage inside of interface detection device 1 Unit also includes External memory equipment.Memory 11 can be not only used for the application software that storage is installed on interface detection device 1 And Various types of data, such as the code of interface detection program 01 etc., it can be also used for temporarily storing and exported or will be defeated Data out.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips, the program for being stored in run memory 11 Code or processing data, such as execute interface detection program 01 etc..
Network interface 13 optionally may include standard wireline interface and wireless interface (such as WI-FI interface), be commonly used in Communication connection is established between the device 1 and other electronic equipments.
Communication bus is for realizing the connection communication between these components.
Optionally, which can also include user interface, and user interface may include display (Display), input Unit such as keyboard (Keyboard), optional user interface can also include standard wireline interface and wireless interface.It is optional Ground, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch-control liquid crystal display and OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touches device etc..Wherein, display can also be appropriate Referred to as display screen or display unit, for being shown in the information handled in interface detection device 1 and for showing visually User interface.
Fig. 2 illustrates only the interface detection device 1 with component 11-13 and interface detection program 01, art technology Personnel may include than illustrating more it is understood that structure shown in fig. 1 does not constitute the restriction to interface detection device 1 Perhaps more component perhaps combines certain components or different component layouts less.
In 1 embodiment of device shown in Fig. 2, interface detection program 01 is stored in memory 11;Processor 12 executes Following steps are realized when the interface detection program 01 stored in memory 11:
It determines the target software of pending interface detection, and obtains automatic test foot corresponding with the target software This, executes the automatic test script and carries out interface detection to the target software.
During executing the automatic test script, the interface of the target software is recorded, and according to Preset time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained.
The test interface figure is analyzed according to preset anomalous identification rule, with determining abnormal interface, and according to The abnormal interface identified from whole test interface figures generates test report.
Scheme in the present embodiment can be applied to the interface detection in software test, and realize in interface detection, The intelligent positioning at the abnormal interface of software, without artificially being monitored to test process, during the test or after the completion of test Abnormal interface in identification software test and test report can be generated based on abnormal interface.Specifically, according to software test need It wants, writes the automatic test script for test in advance.After startup interface test, loads and run the automation and survey Training sheet, and video record is carried out to the interface of tested software during executing automatic test script.According to default Time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained.It is tested in storage When surface chart, the filename of test interface figure is ordered by sequence of the elder generation after using number according to the time in video Name, and store to predeterminable area.
Further, there can be the following two kinds implementation about preset anomalous identification rule:
Mode one, it is described the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes following refinement step:
The interface element for extracting predetermined position on test interface figure, obtains the attribute value of the interface element;
The standard attribute value for determining the interface element, judge obtain symbolic animal of the birth year value and the standard attribute value whether one It causes;
If inconsistent, determine that the corresponding interface of the test interface figure is abnormal interface, and tests boundary according to from whole The abnormal interface identified in the figure of face generates test report.
Mode two, it is described the test interface figure is analyzed according to preset anomalous identification rule, it is abnormal to determine Interface, and the step of generating test report according to the abnormal interface includes following refinement step:
According to the mapping relations between preset automatic test script and standard interface figure, searches and used with test process The corresponding standard interface figure of automatic test script;
The test interface figure of storage and the standard interface figure are compared, with obtain the test interface figure with it is described Diversity factor between standard interface figure;
If the diversity factor between the test interface figure and the standard interface figure is greater than preset threshold, by corresponding survey Surface chart is tried as abnormal surface chart;
The abnormal interface of the target software is determined according to the abnormal surface chart, and according to from whole test interface figures The abnormal interface identified generates test report.
In the embodiment, standard interface figure is pre-set, wherein standard interface figure are as follows: software normal operation Under surface chart.One automatic test script corresponds to multiple continuous standard interface figures.
Further, as an implementation, the automatic test script includes that multiple groups need sequentially in time The operating procedure of execution;Interface progress during executing the automatic test script, to the target software It records, and according to preset time point or mark point, after recording multiple continuous test interface figures of interception in the video obtained The step of storage, specifically includes:
During executing the automatic test script, executed in the automatic test script according to preset order The multiple groups operating procedure for including;
During the test, the interface of the target software is recorded, and after the completion of one group of operating procedure executes, According to preset time point or mark point, multiple continuous test interface figures are intercepted in the video obtained from recording;
It will be stored after the test interface figure of interception and the association of corresponding operating procedure.
It, can be when executing automatic test script, by automatic test in order to improve test speed in the embodiment Script is divided into the continuous operating procedure of multiple groups, can be from the execution operating procedure after the completion of one group of operating procedure executes Interception test interface figure in the video of acquisition is recorded in the process.And after interception obtains test interface figure, corresponding mark is obtained Quasi- surface chart compares operation.
For a target software, there may be multiple interface detection processes, an interface detection process corresponds to one A automatic test script, an automatic test script correspond to one group of standard interface figure.Therefore, it can pre-establish automatic Change the mapping relations between test script and standard interface figure and storage, when the test interface figure that needs obtain test compares Clock synchronization directly corresponds to the associated standard interface figure of automatic test script according to above-mentioned mapping relationship searching and is compared.Alternatively, In other embodiments, standard interface figure corresponding with automatic test script is stored into pre-set path, and will The path information storage is needing to carry out the test interface figure that test obtains into the configuration file of the automatic test script When comparison, it is compared according to the corresponding standard interface figure of path searching in the configuration file of script.
Further, the test interface figure by storage is compared with the standard interface figure, to obtain the survey The step of trying the diversity factor between surface chart and the standard interface figure may include following refinement step:
The first color value of predetermined position is extracted from test interface figure;
It determines standard interface figure corresponding with the test interface figure, and extracts from the standard interface figure and preset with described The second color value at the identical position in position;
First color value and second color value are compared, to determine the first color value and the second color value Between diversity factor, using the diversity factor between first color value and second color value as the test interface figure with Diversity factor between the standard interface figure.
The program in such a way that color value compares come to diversity factor between test interface figure and standard interface figure, wherein face Color value be include the numerical value being made of tri- color value of RGB of image.It can also on this basis further comprise the transparent of image Spend the numerical value constituted.Wherein, color value includes that the hexadecimal numbers of six digits can be used to indicate, every double figures can be distinguished It is expressed as one of tri- color value of RGB attribute.
Further, the step of first color value that predetermined position is extracted from test interface figure includes: by institute State the figure block that test interface figure is divided into the first preset quantity;According to preset sample rate, from first preset quantity Select the figure block of the second preset quantity;From the figure block for extracting selection in the image block of second preset quantity First color value of predetermined position.
Further, before the step of described from the color value for extracting predetermined position in the test interface figure, institute The method of stating, which further comprises the steps of:, adjusts the image resolution ratio of the test interface figure and the image resolution ratio of the standard interface figure For identical image resolution ratio;It is described from the test interface figure extract predetermined position color value the step of include: from Adjusted the color value that predetermined position is extracted in the test interface figure of image resolution ratio.
Further, as an implementation, during executing the automatic test script, when detecting When stating the flag node in test script, the corresponding prompt information of the flag node is obtained, the prompt information is added to In the present frame picture of the video of recording, the prompt information includes current operating procedure information.In this way, When tester is when playing back video, the implementation progress that the prompt information shown in video determines test can be passed through.
The interface detection device that the present embodiment proposes determines the target software of pending interface detection, and acquisition and target The corresponding automatic test script of software executes automatic test script and carries out interface detection to target software;It is automatic executing During changing test script, the interface of target software is recorded, and according to preset time point or mark point, from recording It is stored after intercepting multiple continuous test interface figures in the video of acquisition;According to preset anomalous identification rule to test interface figure It is analyzed, to determine abnormal interface, and test report is generated according to the abnormal interface identified from whole test interface figures. The program, which passes through, carries out video record by the runnable interface to tested software during the test, and according to preset exception Recognition rule analyzes test interface figure, to determine abnormal interface and generate test report, without tester manually into Row positioning problems improve testing efficiency.
Optionally, in other examples, interface detection program can also be divided into one or more module, and one A or multiple modules are stored in memory 11, and are held by one or more processors (the present embodiment is by processor 12) For row to complete the present invention, the so-called module of the present invention is the series of computation machine program instruction section for referring to complete specific function, For describing implementation procedure of the interface detection program in interface detection device.
It is the program mould of the interface detection program in one embodiment of interface detection device of the present invention for example, referring to shown in Fig. 3 Block schematic diagram, in the embodiment, interface detection program can be divided into interface detection module 10, video record module 20 and different Normal identification module 30, illustratively:
Interface detection module 10 is used for: being determined the target software of pending interface detection, and is obtained and the target software Corresponding automatic test script executes the automatic test script and carries out interface detection to the target software;
Video record module 20 is used for: during executing the automatic test script, to the target software Interface is recorded, and according to preset time point or mark point, multiple continuous tests are intercepted in the video obtained from recording It is stored after surface chart;
Anomalous identification module 30 is used for: the test interface figure analyzed according to preset anomalous identification rule, with It determines exception interface, and test report is generated according to the abnormal interface identified from whole test interface figures.
The program modules such as above-mentioned interface detection module 10, video record module 20 and anomalous identification module 30 are performed institute Functions or operations step and above-described embodiment of realization are substantially the same, and details are not described herein.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium On be stored with interface detection program, the interface detection program can be executed by one or more processors, to realize following operation:
It determines the target software of pending interface detection, and obtains automatic test foot corresponding with the target software This, executes the automatic test script and carries out interface detection to the target software;
During executing the automatic test script, the interface of the target software is recorded, and according to Preset time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained;
The test interface figure is analyzed according to preset anomalous identification rule, with determining abnormal interface, and according to The abnormal interface identified from whole test interface figures generates test report.
Computer readable storage medium specific embodiment of the present invention and above-mentioned each embodiment of interface detection device and method It is essentially identical, do not make tired state herein.
It should be noted that the serial number of the above embodiments of the invention is only for description, do not represent the advantages or disadvantages of the embodiments.And The terms "include", "comprise" herein or any other variant thereof is intended to cover non-exclusive inclusion, so that packet Process, device, article or the method for including a series of elements not only include those elements, but also including being not explicitly listed Other element, or further include for this process, device, article or the intrinsic element of method.Do not limiting more In the case where, the element that is limited by sentence "including a ...", it is not excluded that including process, device, the article of the element Or there is also other identical elements in method.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of interface detection method, which is characterized in that the described method includes:
It determines the target software of pending interface detection, and obtains automatic test script corresponding with the target software, hold The row automatic test script carries out interface detection to the target software;
During executing the automatic test script, the interface of the target software is recorded, and according to default Time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained;
The test interface figure is analyzed according to preset anomalous identification rule, to determine abnormal interface, and according to from complete The abnormal interface identified in portion's test interface figure generates test report.
2. interface detection method as described in claim 1, which is characterized in that it is described according to preset anomalous identification rule to institute It states test interface figure to be analyzed, to determine abnormal interface, and the step of generating test report according to the abnormal interface includes:
The interface element for extracting predetermined position on test interface figure, obtains the attribute value of the interface element;
The standard attribute value for determining the interface element judges whether the symbolic animal of the birth year value obtained and the standard attribute value are consistent;
If inconsistent, determine that the corresponding interface of the test interface figure is abnormal interface, and according to from whole test interface figures In the abnormal interface identified generate test report.
3. interface detection method as described in claim 1, which is characterized in that it is described according to preset anomalous identification rule to institute It states test interface figure to be analyzed, to determine abnormal interface, and the step of generating test report according to the abnormal interface includes:
According to the mapping relations between preset automatic test script and standard interface figure, search with test process use from The corresponding standard interface figure of dynamicization test script;
The test interface figure of storage and the standard interface figure are compared, to obtain the test interface figure and the standard Diversity factor between surface chart;
If the diversity factor between the test interface figure and the standard interface figure is greater than preset threshold, by corresponding test circle Face figure is as abnormal surface chart;
The abnormal interface of the target software is determined according to the abnormal surface chart, and is identified according to from whole test interface figures Abnormal interface out generates test report.
4. interface detection method as claimed in claim 3, which is characterized in that the test interface figure by storage and the mark Quasi- surface chart compares, and includes: the step of the diversity factor between the test interface figure and the standard interface figure to obtain
The first color value of predetermined position is extracted from test interface figure;
It determines standard interface figure corresponding with the test interface figure, and is extracted and the predeterminated position from the standard interface figure The second color value at identical position;
First color value and second color value are compared, to determine between the first color value and the second color value Diversity factor, using the diversity factor between first color value and second color value as the test interface figure with it is described Diversity factor between standard interface figure.
5. interface detection method as claimed in claim 4, which is characterized in that described to extract predeterminated position from test interface figure Place the first color value the step of include:
The test interface figure is divided into the figure block of the first preset quantity;
According to preset sample rate, the figure block of the second preset quantity is selected from first preset quantity;
The first color value of predetermined position from the figure block for extracting selection in the image block of second preset quantity.
6. a kind of interface detection device, which is characterized in that described device includes memory and processor, is stored on the memory There is the interface detection program that can be run on the processor, is realized such as when the interface detection program is executed by the processor Lower step:
It determines the target software of pending interface detection, and obtains automatic test script corresponding with the target software, hold The row automatic test script carries out interface detection to the target software;
During executing the automatic test script, the interface of the target software is recorded, and according to default Time point or mark point store after recording multiple continuous test interface figures of interception in the video obtained;
The test interface figure is analyzed according to preset anomalous identification rule, to determine abnormal interface, and according to from complete The abnormal interface identified in portion's test interface figure generates test report.
7. interface detection device as claimed in claim 6, which is characterized in that it is described according to preset anomalous identification rule to institute It states test interface figure to be analyzed, to determine abnormal interface, and the step of generating test report according to the abnormal interface includes:
The interface element for extracting predetermined position on test interface figure, obtains the attribute value of the interface element;
The standard attribute value for determining the interface element judges whether the symbolic animal of the birth year value obtained and the standard attribute value are consistent;
If inconsistent, determine that the corresponding interface of the test interface figure is abnormal interface, and according to from whole test interface figures In the abnormal interface identified generate test report.
8. interface detection device as claimed in claim 6, which is characterized in that it is described according to preset anomalous identification rule to institute It states test interface figure to be analyzed, to determine abnormal interface, and the step of generating test report according to the abnormal interface includes:
According to the mapping relations between preset automatic test script and standard interface figure, search with test process use from The corresponding standard interface figure of dynamicization test script;
The test interface figure of storage and the standard interface figure are compared, to obtain the test interface figure and the standard Diversity factor between surface chart;
If the diversity factor between the test interface figure and the standard interface figure is greater than preset threshold, by corresponding test circle Face figure is as abnormal surface chart;
The abnormal interface of the target software is determined according to the abnormal surface chart, and is identified according to from whole test interface figures Abnormal interface out generates test report.
9. interface detection device as claimed in claim 8, which is characterized in that the test interface figure by storage and the mark Quasi- surface chart compares, and includes: the step of the diversity factor between the test interface figure and the standard interface figure to obtain
The first color value of predetermined position is extracted from test interface figure;
It determines standard interface figure corresponding with the test interface figure, and is extracted and the predeterminated position from the standard interface figure The second color value at identical position;
First color value and second color value are compared, to determine between the first color value and the second color value Diversity factor, using the diversity factor between first color value and second color value as the test interface figure with it is described Diversity factor between standard interface figure.
10. a kind of computer readable storage medium, which is characterized in that be stored with interface survey on the computer readable storage medium Program is tried, the interface detection program can be executed by one or more processor, to realize as any in claim 1 to 5 The step of interface detection method described in item.
CN201811526437.3A 2018-12-13 2018-12-13 Interface detection method, apparatus and computer readable storage medium Pending CN109783351A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811526437.3A CN109783351A (en) 2018-12-13 2018-12-13 Interface detection method, apparatus and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811526437.3A CN109783351A (en) 2018-12-13 2018-12-13 Interface detection method, apparatus and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109783351A true CN109783351A (en) 2019-05-21

Family

ID=66496869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811526437.3A Pending CN109783351A (en) 2018-12-13 2018-12-13 Interface detection method, apparatus and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109783351A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750451A (en) * 2019-09-23 2020-02-04 惠州市德赛西威汽车电子股份有限公司 Vehicle-mounted multimedia UI (user interface) material automatic identification and detection system and method
CN111240984A (en) * 2020-01-15 2020-06-05 中国平安财产保险股份有限公司 Abnormal page identification method and device, computer equipment and storage medium
CN112559340A (en) * 2020-12-09 2021-03-26 上海米哈游天命科技有限公司 Picture testing method, device, equipment and storage medium
CN112612690A (en) * 2020-11-30 2021-04-06 北京达佳互联信息技术有限公司 User interface information processing method and device, electronic equipment and storage medium
CN112711536A (en) * 2020-12-30 2021-04-27 广东粤云工业互联网创新科技有限公司 Automatic dial testing method and system, and computer readable storage medium
CN112860537A (en) * 2019-11-27 2021-05-28 阿里巴巴集团控股有限公司 Program testing method, device, equipment and storage medium
CN113934353A (en) * 2021-09-30 2022-01-14 北京五八信息技术有限公司 Information processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657274A (en) * 2015-03-06 2015-05-27 中国银行股份有限公司 Method and device for testing software interface
CN104978270A (en) * 2015-07-03 2015-10-14 上海触乐信息科技有限公司 Automatic software testing method and apparatus
CN106168922A (en) * 2016-06-30 2016-11-30 百度在线网络技术(北京)有限公司 Method of testing that a kind of terminal interface shows and device
CN106502891A (en) * 2016-10-19 2017-03-15 广州视源电子科技股份有限公司 The automatic testing method and device of user interface
CN106569945A (en) * 2016-10-19 2017-04-19 上海斐讯数据通信技术有限公司 Automatic color discrimination system and automatic color discrimination method for user interface testing
CN106598846A (en) * 2016-11-29 2017-04-26 上海亿账通互联网科技有限公司 Application interface test method and apparatus
US9898444B1 (en) * 2016-03-18 2018-02-20 Amazon Technologies, Inc. Image comparison for user interface testing

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657274A (en) * 2015-03-06 2015-05-27 中国银行股份有限公司 Method and device for testing software interface
CN104978270A (en) * 2015-07-03 2015-10-14 上海触乐信息科技有限公司 Automatic software testing method and apparatus
US9898444B1 (en) * 2016-03-18 2018-02-20 Amazon Technologies, Inc. Image comparison for user interface testing
CN106168922A (en) * 2016-06-30 2016-11-30 百度在线网络技术(北京)有限公司 Method of testing that a kind of terminal interface shows and device
CN106502891A (en) * 2016-10-19 2017-03-15 广州视源电子科技股份有限公司 The automatic testing method and device of user interface
CN106569945A (en) * 2016-10-19 2017-04-19 上海斐讯数据通信技术有限公司 Automatic color discrimination system and automatic color discrimination method for user interface testing
CN106598846A (en) * 2016-11-29 2017-04-26 上海亿账通互联网科技有限公司 Application interface test method and apparatus

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750451A (en) * 2019-09-23 2020-02-04 惠州市德赛西威汽车电子股份有限公司 Vehicle-mounted multimedia UI (user interface) material automatic identification and detection system and method
CN112860537A (en) * 2019-11-27 2021-05-28 阿里巴巴集团控股有限公司 Program testing method, device, equipment and storage medium
CN111240984A (en) * 2020-01-15 2020-06-05 中国平安财产保险股份有限公司 Abnormal page identification method and device, computer equipment and storage medium
CN112612690A (en) * 2020-11-30 2021-04-06 北京达佳互联信息技术有限公司 User interface information processing method and device, electronic equipment and storage medium
CN112559340A (en) * 2020-12-09 2021-03-26 上海米哈游天命科技有限公司 Picture testing method, device, equipment and storage medium
CN112711536A (en) * 2020-12-30 2021-04-27 广东粤云工业互联网创新科技有限公司 Automatic dial testing method and system, and computer readable storage medium
CN113934353A (en) * 2021-09-30 2022-01-14 北京五八信息技术有限公司 Information processing method and device

Similar Documents

Publication Publication Date Title
CN109783351A (en) Interface detection method, apparatus and computer readable storage medium
CN106844217B (en) Method and device for embedding point of applied control and readable storage medium
US11010227B2 (en) Exception stack information acquisition method and device and computer-readable storage medium
CN108959067A (en) Test method, device and the computer readable storage medium of search engine
CN109446218A (en) SQL statement generation method, device and computer readable storage medium
CN109783350A (en) Interface test method, device and computer readable storage medium
CN109117358A (en) test method and test device for electronic equipment
CN103518393A (en) Systems and methods for testing content of mobile communication devices
CN105868096B (en) For showing the method, device and equipment of web page test result in a browser
CN106326120B (en) Regression testing method and device for application software and electronic equipment
CN108491322A (en) Automated testing method, device and storage medium
CN111179268B (en) Abnormality detection method and device for vehicle-mounted terminal and vehicle-mounted terminal
CN108717391A (en) Monitoring device, method and the computer readable storage medium of test process
CN110162599A (en) Personnel recruitment and interview method, apparatus and computer readable storage medium
CN107133165B (en) Browser compatibility detection method and device
CN106294161A (en) The interface function method of testing of a kind of application and device
CN106597261A (en) Wafer test system
CN110287094A (en) UI automated testing method, device and computer readable storage medium
CN108845924B (en) Control response area display control method, electronic device, and storage medium
CN109871205A (en) GUI code method of adjustment, device, computer installation and storage medium
CN109446077A (en) A kind of data library test method and device
US20170277710A1 (en) Data comparison
CN109086828A (en) Method and apparatus for detecting battery pole piece
CN106528412B (en) A kind of related gesture dispensing test frame of Android application
CN105391602B (en) A kind of data acquisition test method and apparatus

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