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

Method and equipment for automatically testing application Download PDF

Info

Publication number
CN111143188B
CN111143188B CN201811300393.2A CN201811300393A CN111143188B CN 111143188 B CN111143188 B CN 111143188B CN 201811300393 A CN201811300393 A CN 201811300393A CN 111143188 B CN111143188 B CN 111143188B
Authority
CN
China
Prior art keywords
test
application
screenshot
interface
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.)
Active
Application number
CN201811300393.2A
Other languages
Chinese (zh)
Other versions
CN111143188A (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

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 or not by utilizing screenshot in the test process, and positioning the test abnormal interface by utilizing an image technology, so that a tester can conveniently remove abnormal conditions. The method comprises the following steps: acquiring an application test task, and automatically testing the application in the application test task by utilizing an automatic test framework; in the process of automatic test application, at least one screenshot is respectively carried out on the application test interface obtained for multiple times; and identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is a test abnormal interface according to an identification result.

Description

Method and equipment for automatically testing application
Technical Field
The present invention relates to the field of automated testing, and in particular, to a method and apparatus for automated testing of applications.
Background
The existing automatic test technology for terminal application is mainly based on an automatic test framework such as UiAutomator, appium, and the like, and is used for automatically testing the application through test scripts, then outputting logs and results in the test process, and displaying the test results at present, wherein one of the existing automatic test technology is used for outputting reports or execution script logs in the test process; one is to show the screenshot of the test result report, and the test personnel needs to analyze and judge the test result manually. The above scheme has the following disadvantages in the actual test process:
because the automatic test frames all independently run, when a certain automatic test frame is used for testing, part of application controls or components cannot be identified by the test frame or send action instructions, and the test requirements of the application cannot be completely met;
the verification of the test result is taken as an important ring in the automatic test, and taking the compatibility test as an example, a tester needs to analyze and judge thousands of test screenshots generated after the automatic test task is completed one by one, so that the efficiency is low and the manpower resource consumption 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 or not by utilizing screenshot in the test process, positioning the test abnormal interface by utilizing an image technology and facilitating the elimination of abnormal conditions by a tester.
In a first aspect, the present invention provides a method of automated testing of an application, the method comprising:
acquiring an application test task, and automatically testing the application in the application test task by utilizing an automatic test framework;
in the process of automatic test application, at least one screenshot is respectively carried out on the application test interface obtained for multiple times;
and identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is a test abnormal interface according to an identification result.
In a second aspect, the present invention provides an apparatus for automated testing of applications, 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:
acquiring an application test task, and automatically testing the application in the application test task by utilizing an automatic test framework;
in the process of automatic test application, at least one screenshot is respectively carried out on the application test interface obtained for multiple times;
and identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is a test abnormal interface 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 utilizing an automatic test framework;
in the process of automatic test application, at least one screenshot is respectively carried out on the application test interface obtained for multiple times;
and identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is a test abnormal interface according to an identification result.
The method and the device for automatically testing the application provided by the invention have the following beneficial effects:
on the one hand, based on the prior art that when a certain automatic test frame is independently used for testing, part of application controls or components cannot be identified by the test frame or an action instruction is sent, the embodiment provided by the invention can automatically position the to-be-tested application operable components or controls through an image identification technology and trigger the control instruction, so that the process of guiding automatic testing is achieved, and the test requirement of the application is met;
on the other hand, the invention provides the method for automatically outputting the abnormal test pictures by carrying out image recognition and classification on the common or special abnormal test results in the automatic test process, thereby improving the test efficiency and saving the consumption of human resources.
Drawings
FIG. 1 is a flow chart of a method for automated testing of applications;
FIG. 2 is a diagram of steps performed in a method for automated testing of applications;
fig. 3 is a method and apparatus diagram for automated testing of applications.
Detailed Description
The invention provides a method and equipment for automatically testing an application, aiming at solving the problems that an application test interface is provided with a control in the existing automatic test and an automatic test frame cannot identify the tested application control or component, improving the efficiency of the automatic test and realizing the minimization of human resource requirements.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
The embodiment of the invention provides a method for automatically testing an application, as shown in fig. 1, comprising the following steps:
step 101, acquiring an application test task, and performing automatic test on the application in the application test task by using an automatic test framework, wherein the automatic test framework comprises a plurality of basic test modules, a plurality of test scripts are provided, and interactive triggering test is performed on the control or the component in the application by executing the test scripts.
Specifically, the application test task comprises a plurality of Application (APP) of the terminal, wherein each APP comprises a plurality of controls or components; the automatic test framework is used for automatically testing the application APP in the application test task, the automatic test framework is used for simulating clicking of a mouse and operation of a keyboard to perform interactive triggering test on components or controls in each application APP, and whether each APP has problems or not is determined according to test results.
Step 102, respectively performing 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 performing interactive triggering test on the APP by using the operation of the automatic test framework to simulate the clicking of the mouse and the keyboard, in a complete test process, each interactive test is completed corresponding to one application test interface, in the whole test process, a plurality of application test interfaces can be continuously output, a new application test interface can be correspondingly output as long as a new interactive triggering test is involved, and different application test interface screenshot interval time can be set according to different test requirements.
In this embodiment, for at least one application test interface screenshot, two screenshot modes are specifically adopted, and mode one: when determining that the interaction with a control or a component in the application fails to trigger in the test process, an application test interface screenshot is obtained; mode two: screenshot is carried out when a new test application interface is determined to be obtained; the automatic test process can comprise the first screenshot mode and the second screenshot mode, and can also only independently perform one of the first screenshot mode and the second screenshot mode.
And 103, identifying at least one screenshot by utilizing an image identification technology, and determining whether the application test interface corresponding to the screenshot is a test abnormal interface or not according to an identification result.
In the implementation, the screenshot is identified by using an image identification technology, so that screenshot content can be obtained, and after the screenshot content 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 of when to perform screenshot according to experience, can perform application test interface screenshot in a targeted manner according to links with problems frequently occurring in the test, can perform universal screenshot according to a certain frequency, can perform screenshot when a new application test interface is obtained each time, and can perform specific screenshot rules according to needs, wherein the specific screenshot rules are not particularly limited.
On the basis of setting rules of how to screen capturing, rules for judging the abnormal interface can be set according to the characteristics of the screen capturing, for example, the rules can be matched with the normal application test interface screen capturing according to the corresponding screen capturing time when the screen capturing is performed, 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 the method can also be matched with a preset abnormal test picture, if so, the abnormal application test interface is indicated, and otherwise, the normal application test interface is indicated. The specific matching rule may be flexibly set depending on the screenshot, and is not particularly limited herein.
By applying the method for automatically testing provided by the embodiment of the invention, during the automatic testing, the screen capturing is performed on the application testing interface by utilizing the image recognition technology, so that whether the testing is abnormal or not can be automatically recognized, on one hand, the problem in which link in the testing can be automatically positioned, on the other hand, the workload of human intervention judgment can be reduced, and the testing efficiency is improved.
In implementation, the test application task includes an application terminal APP and a reference diagram including a control or a component, where the application terminal APP and the test script include executable controls or components, and test the executable controls or components in the test application based on an automation test framework, and the application terminal APP provides the reference diagram including the controls or components to match with an application test interface, and determines whether the application test interface is a test abnormal interface according to a matching result.
The two alternative implementations of this embodiment are given below with respect to the rule setting when the screenshot is performed and the determination mechanism how to determine the abnormal picture, and the two alternative implementations may be implemented separately or in combination.
As an alternative implementation manner, this embodiment uses the following manner to perform the application test interface screenshot:
in the process of automatically testing the application, when the interaction triggering test of the automatic test framework and a control or a component in the application fails, the screenshot of an application test interface obtained when the triggering test fails is determined, and the screenshot of a triggering failure interface is obtained;
in the automatic test process, when a test script interacted with a control or component in the terminal APP is executed, a trigger instruction is firstly generated to simulate clicking 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 clicking the control or component in the APP, no response is generated. The reasons for failure are two, namely that one terminal APP has a problem, the interactive interface has no control or component, and the other terminal APP has a problem in the automatic test framework and cannot identify the control or component in the APP interface.
In this embodiment, in order to identify a cause of a trigger failure, when it is determined that an automatic test framework and a control or a component in an application interactively trigger a test failure, a screenshot is performed on an application test interface obtained when the trigger test fails, so as to obtain a trigger failure interface screenshot.
In this embodiment, based on the above screenshot mechanism, the following manner is adopted to determine whether the test application corresponding to the screenshot is an abnormal test interface:
and matching the trigger failure interface screenshot with a reference image comprising a control or a component by utilizing 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 successful matching indicates that the automatic test framework can recognize the control or the component in the APP interface, so that the fact that the terminal APP has no control or component in an interactive interface is judged.
Specifically, firstly cutting a failure interface screenshot, then comparing the failure interface screenshot with the reference picture frame by frame, calculating the similarity coefficient of the failure interface screenshot and the reference picture according to a template matching algorithm, and determining that the triggering failure interface screenshot is successfully matched with the reference picture when the calculated similarity coefficient value is higher than a preset similarity coefficient threshold value according to a preset similarity coefficient threshold value.
When the condition that the reference control and the component are not in the trigger failure interface screenshot is determined according to the matching result, the trigger failure interface screenshot is determined to be a test abnormal interface, and the generated trigger failure interface screenshot can be prevented from being 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 trigger failure interface screenshot according to the matching result, a control instruction corresponding to the reference control or component in the automatic test framework is triggered, and the automatic test 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 the corresponding control instruction, and the test task cannot be completed.
Therefore, the invention can utilize the image recognition technology to position the control or the component in the triggering failure interface screenshot and trigger the control instruction corresponding to the reference control or the component to continuously complete the automatic test process, thereby avoiding the problem that the control or the component cannot complete the test task when being unable to be recognized by the automatic test framework in the automatic test process.
In the implementation, the method comprises the following steps:
when the reference control or the component is determined to exist in the trigger failure interface screenshot, the control or the component in the trigger failure interface screenshot is identified and positioned by utilizing an image identification technology, wherein the coordinates of the control or the component in the trigger failure interface screenshot are positioned, and a test operation command is sent to the coordinates through an automation frame, so that the subsequent test task is continuously executed.
As a preferred embodiment, the matching the trigger failure interface screenshot with the reference image including the control or the component by using the image recognition technology, and determining whether there is a reference control or component in the trigger failure interface screenshot according to the matching result includes:
calculating the similarity coefficient between the trigger failure interface screenshot and a reference image comprising a control or a component by using 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 trigger failure interface screenshot is matched with the reference picture.
The specific content of the template matching algorithm is as follows:
wherein, the liquid crystal display device comprises a liquid crystal display device,
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 liquid crystal display device comprises a liquid crystal display device,
χ′=0...w-1,y′=0...h-1
in the above formula:
x, y is the upper left corner coordinate in the failure interface screenshot picture, 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 the value of the failed interface screenshot image after comparing each point (x, y) in the screenshot image area, and I (x, y) is the value of the reference image after comparing each point (x, y) in the reference image area;
setting the origins of T (x, y) and I (x, y) to be at the upper left corner, and obtaining an R (x, y) according to a formula for any coordinate point (x, y), wherein R (x, y) represents a similarity coefficient value set of matching the failed interface screenshot with the reference image;
and calculating the similarity coefficient value set according to the formula, selecting the 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 alternative implementation manner, the present embodiment uses the following manner to perform the application test interface screenshot:
capturing a screen when a new application test interface is determined to be obtained to obtain an application test interface screen;
in this embodiment, based on the above screenshot mechanism, the method for determining whether the test application corresponding to the screenshot is a test abnormal interface includes:
the method of using image recognition technology to test the screenshot of the interface for the obtained application may refer to the method described in the first screenshot embodiment, which is not described in detail herein.
Respectively matching the identification result of any application test interface screenshot with an abnormal picture in a preset abnormal picture database, wherein the abnormal picture database comprises abnormal pictures such as a black screen picture, a white screen picture, a screen pattern picture and the like which frequently 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 successful matching is confirmed.
And when the identification result of the application test interface screenshot is matched with any abnormal picture according to the matching result, determining that the application test interface screenshot is a test abnormal interface.
The invention can locate the abnormal test interface by using the image technology, is convenient for testers to remove abnormal conditions, avoids the situation that the testers need to analyze the screenshot of the application test interface one by one in the automatic test process, improves the test efficiency, shortens the time for generating the test report and saves human resources.
As an optional implementation manner, the matching of the identification result of any application test interface screenshot and the abnormal picture in the preset abnormal picture database includes:
calculating the similarity coefficient of the identification result of any application test interface screenshot and the abnormal picture in the preset abnormal picture database by using an image matching algorithm;
and determining that the identification result of the application test interface screenshot is matched with any abnormal picture according to the matching result, wherein the method comprises the following steps:
when the calculated similarity coefficient value is larger than a preset similarity coefficient threshold value, determining that the identification result of the application test interface screenshot is matched with an abnormal picture in a preset abnormal picture database.
The image matching algorithm is based on the template matching algorithm, the abnormal image in the abnormal image characteristic data set acquired in the automatic test process is matched with a failure interface screenshot image in the actual test, and a similarity coefficient threshold value obtained by matching with the image is determined 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, through matching a failed interface screenshot, such as the black screen, the white screen and the flower screen, which frequently occur in an actual test, with a black screen image in the abnormal picture feature data set according to the image matching algorithm, obtaining a similarity coefficient set of matching the failed interface screenshot with the black screen image through ten thousand matching calculations, screening values in the similarity coefficient set, and determining the similarity coefficient threshold according to the screened similarity coefficient.
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 implementation, the testing anomaly interface further includes:
determining all application test interfaces determined to be test abnormal interfaces as a first type of test result;
determining other application test interfaces except the test abnormal interface as a second type of test result;
a test report is generated that includes the first type of test results and the second type of test results.
When some controls or components in the automatic test process can not be identified by the automatic test framework, the first type of test results are used for identifying the controls or components in the application test interface by utilizing an image identification technology to continue the automatic test; the second type of test results can be used for automatically obtaining test results through automatic test, whether the application test interface belongs to an abnormal application test interface or not is identified through an image identification technology, the test efficiency is improved, and the time for generating a test report is shortened.
The following describes the above embodiments in detail, and the implementation steps of a method for performing an automated test on an application are shown in fig. 2:
step 201: acquiring a test application APP;
step 202: executing an automatic test application, and simulating mouse click and keyboard operation by using an automatic test framework to perform interactive triggering test on a control or a component in the test application APP;
specifically, clicking on the executable control in the APP tests whether the control has a response.
Step 203: judging whether control or component interaction trigger in the application is unresponsive or not in the process of automatically testing the application, if yes, executing step 204 on the failed interface screenshot, otherwise executing step 203;
step 204: matching the failed 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 a component, if not, executing a step 206, otherwise, executing a step 207;
step 206: continuing to execute the automatic test application;
step 207: triggering a control instruction corresponding to the reference control or the component in the automatic test framework, and executing step 206;
step 208: screenshot is carried out on the obtained new automatic application test interface;
step 209: identifying an application test interface screenshot 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 identification result of the application test interface screenshot is matched with any abnormal picture, if so, executing step 211, otherwise, executing step 210;
step 211: and outputting an application test interface screenshot matched with any abnormal picture as an automatic test report.
Example two
Based on the same inventive concept, an apparatus for performing automatic testing on an application is provided in the embodiments of the present invention, and the specific implementation of the apparatus may refer to the description of the embodiment of the method, and the repetition is omitted.
As shown in fig. 3, the apparatus mainly includes: a processor 301 and a memory 302, wherein the memory 302 stores program code that, when executed by the processor 301, causes the processor 301 to perform the steps of any 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 utilizing an automatic test framework;
in the process of automatic test application, at least one screenshot is respectively carried out on the application test interface obtained for multiple times;
and identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is a test abnormal interface according to an identification result.
As an optional implementation manner, the processor 301 is configured to, in a process of automatically testing an application, determine that, when a trigger test fails by interacting with a control or a component in the application, perform screenshot on an application test interface obtained when the trigger test fails, and obtain a trigger failure interface screenshot;
matching the trigger failure interface screenshot with a reference image comprising a control or a component by utilizing an image recognition technology;
and when the trigger failure interface screenshot is determined to have no reference control and no reference component according to the matching result, determining that the trigger failure interface screenshot is a testing abnormal interface.
In implementation, the processor 301 is further configured to trigger a control instruction corresponding to a reference control or component in the automated test framework to continue to execute the automated test process when it is determined that the reference control or component is in the trigger failure interface screenshot according to the matching result.
As an optional implementation manner, the processor 301 uses an image recognition technology to match the trigger failure interface screenshot with a reference image including a control or a component, and determines whether the trigger failure interface screenshot includes the reference control or the component according to a matching result, where the trigger failure interface screenshot is used for:
calculating the similarity coefficient between the trigger failure interface screenshot and a reference image comprising a control or a component by using 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 trigger failure interface screenshot is matched with the reference picture.
In implementation, the processor 301 performs at least one screenshot on the application test interface obtained multiple times, and is further configured to perform screenshot when determining that a new application test interface is obtained to obtain an application test interface screenshot;
at least one screenshot is identified by utilizing an image identification technology, and whether an application test interface corresponding to the screenshot is a test abnormal interface or not is determined according to an identification result, wherein the application test interface is used for:
respectively identifying the obtained application test interface screenshots by utilizing an image identification technology;
respectively matching the identification result of any application test interface screenshot with an abnormal picture in a preset abnormal picture database;
and when the identification result of the application test interface screenshot is matched with any abnormal picture according to the matching result, determining that the application test interface screenshot is a test abnormal interface.
As an optional implementation manner, the processor 301 respectively matches the identification result of any application test interface screenshot with an abnormal picture in a preset abnormal picture database, and is configured to:
calculating the similarity coefficient of the identification result of any application test interface screenshot and the abnormal picture in the preset abnormal picture database by using an image matching algorithm;
and determining that the identification result of the application test interface screenshot is matched with any abnormal picture according to the matching result, wherein the identification result is used for:
when the calculated similarity coefficient value is larger than a preset similarity coefficient threshold value, determining that the identification result of the application test interface screenshot is matched with an 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 above processor is further configured to:
determining all application test interfaces determined to be test abnormal interfaces as a first type of test result;
determining other application test interfaces except the test abnormal interface as a second type of test result;
a test report is generated that includes the first type of test results and the second type of test results.
Example III
The present invention also provides a computer storage medium, and the specific implementation of the computer storage medium may be referred to the description of the embodiment part of the method, and the repetition is not repeated.
The computer storage medium stores 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 utilizing an automatic test framework;
in the process of automatic test application, at least one screenshot is respectively carried out on the application test interface obtained for multiple times;
and identifying at least one screenshot by utilizing an image identification technology, and determining whether an application test interface corresponding to the screenshot is a test abnormal interface according to an identification result.
It will be appreciated by those skilled in the art that 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, magnetic 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (8)

1. A method for automated testing of applications, the method comprising:
acquiring an application test task, and automatically testing the application in the application test task by utilizing an automatic test framework;
in the process of automatically testing the application, when the interaction with a control or a component in the application is determined to trigger the test failure, the screenshot of the application test interface obtained when the trigger test fails is carried out, and the screenshot of the trigger failure interface is obtained;
capturing a screen when a new application test interface is determined to be obtained to obtain an application test interface screen;
matching the trigger failure interface screenshot with a reference image comprising a control or a component by utilizing an image recognition technology; when no reference control and no reference component are found in the trigger failure interface screenshot according to the matching result, determining that the trigger failure interface screenshot is a testing abnormal interface;
respectively identifying the obtained application test interface screenshots by utilizing an image identification technology; respectively matching the identification result of any application test interface screenshot with an abnormal picture in a preset abnormal picture database; and when the identification result of the application test interface screenshot is matched with any abnormal picture according to the matching result, determining that the application test interface screenshot is a test abnormal interface.
2. The method as recited in claim 1, further comprising:
and when the reference control or the component is determined to be in the trigger failure interface screenshot according to the matching result, triggering a control instruction corresponding to the reference control or the component in the automatic test framework, and continuing to execute the automatic test process.
3. The method according to claim 1 or 2, wherein matching the trigger failure 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 trigger failure interface screenshot according to a matching result, includes:
calculating the similarity coefficient between the trigger failure interface screenshot and a reference image comprising a control or a component by using 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 trigger failure interface screenshot is matched with the reference picture.
4. The method of claim 1, wherein the 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 of the identification result of any application test interface screenshot and the abnormal picture in the preset abnormal picture database by using an image matching algorithm;
and determining that the identification result of the application test interface screenshot is matched with any abnormal picture according to the matching result, wherein the method comprises the following steps:
when the calculated similarity coefficient value is larger than a preset similarity coefficient threshold value, determining that the identification result of the application test interface screenshot is matched with an abnormal picture in a preset abnormal picture database.
5. The method of claim 4, 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.
6. The method as recited in claim 1, further comprising:
determining all application test interfaces determined to be test abnormal interfaces as a first type of test result;
determining other application test interfaces except the test abnormal interface as a second type of test result;
a test report is generated that includes the first type of test results and the second type of test results.
7. An image recognition apparatus for use in 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 6.
8. A computer storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-6.
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 CN111143188A (en) 2020-05-12
CN111143188B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN112329854B (en) * 2020-11-05 2023-07-28 上海哔哩哔哩科技有限公司 Method and device for checking picture cutting of advertisement material
CN112383661B (en) * 2020-11-20 2023-05-02 北京达佳互联信息技术有限公司 Mobile terminal automatic test method and device, electronic equipment and storage medium
CN113553261B (en) * 2021-07-22 2023-09-15 上汽通用五菱汽车股份有限公司 Software automated testing method, device and computer readable storage medium

Citations (15)

* 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
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
CN107832774A (en) * 2017-10-09 2018-03-23 无线生活(杭州)信息科技有限公司 A kind of page exception detection method and device
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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9852049B2 (en) * 2014-05-27 2017-12-26 International Business Machines Corporation Screenshot validation testing
US9846634B2 (en) * 2014-06-25 2017-12-19 Vmware, Inc. Visual graphical user interface verification
US10324828B2 (en) * 2016-03-28 2019-06-18 Dropbox, Inc. Generating annotated screenshots based on automated tests
US10055339B2 (en) * 2016-09-28 2018-08-21 Wipro Limited Methods and systems for testing mobile applications

Patent Citations (15)

* 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
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
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
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

Also Published As

Publication number Publication date
CN111143188A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN111143188B (en) Method and equipment for automatically testing application
WO2018010552A1 (en) Test method and device
US8752182B2 (en) Pinpointing security vulnerabilities in computer software applications
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
EP2951697A1 (en) Generating software test script from video
JP7404839B2 (en) Identification of software program defect location
US20140033179A1 (en) Application testing
US10705950B2 (en) Method and system for semi-automatic testing of program code for graphical user interfaces
JP2019029015A (en) Interactive software program repair
CN112286825A (en) Screen testing method and device for intelligent cabin and electronic equipment
US20210365355A1 (en) Test case generation apparatus, test case generation method, and computer readable medium
CN106598836A (en) Method and system for testing client software
CN110716778A (en) Application compatibility testing method, device and system
CN110309059A (en) UI interface detection method, system, computer equipment and storage medium
CN112084117B (en) Test method and device
CN111008140B (en) Cross-platform UI (user interface) automatic testing method and device
CN112527631A (en) bug positioning method, system, electronic equipment and storage medium
CN109634842B (en) QT application-based test method and system
US10545858B2 (en) Method for testing a graphical interface and corresponding test system
WO2024023948A1 (en) Analysis device, analysis method, and analysis program
CN116955159A (en) APP detection system, method, electronic device and storage medium
CN116932413B (en) Defect processing method, defect processing device and storage medium for test task
CN108226812A (en) Self-action power detecting system
US20170220450A1 (en) Analytic method and analyzing 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
GR01 Patent grant
GR01 Patent grant