CN111143188A - Method and equipment for automatically testing application - Google Patents

Method and equipment for automatically testing application Download PDF

Info

Publication number
CN111143188A
CN111143188A CN201811300393.2A CN201811300393A CN111143188A CN 111143188 A CN111143188 A CN 111143188A CN 201811300393 A CN201811300393 A CN 201811300393A CN 111143188 A CN111143188 A CN 111143188A
Authority
CN
China
Prior art keywords
screenshot
test
interface
application
abnormal
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
CN201811300393.2A
Other languages
Chinese (zh)
Other versions
CN111143188B (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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201811300393.2A priority Critical patent/CN111143188B/en
Publication of CN111143188A publication Critical patent/CN111143188A/en
Application granted granted Critical
Publication of CN111143188B publication Critical patent/CN111143188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and equipment for automatically testing an application, which are used for determining whether a test abnormal interface exists by using a screenshot in a test process, and positioning the test abnormal interface by using an image technology so as to facilitate a tester to eliminate an abnormal condition. The method comprises the following steps: acquiring an application test task, and automatically testing the application in the application test task by using an automatic test framework; respectively performing at least one screenshot on an application test interface obtained for multiple times in the process of automatically testing the application; and identifying at least one screenshot by using an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface or not according to an identification result.

Description

Method and equipment for automatically testing application
Technical Field
The invention relates to the field of automatic testing, in particular to a method and equipment for automatically testing an application.
Background
The existing automatic testing technology for terminal application is mainly based on an automatic testing framework such as UiAutomator, Apium and the like, the application is automatically tested through a testing script, and then logs and results in the testing process are output; one is to display the screenshot of the test result report, and the tester needs to manually analyze and judge the test result. The above scheme has the following disadvantages in the actual test process:
because the automatic test frames run independently, when a certain automatic test frame is used alone for testing, part of application controls or components cannot be identified by the test frame or action instructions are sent, and the test requirements of the application cannot be completely met;
verification of a test result is taken as an important part in an automatic test, taking a compatibility test as an example, a tester needs to analyze and judge the last thousand test screenshots generated after the automatic test task is completed one by one, so that the efficiency is low, and the consumption of human resources is high.
Disclosure of Invention
The invention provides a method and equipment for automatically testing an application, which are used for determining whether a test abnormal interface exists by using a screenshot in a test process, and positioning the test abnormal interface by using an image technology so as to facilitate testers to eliminate abnormal conditions.
In a first aspect, the present invention provides a method for automated testing of an application, the method comprising:
acquiring an application test task, and automatically testing the application in the application test task by using an automatic test framework;
respectively performing at least one screenshot on an application test interface obtained for multiple times in the process of automatically testing the application;
and identifying at least one screenshot by using an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface or not according to an identification result.
In a second aspect, the present invention provides an apparatus for automated testing of an application, the apparatus comprising:
a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes the following steps:
acquiring an application test task, and automatically testing the application in the application test task by using an automatic test framework;
respectively performing at least one screenshot on an application test interface obtained for multiple times in the process of automatically testing the application;
and identifying at least one screenshot by using an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface or not according to an identification result.
In a third aspect, the present invention provides a computer storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring an application test task, and automatically testing the application in the application test task by using an automatic test framework;
respectively performing at least one screenshot on an application test interface obtained for multiple times in the process of automatically testing the application;
and identifying at least one screenshot by using an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface or not according to an identification result.
The method and the equipment for automatically testing the application have the following beneficial effects that:
on one hand, based on the fact that when a certain automatic testing frame is singly used for testing in the prior art, part of application controls or assemblies cannot be identified by the testing frame or action instructions are sent, the embodiment provided by the invention can automatically position the operable assemblies or controls of the tested application and trigger the control instructions through the image identification technology, so that the process of guiding the automatic testing is achieved, and the testing requirements of the application are met;
on the other hand, the invention provides a method for identifying and classifying common or special abnormal test results in the automatic test process, automatically outputting abnormal test pictures, improving the test efficiency and saving the consumption of human resources.
Drawings
FIG. 1 is a flow diagram of a method for automated testing of an application;
FIG. 2 is a diagram of the steps implemented in a method for automated testing of an application;
FIG. 3 is a diagram of a method and apparatus for automated testing of applications.
Detailed Description
The invention provides a method and equipment for automatically testing an application, which aims to solve the problem that an automatic testing framework cannot identify a tested application control or component due to the fact that the control exists in an application testing interface in the existing automatic testing, improve the efficiency of the automatic testing and minimize the demand on manpower resources.
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
The embodiment of the invention provides a method for automatically testing an application, which comprises the following steps of:
step 101, obtaining an application test task, and performing automated testing on an application in the application test task by using an automated test framework, wherein the automated test framework comprises a plurality of basic test modules, provides a plurality of test scripts, and performs interactive trigger testing on a control or a component in the application by executing the test scripts.
Specifically, the application test task includes a plurality of application APPs of the terminal, where each APP includes a plurality of controls or components; the automatic testing framework carries out automatic testing on the application APPs in the application testing task, the automatic testing framework is used for simulating clicking of a mouse and operation of a keyboard to carry out interaction triggering testing on components or controls in each application APP, and whether each APP has a problem or not is determined according to a testing result.
And 102, respectively carrying out at least one screenshot on the application test interface obtained for multiple times in the process of automatically testing the application.
Specifically, in the process of utilizing an automatic test framework to simulate clicking of a mouse and interactive triggering test of the APP through operation of a keyboard, in a complete test process, each time of interactive test completion corresponds to one application test interface, in the whole test process, a plurality of application test interfaces can be continuously output, new application test interfaces can be correspondingly output as long as a new interactive triggering test is involved, different application test interface screenshot intervals can be set according to different test requirements.
In this embodiment, at least one of the screenshots of the application test interface is captured in two screenshot modes, namely: capturing a screenshot of an application test interface when determining that interactive triggering with a control or a component in an application fails in a test process; the second method comprises the following steps: performing screenshot when determining to obtain a new test application interface; the automatic test process can include two screenshot modes of the first mode and the second mode, and can also only independently perform one of the first mode and the second mode.
And 103, identifying at least one screenshot by using an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface according to an identification result.
In implementation, the screenshot is identified by using an image identification technology, so that the content of the screenshot can be obtained, and after the content of the screenshot is obtained, whether the application test interface is an abnormal test interface can be judged according to a set mechanism.
Specifically, in the automatic test process, a tester can set rules for performing screenshot according to experience, can perform application test interface screenshot according to pertinence of links with problems frequently occurring in the test, can also perform universal screenshot according to a certain frequency, can also perform screenshot when a new application test interface is obtained every time, and can set specific screenshot rules according to needs without specific limitations.
On the basis of setting rules of how to capture the image, rules for judging the test abnormal interface can be set according to the characteristics of the image capture, for example, the rules can be matched with the image capture of the normal application test interface according to the corresponding image capture time during image capture, if the matching is correct, the application test interface is normal, and if the matching is not correct, the application test interface is abnormal. And matching with a preset abnormal test picture, wherein if the abnormal test picture is matched with the preset abnormal test picture, the abnormal application test interface is indicated, and otherwise, the normal application test interface is indicated. The specific matching rule can be flexibly set according to the condition of the screenshot, and is not specifically limited herein.
By applying the automatic testing method provided by the embodiment of the invention, when the automatic testing is carried out, the image recognition technology is utilized to capture the application testing interface, so that whether the testing is abnormal or not can be automatically recognized, on one hand, which link in the testing process is in problem can be automatically positioned, on the other hand, the workload of manual intervention judgment can be reduced, and the testing efficiency can be improved.
In implementation, the test application task comprises an application terminal APP and a reference diagram comprising a control or a component, wherein the application terminal APP and the test script comprise an executable control or a component, the executable control or the component in the test application is tested based on an automatic test framework, the application terminal APP provides the reference diagram comprising the control or the component to be matched with the application test interface, and whether the application test interface is an abnormal test interface is determined according to a matching result.
Two optional embodiments are given below in this embodiment, and the two optional embodiments may be implemented separately or in combination, for the rule setting when to perform screenshot and the determination mechanism how to determine the abnormal picture.
As an optional implementation manner, the application test interface screenshot is performed in the following manner:
in the process of automatically testing the application, when the interactive triggering test failure of the automatic test frame and a control or a component in the application is determined, screenshot is carried out on an application test interface obtained when the triggering test fails, and a triggering failure interface screenshot is obtained;
in the automatic testing process, when a testing script interacting with a certain control or component in the terminal APP is executed, a trigger instruction is firstly generated to simulate and click the control or component in the APP, interaction with the control or component in the application is triggered, if a response is obtained, the interaction is successful, and if the trigger instruction is generated to simulate and click the control or component in the APP, no response is generated. The failure reasons at this time are two, one is that a terminal APP has a problem, no control or component exists in the interactive interface, and the other is that the automatic test framework has a problem and cannot identify the control or component in the APP interface.
In this embodiment, in order to identify the reason of the trigger failure, when it is determined that the interactive trigger test between the automated test framework and the control or the component in the application fails, a screenshot is performed on the application test interface obtained when the trigger test fails, so as to obtain a trigger failure interface screenshot.
In this embodiment, based on the screenshot mechanism, whether the test application corresponding to the screenshot is an abnormal test interface is determined in the following manner:
and matching the triggering failure interface screenshot with a reference image comprising a control or a component by using an image recognition technology, wherein the reference image is provided for an automatic test framework in advance by a tested application terminal APP, and the matching success shows that the automatic test framework can recognize the control or the component in the APP interface, so that the situation that no control or component exists in the interactive interface of the terminal APP is judged.
Specifically, firstly, the failure interface screenshot is cut, then the failure interface screenshot is compared with the reference picture frame by frame, the similarity coefficient between the failure interface screenshot and the reference picture is calculated according to a template matching algorithm, and the triggering failure interface screenshot and the reference picture are successfully matched when the calculated similarity coefficient value is higher than a preset similarity coefficient threshold value is determined according to a preset similarity coefficient threshold value.
And when the triggering failure interface screenshot is determined to have no reference control or component according to the matching result, determining that the triggering failure interface screenshot is a test abnormal interface, and avoiding the generation of the triggering failure interface screenshot caused by the fact that an automatic test framework cannot identify the control or the component in the application test APP interface.
Further, in this embodiment, when it is determined that there is a reference control or component in the failed trigger interface screenshot according to the matching result, a control instruction corresponding to the reference control or component in the automated testing frame is triggered, and the automated testing process is continuously executed; when the automatic test framework cannot identify the reference control or the component, the automatic test cannot trigger the control and the component in the application test interface to execute a corresponding control instruction, and cannot complete a test task.
Therefore, the invention can position the control or the component in the triggering failure interface screenshot by utilizing the image recognition technology, trigger the control instruction corresponding to the reference control or the component and continue to complete the process of the automatic test, thereby avoiding the problem that the test task cannot be completed when the control or the component cannot be recognized by the automatic test framework in the process of the automatic test.
In the implementation:
and when the triggering failure interface screenshot has a reference control or component, identifying and positioning the control or component in the triggering failure interface screenshot by using an image identification technology, wherein the coordinate of the control or component in the triggering failure interface screenshot in the screenshot is positioned, and a test operation command is sent to the coordinate through an automatic frame so as to continuously execute a subsequent test task.
As a preferred embodiment, matching the failed trigger interface screenshot with a reference image including a control or a component by using an image recognition technology, and determining whether there is a reference control or component in the failed trigger interface screenshot according to a matching result, including:
calculating the similarity coefficient of the screenshot of the triggering failure interface and a reference image comprising a control or a component by utilizing a template matching algorithm;
and when the calculated similarity coefficient value is determined to be larger than a preset similarity coefficient threshold value, determining that the triggering failure interface screenshot is matched with the reference picture.
The specific contents of the template matching algorithm are as follows:
Figure BDA0001852221760000071
wherein the content of the first and second substances,
T′(x′,y′)=T(x′,y′)-1/(w·h)·∑x″,y″T(x″,y″)
I′(x+x′,y+y′)=I(x+x′,y+y′)-1/(w·h)·∑x″,y″I(x+x″,y+y″)
wherein the content of the first and second substances,
χ′=0...w-1,y′=0...h-1
Figure BDA0001852221760000072
in the above formula:
x and y are coordinates of the upper left corner in the screenshot picture of the failure interface, w is the width of the reference image comprising the control or the component, and h is the height of the reference image comprising the control or the component;
t (x, y) is a value obtained after each point (x, y) in the screenshot image area is compared by the screenshot image of the failure interface, and I (x, y) is a value obtained after each point (x, y) in the reference image area is compared by the reference image;
setting the original points of T (x, y) and I (x, y) to be in the upper left corner, and obtaining an R (x, y) for any coordinate point (x, y) according to a formula, wherein the R (x, y) represents a similarity coefficient value set of the matching of the failed interface screenshot and the reference image;
and calculating the similarity coefficient value set according to the formula, selecting a maximum similarity coefficient from the similarity coefficient value set, and determining that the failure interface screenshot is matched with the reference image when the maximum similarity coefficient is greater than the similarity coefficient threshold according to a preset similarity coefficient threshold.
As another optional implementation manner, the application test interface screenshot is performed in the following manner:
when a new application test interface is determined to be obtained, screenshot is carried out to obtain an application test interface screenshot;
in this embodiment, based on the screenshot mechanism, determining whether the test application corresponding to the screenshot is an abnormal test interface in the following manner includes:
the image recognition technology is used to capture a screenshot of the obtained application test interface, and the screenshot mode may refer to the mode described in the above first screenshot implementation mode, which is not described in detail here.
Respectively matching the recognition result of any application test interface screenshot with abnormal pictures in a preset abnormal picture database, wherein the abnormal picture database comprises abnormal pictures such as black screen pictures, white screen pictures, flower screen pictures and the like which often appear in the actual test process; and performing feature matching on the screenshot and each abnormal picture, and obtaining an application test interface screenshot as a test result when the matching is confirmed to be successful.
And when the recognition result of the screenshot of the application test interface is determined to be matched with any abnormal picture according to the matching result, determining that the screenshot of the application test interface is a test abnormal interface.
The method and the device can position the test abnormal interface by utilizing the image technology, are convenient for testers to eliminate abnormal conditions, avoid the condition that the testers need to analyze screenshots of the application test interface one by one in the automatic test process, improve the test efficiency, shorten the time for generating the test report and save the human resources.
As an optional implementation manner, the step of respectively matching the recognition result of any application test interface screenshot with the abnormal picture in the preset abnormal picture database includes:
calculating the similarity coefficient between the recognition result of any application test interface screenshot and an abnormal picture in a preset abnormal picture database by using an image matching algorithm;
determining that the recognition result of the screenshot of the application test interface is matched with any abnormal picture according to the matching result, wherein the steps comprise:
and when the similarity coefficient value obtained by calculation is larger than a preset similarity coefficient threshold value, determining that the recognition result of the screenshot of the application test interface is matched with the abnormal picture in a preset abnormal picture database.
And the image matching algorithm is based on the template matching algorithm, and is used for matching the abnormal pictures in the abnormal picture characteristic data set acquired in the automatic test process with the failure interface screenshot images in the actual test, and determining the similarity coefficient threshold value obtained by matching with the images according to at least one test result. For example, the abnormal picture feature data set includes a black screen, a white screen, and a flower screen, the failed interface screenshot and the black screen image in the abnormal picture feature data set are matched according to the image matching algorithm through the failed interface screenshot which often appears in an actual test, such as the black screen, the white screen, and the flower screen, a similarity coefficient set in which the failed interface screenshot and the black screen image are matched is obtained through ten thousand times of matching calculation, numerical values in the similarity coefficient set are screened, and the similarity coefficient threshold is determined according to the screened similarity coefficients.
As an optional implementation manner, the preset abnormal picture database includes:
one or more of a black screen picture, a white screen picture, a flower screen picture, a flash-back picture and a loading failure picture.
In an implementation, the test exception interface further includes:
determining all application test interfaces determined as test abnormal interfaces as a first type of test results;
determining other application test interfaces except the test exception interface as a second type of test result;
and generating a test report comprising the first type of test result and the second type of test result.
The first type of test result can be used for identifying the control or the component in the application test interface by utilizing an image identification technology to continue the automatic test when some control or component cannot be identified by the automatic test framework in the automatic test process; the second type of test results can be used for automatic testing to automatically obtain the test results, and whether the application test interface belongs to an abnormal application test interface is identified by using an image identification technology, so that the test efficiency is improved, and the time for generating the test report is shortened.
In the following, the above embodiment is described in detail, and a method for performing automated testing on an application is shown in fig. 2:
step 201: obtaining a test application APP;
step 202: executing an automatic test application, and simulating mouse clicking and keyboard operation by using an automatic test framework to carry out interactive trigger test on a control or a component in the test application APP;
specifically, clicking an executable control in the APP to test whether the control has a response.
Step 203: judging whether the interactive trigger of the control or the component in the application in the automatic test application process has no response, if not, screenshot the failed interface, and executing the step 204, otherwise, executing the step 203;
step 204: matching the failure interface screenshot with a reference image comprising a control or a component by using an image recognition technology;
step 205: judging whether the failure interface screenshot contains a reference control or component, if not, executing a step 206, otherwise, executing a step 207;
step 206: continuing to execute the automated testing application;
step 207: triggering a control instruction corresponding to the reference control or component in the automated testing frame, and executing step 206;
step 208: screenshot is carried out on the obtained new automatic application test interface;
step 209: identifying the screenshot of the application test interface by using an image identification technology, and matching an identification result with an abnormal picture in a preset abnormal picture database;
step 210: judging whether the recognition result of the screenshot of the application test interface is matched with any abnormal picture, if so, executing step 211, otherwise, executing step 210;
step 211: and outputting the screenshot of the application test interface matched with any abnormal picture as an automatic test report.
Example two
Based on the same inventive concept, the embodiment of the present invention provides a device for performing an automated test on an application, and specific implementation of the device may refer to the description of the method embodiment, and repeated details are not repeated.
As shown in fig. 3, the apparatus mainly includes: a processor 301 and a memory 302, wherein the memory 302 stores program codes, and when the program codes are executed by the processor 301, the processor 301 executes the steps of any one of the following embodiments.
The processor 301 is configured to:
acquiring an application test task, and automatically testing the application in the application test task by using an automatic test framework;
respectively performing at least one screenshot on an application test interface obtained for multiple times in the process of automatically testing the application;
and identifying at least one screenshot by using an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface or not according to an identification result.
As an optional implementation manner, the processor 301 is configured to perform screenshot on an application test interface obtained when a trigger test fails when determining that the trigger test fails in interaction with a control or a component in an application in an automated test application process, so as to obtain a trigger failure interface screenshot;
matching the triggering failure interface screenshot with a reference image comprising a control or a component by utilizing an image recognition technology;
and when the triggering failure interface screenshot is determined to have no reference control and component according to the matching result, determining the triggering failure interface screenshot as a test abnormal interface.
In implementation, the processor 301 is further configured to trigger a control instruction corresponding to the reference control or component in the automated testing frame when it is determined that the reference control or component exists in the failed trigger interface screenshot according to the matching result, and continue to execute the automated testing process.
As an optional implementation manner, the processor 301 matches the failed trigger interface screenshot with a reference image including a control or a component by using an image recognition technology, and determines whether there is a reference control or component in the failed trigger interface screenshot according to a matching result, so as to:
calculating a similarity coefficient between the screenshot of the triggering failure interface and a reference image comprising a control or a component by utilizing a template matching algorithm;
and when the calculated similarity coefficient value is determined to be larger than a preset similarity coefficient threshold value, determining that the triggering failure interface screenshot is matched with a reference picture.
In implementation, the processor 301 performs at least one screenshot on each application test interface obtained for multiple times, and is further configured to perform the screenshot to obtain an application test interface screenshot when determining to obtain a new application test interface;
identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is an abnormal test interface according to an identification result, wherein the application test interface is used for:
respectively identifying the obtained screenshots of the application test interface by using an image identification technology;
respectively matching the recognition result of any application test interface screenshot with an abnormal picture in a preset abnormal picture database;
and when the recognition result of the screenshot of the application test interface is determined to be matched with any abnormal picture according to the matching result, determining that the screenshot of the application test interface is a test abnormal interface.
As an optional implementation manner, the processor 301 matches the recognition result of any screenshot of the application test interface with an abnormal picture in a preset abnormal picture database, respectively, so as to:
calculating the similarity coefficient between the recognition result of any application test interface screenshot and an abnormal picture in a preset abnormal picture database by using an image matching algorithm;
and determining that the recognition result of the screenshot of the application test interface is matched with any abnormal picture according to the matching result, and using the matching result to:
and when the similarity coefficient value obtained by calculation is larger than a preset similarity coefficient threshold value, determining that the recognition result of the screenshot of the application test interface is matched with the abnormal picture in a preset abnormal picture database.
In an implementation, the preset abnormal picture database includes:
one or more of a black screen picture, a white screen picture, a flower screen picture, a flash-back picture and a loading failure picture.
The processor is further configured to:
determining all application test interfaces determined as test abnormal interfaces as a first type of test results;
determining other application test interfaces except the test exception interface as a second type of test result;
and generating a test report comprising the first type of test result and the second type of test result.
EXAMPLE III
The present invention also provides a computer storage medium, and the specific implementation of the computer storage medium can refer to the description of the method embodiment section, and repeated details are not repeated.
The computer storage medium has stored thereon a computer program that, when executed by a processor, performs the steps of:
acquiring an application test task, and automatically testing the application in the application test task by using an automatic test framework;
respectively performing at least one screenshot on an application test interface obtained for multiple times in the process of automatically testing the application;
and identifying at least one screenshot by using an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface or not according to an identification result.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for automated testing of an application, the method comprising:
acquiring an application test task, and automatically testing the application in the application test task by using an automatic test framework;
respectively performing at least one screenshot on an application test interface obtained for multiple times in the process of automatically testing the application;
and identifying at least one screenshot by utilizing an image identification technology, and determining whether the application test interface corresponding to the screenshot is an abnormal test interface or not according to an identification result.
2. The method of claim 1, wherein the at least one screenshot is performed on each of the application test interfaces obtained multiple times, and comprises:
in the process of automatically testing the application, when determining that the interactive triggering test with a control or a component in the application fails, screenshot is carried out on an application test interface obtained when the triggering test fails, and a triggering failure interface screenshot is obtained;
identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is an abnormal test interface according to an identification result, wherein the method comprises the following steps:
matching the triggering failure interface screenshot with a reference image comprising a control or a component by utilizing an image recognition technology;
and when the triggering failure interface screenshot is determined to have no reference control and component according to the matching result, determining the triggering failure interface screenshot as a test abnormal interface.
3. The method of claim 2, further comprising:
and when the reference control or the component is determined in the failed triggering interface screenshot according to the matching result, triggering a control instruction corresponding to the reference control or the component in the automatic testing frame, and continuously executing the automatic testing process.
4. The method according to claim 2 or 3, wherein the step of matching the failed trigger interface screenshot with a reference image including a control or a component by using an image recognition technology and determining whether the reference control or component exists in the failed trigger interface screenshot according to a matching result comprises the steps of:
calculating a similarity coefficient between the screenshot of the triggering failure interface and a reference image comprising a control or a component by utilizing a template matching algorithm;
and when the calculated similarity coefficient value is determined to be larger than a preset similarity coefficient threshold value, determining that the triggering failure interface screenshot is matched with a reference picture.
5. The method of claim 1, wherein the at least one screenshot is performed on each of the application test interfaces obtained multiple times, and comprises:
when a new application test interface is determined to be obtained, screenshot is carried out to obtain an application test interface screenshot;
identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is an abnormal test interface according to an identification result, wherein the method comprises the following steps:
respectively identifying the obtained screenshots of the application test interface by using an image identification technology;
respectively matching the recognition result of any application test interface screenshot with an abnormal picture in a preset abnormal picture database;
and when the recognition result of the screenshot of the application test interface is determined to be matched with any abnormal picture according to the matching result, determining that the screenshot of the application test interface is a test abnormal interface.
6. The method of claim 5, wherein the step of matching the recognition result of any application test interface screenshot with the abnormal picture in a preset abnormal picture database comprises the steps of:
calculating the similarity coefficient between the recognition result of any application test interface screenshot and an abnormal picture in a preset abnormal picture database by using an image matching algorithm;
determining that the recognition result of the screenshot of the application test interface is matched with any abnormal picture according to the matching result, wherein the steps comprise:
and when the similarity coefficient value obtained by calculation is larger than a preset similarity coefficient threshold value, determining that the recognition result of the screenshot of the application test interface is matched with the abnormal picture in a preset abnormal picture database.
7. The method according to claim 6, wherein the preset abnormal picture database comprises:
one or more of a black screen picture, a white screen picture, a flower screen picture, a flash-back picture and a loading failure picture.
8. The method of claim 5, further comprising:
determining all application test interfaces determined as test abnormal interfaces as a first type of test results;
determining other application test interfaces except the test exception interface as a second type of test result;
and generating a test report comprising the first type of test result and the second type of test result.
9. An image recognition apparatus for automated testing, the apparatus comprising: a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 8.
10. A computer storage medium having a computer program stored thereon, the program, when executed by a processor, implementing the steps of the method according to any one of claims 1 to 8.
CN201811300393.2A 2018-11-02 2018-11-02 Method and equipment for automatically testing application Active CN111143188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811300393.2A CN111143188B (en) 2018-11-02 2018-11-02 Method and equipment for automatically testing application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811300393.2A CN111143188B (en) 2018-11-02 2018-11-02 Method and equipment for automatically testing application

Publications (2)

Publication Number Publication Date
CN111143188A true CN111143188A (en) 2020-05-12
CN111143188B CN111143188B (en) 2023-09-22

Family

ID=70516176

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811300393.2A Active CN111143188B (en) 2018-11-02 2018-11-02 Method and equipment for automatically testing application

Country Status (1)

Country Link
CN (1) CN111143188B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111915601A (en) * 2020-08-12 2020-11-10 中国工商银行股份有限公司 Intelligent terminal abnormity testing method, device and system
CN112329854A (en) * 2020-11-05 2021-02-05 上海哔哩哔哩科技有限公司 Method and device for cutting and checking advertisement material picture
CN112383661A (en) * 2020-11-20 2021-02-19 北京达佳互联信息技术有限公司 Mobile terminal automation test method and device, electronic equipment and storage medium
CN113553261A (en) * 2021-07-22 2021-10-26 上汽通用五菱汽车股份有限公司 Software automation test method, equipment and computer readable storage medium
CN113805977A (en) * 2020-06-11 2021-12-17 中移(苏州)软件技术有限公司 Test evidence obtaining method, model training method, device, equipment and storage medium

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389937A (en) * 2012-05-09 2013-11-13 腾讯科技(深圳)有限公司 Interface testing method and device
CN104536888A (en) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 Game testing method and system for mobile devices
CN104899140A (en) * 2015-06-03 2015-09-09 上海斐讯数据通信技术有限公司 Test method for mobile terminal assembly
US20150347276A1 (en) * 2014-05-27 2015-12-03 International Business Machines Corporation Screenshot validation testing
US20150378876A1 (en) * 2014-06-25 2015-12-31 Vmware, Inc. Visual graphical user interface verification
CN106021108A (en) * 2016-05-19 2016-10-12 努比亚技术有限公司 Application program testing device, mobile terminal and method
CN106161134A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 Mobile terminal automation testing method, device and mobile terminal
WO2016197710A1 (en) * 2015-11-27 2016-12-15 中兴通讯股份有限公司 Method and device for identifying fake software interface for mobile terminal
CN106371988A (en) * 2016-08-22 2017-02-01 浪潮(北京)电子信息产业有限公司 Automatic interface test method and device
CN106598836A (en) * 2015-10-20 2017-04-26 阿里巴巴集团控股有限公司 Method and system for testing client software
CN107025174A (en) * 2017-04-06 2017-08-08 网易(杭州)网络有限公司 For the method for the user interface abnormality test of equipment, device and readable storage media
US20170277625A1 (en) * 2016-03-28 2017-09-28 Alexander Shtuchkin Generating annotated screenshots based on automated tests
CN107832774A (en) * 2017-10-09 2018-03-23 无线生活(杭州)信息科技有限公司 A kind of page exception detection method and device
US20180089068A1 (en) * 2016-09-28 2018-03-29 Wipro Limited Methods and systems for testing mobile applications
US9934129B1 (en) * 2017-03-17 2018-04-03 Google Llc Determining application test results using screenshot metadata
CN108536597A (en) * 2018-04-11 2018-09-14 上海达梦数据库有限公司 A kind of terminal test method, device, terminal device and storage medium
CN108549604A (en) * 2018-04-11 2018-09-18 上海达梦数据库有限公司 A kind of test script generation method, device, terminal device and storage medium
CN108549601A (en) * 2018-04-02 2018-09-18 郑州云海信息技术有限公司 A kind of more browser compatibility automated testing methods
CN108681508A (en) * 2018-05-15 2018-10-19 福建天泉教育科技有限公司 A kind of test method and terminal of view-based access control model identification

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389937A (en) * 2012-05-09 2013-11-13 腾讯科技(深圳)有限公司 Interface testing method and device
US20150347276A1 (en) * 2014-05-27 2015-12-03 International Business Machines Corporation Screenshot validation testing
US20150378876A1 (en) * 2014-06-25 2015-12-31 Vmware, Inc. Visual graphical user interface verification
CN104536888A (en) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 Game testing method and system for mobile devices
CN106161134A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 Mobile terminal automation testing method, device and mobile terminal
CN104899140A (en) * 2015-06-03 2015-09-09 上海斐讯数据通信技术有限公司 Test method for mobile terminal assembly
CN106598836A (en) * 2015-10-20 2017-04-26 阿里巴巴集团控股有限公司 Method and system for testing client software
WO2016197710A1 (en) * 2015-11-27 2016-12-15 中兴通讯股份有限公司 Method and device for identifying fake software interface for mobile terminal
US20170277625A1 (en) * 2016-03-28 2017-09-28 Alexander Shtuchkin Generating annotated screenshots based on automated tests
CN106021108A (en) * 2016-05-19 2016-10-12 努比亚技术有限公司 Application program testing device, mobile terminal and method
CN106371988A (en) * 2016-08-22 2017-02-01 浪潮(北京)电子信息产业有限公司 Automatic interface test method and device
US20180089068A1 (en) * 2016-09-28 2018-03-29 Wipro Limited Methods and systems for testing mobile applications
US9934129B1 (en) * 2017-03-17 2018-04-03 Google Llc Determining application test results using screenshot metadata
CN107025174A (en) * 2017-04-06 2017-08-08 网易(杭州)网络有限公司 For the method for the user interface abnormality test of equipment, device and readable storage media
CN107832774A (en) * 2017-10-09 2018-03-23 无线生活(杭州)信息科技有限公司 A kind of page exception detection method and device
CN108549601A (en) * 2018-04-02 2018-09-18 郑州云海信息技术有限公司 A kind of more browser compatibility automated testing methods
CN108536597A (en) * 2018-04-11 2018-09-14 上海达梦数据库有限公司 A kind of terminal test method, device, terminal device and storage medium
CN108549604A (en) * 2018-04-11 2018-09-18 上海达梦数据库有限公司 A kind of test script generation method, device, terminal device and storage medium
CN108681508A (en) * 2018-05-15 2018-10-19 福建天泉教育科技有限公司 A kind of test method and terminal of view-based access control model identification

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805977A (en) * 2020-06-11 2021-12-17 中移(苏州)软件技术有限公司 Test evidence obtaining method, model training method, device, equipment and storage medium
CN113805977B (en) * 2020-06-11 2024-03-19 中移(苏州)软件技术有限公司 Test evidence obtaining method, model training method, device, equipment and storage medium
CN111915601A (en) * 2020-08-12 2020-11-10 中国工商银行股份有限公司 Intelligent terminal abnormity testing method, device and system
CN112329854A (en) * 2020-11-05 2021-02-05 上海哔哩哔哩科技有限公司 Method and device for cutting and checking advertisement material picture
CN112329854B (en) * 2020-11-05 2023-07-28 上海哔哩哔哩科技有限公司 Method and device for checking picture cutting of advertisement material
CN112383661A (en) * 2020-11-20 2021-02-19 北京达佳互联信息技术有限公司 Mobile terminal automation test method and device, electronic equipment and storage medium
CN113553261A (en) * 2021-07-22 2021-10-26 上汽通用五菱汽车股份有限公司 Software automation test method, equipment and computer readable storage medium
CN113553261B (en) * 2021-07-22 2023-09-15 上汽通用五菱汽车股份有限公司 Software automated testing method, device and computer readable storage medium

Also Published As

Publication number Publication date
CN111143188B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
CN111143188B (en) Method and equipment for automatically testing application
WO2018010552A1 (en) Test method and device
US10162742B2 (en) System and method for end to end performance response time measurement based on graphic recognition
CN105302413B (en) UI (user interface) testing method and system for control
TWI678614B (en) Test system
WO2019169760A1 (en) Test case range determining method, device, and storage medium
WO2021159736A1 (en) Application compatibility test method and apparatus, and computer device
US20140033179A1 (en) Application testing
US10705950B2 (en) Method and system for semi-automatic testing of program code for graphical user interfaces
CN105227949A (en) A kind of Android Set Top Box automated testing method
US11704230B2 (en) Test script generation based on event data and video frames
CN111459796A (en) Automatic testing method and device, computer equipment and storage medium
JP6747161B2 (en) Software quality judgment method
CN111008140B (en) Cross-platform UI (user interface) automatic testing method and device
CN111459831B (en) Test system and test method
CN109688025B (en) Test monitoring method, device, terminal and storage medium based on digital KVM
CN112527631A (en) bug positioning method, system, electronic equipment and storage medium
CN115391084B (en) Intelligent solution method and system for cloud game abnormity
CN116662206B (en) Computer software online real-time visual debugging method and device
CN111522737B (en) Automatic test verification method and device for front-end interface and storage medium
CN117349189B (en) APP new version testing method, equipment and medium
WO2024023948A1 (en) Analysis device, analysis method, and analysis program
CN116185411B (en) RPA interface determination method, RPA interface determination device, computer equipment and storage medium
US20240169513A1 (en) Determining process deviations through video analysis
CN111414290A (en) Client icon testing method and device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant