CN116302925A - Automatic test method, device, electronic equipment and readable storage medium - Google Patents

Automatic test method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116302925A
CN116302925A CN202211613702.8A CN202211613702A CN116302925A CN 116302925 A CN116302925 A CN 116302925A CN 202211613702 A CN202211613702 A CN 202211613702A CN 116302925 A CN116302925 A CN 116302925A
Authority
CN
China
Prior art keywords
picture
test
target software
test case
operation result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211613702.8A
Other languages
Chinese (zh)
Inventor
王琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Honghe Innovation Information Technology Co Ltd
Original Assignee
Shenzhen Honghe Innovation 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 Shenzhen Honghe Innovation Information Technology Co Ltd filed Critical Shenzhen Honghe Innovation Information Technology Co Ltd
Priority to CN202211613702.8A priority Critical patent/CN116302925A/en
Publication of CN116302925A publication Critical patent/CN116302925A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/19007Matching; Proximity measures
    • 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)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses an automatic testing method, an automatic testing device, electronic equipment and a readable storage medium, which are used for solving the problem that a tester is required to write a complex code in the traditional automatic testing. The method comprises the following steps: obtaining a test file, wherein the test file comprises at least one test case; aiming at each test case, operating target software according to the test case and a first picture to obtain an operation result, and obtaining an execution result of the test case according to the operation result, wherein the first picture is a picture comprising an operation interface of the target software; and obtaining a test report of the target software according to the execution result of each test case.

Description

Automatic test method, device, electronic equipment and readable storage medium
Technical Field
The application belongs to the field of automatic testing, and particularly relates to an automatic testing method, an automatic testing device, electronic equipment and a readable storage medium.
Background
At present, the automatic test of the PC end mainly comprises the steps of identifying the names of elements on an operation interface, obtaining the positions of the elements on a software operation interface, and then performing related operations to complete the test. In this process, a tester needs to write a corresponding test code to identify the front-end element name, however, writing a test code is complex and difficult, requiring a professional code writing capability.
Disclosure of Invention
The embodiment of the application provides an automatic test method and device, which are used for solving the problem that complex codes need to be written in the current automatic test.
In a first aspect, an embodiment of the present application provides an automated testing method, including:
obtaining a test file, wherein the test file comprises at least one test case;
aiming at each test case, operating the target software according to the test case and a first picture to obtain an operation result, and obtaining an execution result of the test case according to the operation result, wherein the first picture is a picture comprising an operation interface of the target software;
and obtaining a test report of the target software according to the execution result of each test case.
According to the method and the device for testing the target software, the test files are obtained, each test case in the test files is read, and the target software can be operated according to the test cases and the first pictures, so that testing is completed. Compared with the traditional automatic test method, the scheme does not depend on the code of the software to be tested, realizes the decoupling of the automatic test script and the code of the software to be tested, and is very friendly for the testers because the testers only need to write the test cases and do not need to write complex codes. The embodiment of the application also generates the test report by aggregating the execution results of each test case, gathers the automatic test results and provides a foundation for the development and maintenance of target software.
In a possible implementation manner of the first aspect, the test case includes address information and actions of the second picture.
In a possible implementation manner of the first aspect, the operating the target software according to the test case and the first picture to obtain an operation result includes:
reading a second picture according to the address information of the second picture, wherein the second picture is used for representing elements to be operated in an operation interface of the target software;
determining reference coordinates according to the first picture and the second picture, wherein the reference coordinates are positions of the elements to be operated on an operation interface of the target software;
and operating the target software according to the reference coordinates and the action to obtain the operation result.
According to the method and the device for positioning the element on the operation interface, the test files are obtained, each test case in the test files is read, each test case comprises the second picture address and the action, and the element is positioned on the operation interface according to the first picture and the second picture.
In a possible implementation manner of the first aspect, the operating the target software according to the reference coordinates and the action includes:
and after the mouse is controlled to move to the reference coordinates, executing the operation corresponding to the action on the target software by using a mouse and/or a keyboard operation library.
In a possible implementation manner of the first aspect, before the obtaining the test file, the method further includes:
and starting the target software according to a configuration file, wherein the configuration file comprises the software name of the target and the installation position of the target software.
In a possible implementation manner of the first aspect, the operating the target software according to the test case and the first picture to obtain an operation result, and obtaining an execution result of the test case according to the operation result includes:
according to the test case and the first picture, operating the target software to obtain an operation result;
acquiring a third picture, wherein the third picture is used for representing the operation result;
storing the third picture to a preset address;
and executing the assertion operation on the operation result to obtain the execution result of the test case.
In a possible implementation manner of the first aspect, after the obtaining a test report of the target software according to the execution result of each test case, the method further includes:
and sending the test report to a preset object in a preset mode.
In a second aspect, embodiments of the present application provide an automated testing apparatus, including:
reading a file unit: the method comprises the steps of obtaining a test file, wherein the test file comprises at least one test case;
test unit: the method comprises the steps that for each test case, the target software is operated according to the test case and a first picture, an operation result is obtained, an execution result of the test case is obtained according to the operation result, and the first picture is a picture comprising an operation interface of the target software;
a result acquisition unit: and the test report of the target software is obtained according to the execution results of each test case.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the method according to any one of the above first aspects when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements a method as in any one of the first aspects described above.
In a fifth aspect, embodiments of the present application provide a computer program product for, when run on a terminal device, causing the terminal device to perform the method of any one of the first aspects.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an automated testing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of test case storage provided in an embodiment of the present application;
FIG. 3 is a schematic flow chart of an automated testing method according to one embodiment of the present disclosure;
FIG. 4 is a block diagram of an automated test equipment provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In the automatic test, after the elements on the operation interface are identified, the related user behaviors can be simulated more accurately to develop other contents of the automatic test, but as for the background art, the current automatic test of the PC end mainly carries out identification on the names of the elements on the operation interface to obtain the positions of the elements on the software operation interface, and then carries out related operations to complete the test. In this process, a tester needs to write corresponding test codes to identify the names of the front-end elements, and the tester needs to have professional code writing capability, and the identification mode depends on the specification and effective naming of the elements in the target software code, so that once the elements are confused, effective element positioning is difficult.
Aiming at the problem, the embodiment of the application obtains the position of the element on the operation interface by obtaining the test file and reading the element picture in each test case in the test file and using the image matching technology, so that the position of the element on the operation interface can be accurately positioned.
The automatic test method provided by the embodiment of the application can be applied to electronic equipment, such as a mobile computer. The embodiment of the application does not limit the specific type of the electronic device. In an automatic test scenario, the mobile computer automatically tests the software operation interface through the automatic test method provided by the embodiment of the application to obtain a test report.
Referring to fig. 1, a schematic flow chart of an automated testing method according to an embodiment of the present application is provided, and the method may include the steps of:
step S101, obtaining a test file, wherein the test file at least comprises one test case.
The test file is a file comprising one or more test cases, and the automatic test is performed according to the content of the test cases by acquiring the test cases in the test file.
In this embodiment of the present application, the format of the test file may be excel, xml, and yaml, and the test file may be stored in the local disk, where the test file may be obtained by reading the specified address of the local disk. Of course, the test file may also be stored on the cloud server, and at this time, the test file may be obtained by downloading the test file on the cloud server.
To facilitate viewing and auditing of the test cases, each test case may also include a serial number and a name.
In the embodiment of the application, the test cases are stored in the test file according to a preset rule. In the process of automatic test, the test cases are read according to the preset rules, so that the appointed content can be read. By way of example and not limitation, one method of storing test cases according to preset rules is presented below, and FIG. 2 is a schematic diagram of storing test cases according to preset rules.
As shown in fig. 2, the test file is an excel file, the content of the first behavior test case in the test file is identified, and each remaining row stores one test case. The first value of each test case is the serial number of the test case, and the second value is the name of the test case. Each test case comprises one or more steps, the content of each step occupies 3 cells, and the steps are picture addresses, actions and input content of the actions in sequence.
The steps in one test case represent operations that need to be performed by executing the test case, for example, one test case for testing a login function includes three steps, namely, inputting an account number, inputting a password, and clicking a login button.
In some embodiments, before the test file is acquired in step S101, the method further includes starting the target software according to a configuration file, where the configuration file includes a name of the target software and an installation location of the target software.
The test framework pytest of python may be used to automatically start the target software, specifically, the tester may change the framework configuration file of pytest, where the changed content includes the name of the target software and the installation location of the target software, and then call the entry file main.py of pytest, where the entry file main.py starts the target software by identifying the name of the target software and the installation location of the target software in the framework configuration file.
Step S102, aiming at each test case, operating the target software according to the test case and the first picture to obtain an operation result, and obtaining an execution result of the test case according to the operation result.
Specifically, the target software is the software to be tested, and the first picture is the picture comprising the target software operation interface. In the running process of the target software, the first picture can be obtained through screenshot operation, and the first picture can be stored in a local folder as a temporary file after screenshot. When the display mode of the target software is the maximum, the first picture can be a full screen screenshot, and when the display mode of the target software is the window, the first picture can be a full screen screenshot or a partial window screenshot only comprising the software.
In some embodiments, each test case includes a second picture address and an action, where the second picture is used to represent an element to be operated in the target software, that is, an element to be tested by the test case, where the element to be operated may be a button, a text box, a drop-down list box, a scroll bar, or all components on an operation interface that need to be used in the use process of the target software. The second picture is a picture comprising a certain component as described above, for example, the second picture may be a picture comprising a button, a text box or a scroll bar.
The action means to perform corresponding operation on the target software, the action may be clicking the left button of the mouse, clicking the right button of the mouse, inputting by the keyboard and all actions needed in the process of using the target software, and the action also includes input content of the action, for example, the action is inputting by the keyboard, and the input content is 123456, which represents inputting 123456 on an element to be operated of the target software through the keyboard. Wherein the element to be operated may be a text input box.
In some embodiments, the first picture and the second picture are matched through an image matching technology, so that a reference coordinate of the second picture on the first picture can be obtained, and a specific position of an element to be operated, which is represented by the second picture, on the target software operation interface is obtained.
For example, by comparing the second picture including the login button with the first picture, the reference coordinates of the login button on the operation interface of the target software can be obtained.
The image matching technology may be completed by using a python's photo library, or may be implemented by using a template matching technology or other mature and open-source image matching technology. As an example, picture matching using the python's follow-up library is described as follows:
reading a second picture address in the test case;
screenshot is carried out on a software operation interface to obtain a first picture, and the first picture is stored and an address is obtained;
calling a comparison positioning function packaged by a follow library, and taking the first picture address and the second picture address as parameters;
and the pixel point comparison positioning is carried out by the pixel point library to obtain the coordinates of the second picture in the first picture, and the width and the height of the second picture.
The following describes the completion of image matching using a template matching method:
reading a second picture address in the test case;
screenshot is carried out on a software operation interface to obtain a first picture, and the first picture is stored and an address is obtained;
invoking python's opencv library;
and calling a matchTemplate method in an opencv library to perform image matching, and taking the first picture address and the second picture address as parameters.
And calling a cv.minMaxLoc method to locate the best matching position, and obtaining the coordinates of the second picture in the first picture.
In this embodiment, after obtaining the reference coordinates of the element to be operated on the target software operation interface, under the reference coordinates, performing corresponding operation on the target software according to the action in the test case, and obtaining an operation result, and then obtaining an execution result according to the operation result, where the operation result is a feedback result of the target software, and the execution result is whether the operation result meets expectations or not.
Specifically, the operation of the mouse can be simulated through a pywinuto library in python, so that the mouse is controlled to move to a reference coordinate, then the operation of the target software is simulated by using the pywinuto library according to the action, after the target software feeds back the operation result according to the operation, the operation result can be subjected to the assertion operation, and whether the operation result accords with the expectation or not is judged.
For example, after the account input box is located, the mouse is controlled to move to the coordinate where the account input box is located through the pywinuto library, then the action of reading the test case is keyboard input, the input content is 123456, then the input content is 123456 through the pywinuto library, finally the input box is subjected to assertion operation, namely whether the content in the input box is 123456 or not is judged, if yes, the operation result is in accordance with expectations, and if not, the operation result is in accordance with expectations.
It should be noted that, when executing step S102, multiple test cases may be read in parallel and operated on the target software in a multithreading manner, or a loop may be set, and each test case may be sequentially read and operated on the target software.
Step S103, obtaining a test report of the target software according to the execution result of each test case
The execution results of the test cases reflect whether the test cases pass the test, so that the execution results of the test cases are aggregated to obtain a test report, and the condition of target software can be well reflected.
In an embodiment of the present application, the test report may be generated by using alure software, and the test report may include the number of execution cases, the number of success cases, the number of failure cases, the execution result screenshot, the error description, and the pie chart and the bar chart for analyzing the data of the execution cases.
In some embodiments, after the test report of the target software is obtained according to the execution result of each test case in step S103, the method further includes sending the test report to a preset object in a preset manner. The preset mode can be sending through mails, nails, enterprise WeChat and other communication software, and the preset object can be related personnel of the test.
In some embodiments, step S103 further includes obtaining a third picture after the operation is performed on the target software according to the test case and the first picture to obtain an operation result, where the third picture is used to characterize the operation result, and storing the third picture to a preset address.
Specifically, after the target software is operated and an operation result is obtained, the operation result can be subjected to screenshot to obtain a third picture, after the third picture is obtained, the third picture is stored to a preset address, and the preset address can be a local disk or a cloud server.
For better illustrating the automated test scenario provided in the present application, by way of example and not limitation, the scenario is described below in conjunction with an actual application scenario, and fig. 3 is a schematic flow chart of an automated test performed in the present application, as shown in fig. 3, and the scenario includes the following steps:
step S301, writing test cases.
Firstly, a tester designs related test cases according to a software requirement document, a development document or a specific software use environment, and stores the designed test cases in a test file in sequence.
And aiming at each test case, capturing the element to be tested on the software operation interface to obtain a picture comprising the element to be operated, storing the picture of the element to be operated in a certain folder in a local disk, and adding the address of the picture storage of the element to be operated in the test case.
For example, a certain test case is used for testing a login function, and an account number is required to be input, a password is required to be input, and a login button is required to be clicked, so that the account number input box, the password input box and the login button are required to be captured and stored, and then the storage addresses of the three pictures are added to the test case. Correspondingly, the test case also comprises three steps of respectively inputting an account number, inputting a password and clicking to log in.
Step S302, starting target software.
The testing framework pytest of python can be used for automatically starting target software, specifically, a tester changes a framework configuration file of pytest, the changed content comprises a target software name and a target software installation position, then an inlet file main.py of pytest is called, and the inlet file main.py starts the target software by identifying the target software name and the target software installation position in the framework configuration file.
Step S303, reading the test file.
And reading the test cases in the test file according to the sequence and executing.
Step S304, searching the picture of the element to be operated.
And searching the picture of the element to be operated according to the picture address in the test case.
Step S305, screenshot is performed on target software.
And in the running process of the target software, performing screenshot operation on the target software operation interface to obtain a picture comprising the target software operation interface.
Step S306, positioning the position of the element to be operated.
And obtaining the position of the element to be operated on the operation interface of the target software through an image matching technology.
For example, if a certain test case includes inputting an account in an account input box, obtaining the position of the account input box on an operation interface of the target software through a picture matching technology. The positioning method is referred to above, and will not be described herein.
Step S307, a corresponding operation is performed.
After the position of the element to be operated is positioned, corresponding operation is performed on the target software through simulating keyboard and/or mouse operation.
For example, a certain test case includes inputting an account in an account input box, and after the position of the input box on the operation interface is located, inputting corresponding content in the account input box through a keyboard operation library.
Step S308, operation result screenshot.
And capturing the operation result and storing the operation result in a certain folder in the local disk.
Step S309, operation result assertion.
And carrying out assertion operation on the operation result to obtain an execution result, for example, the input content in the test case is 123456, after the operation is carried out on the target software, judging whether the input content in the account input box is 123456 or not by using assertion, if so, executing the test case according with expectations, and if not, executing the test case not according with expectations.
Step S310, judging whether the execution of the test cases in the test file is completed.
Judging whether all the test cases in the test file are executed, if so, turning to step S303 to read the next test case, otherwise turning to step S311.
Step S311, generating a test report.
By using alure software to generate a test report, the test report may include the number of execution cases, the number of success cases, the number of failure cases, execution result screenshots, error specification, and pie charts and bar charts that analyze the data of the execution cases.
Step S312, a test report is sent.
And sending the information to appointed personnel through mails, nails, enterprise WeChat and other communication software.
According to the method and the device for testing the object software, the test files are obtained, each test case in the test files is read, each test case comprises the second picture address and the action, the position of the element represented by the second picture on the first picture is located through the image matching technology, the position of the element on the operation interface is further obtained, and then the keyboard and the mouse operation library are called to operate the object software, so that testing is completed. Compared with the traditional element identification mode in the automatic test, the method and the device have the advantages that the position of the element on the operation interface can be accurately positioned, in addition, the scheme does not depend on the code of the software to be tested, the decoupling of the automatic test script and the code of the software to be tested is realized, and when the automatic test is carried out, a tester only needs to write the test case, does not need to write a complex code, and is very friendly to the tester. The method also generates the test report by aggregating the execution results of each test case, gathers the automatic test results, and provides a foundation for the development and maintenance of target software.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean the sequence of execution sequence, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Corresponding to the automated testing method described in the above embodiments, fig. 4 shows a block diagram of the automated testing apparatus provided in the embodiment of the present application, and for convenience of explanation, only the portions relevant to the embodiment of the present application are shown.
Referring to fig. 4, the apparatus includes:
the acquisition file unit 41: the method comprises the steps of acquiring a test file, wherein the test file comprises at least one test case;
test unit 42: the method comprises the steps that for each test case, target software is operated according to the test case and a first picture, an operation result is obtained, an execution result of the test case is obtained according to the operation result, and the first picture is a picture comprising an operation interface of the target software;
the result acquisition unit 43: and the method is used for obtaining a test report of the target software according to the execution result of each test case.
In some possible implementations, the test case includes address information and actions of the second picture, and the test unit 42 is specifically configured to
According to the test case and the first picture, operating the target software to obtain an operation result comprises the following steps:
reading a second picture according to the second picture address information, wherein the second picture is used for representing elements to be operated in an operation interface of the target software;
determining a reference coordinate according to the first picture and the second picture, wherein the reference coordinate is the position of an element to be operated on an operation interface of target software;
and operating the target software according to the reference coordinates and the actions to obtain an operation result.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be found in the method embodiment section, and will not be described herein again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic apparatus 5 of this embodiment includes: at least one processor 50 (only one shown in fig. 5), a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, the processor 50 implementing the steps in any of the various automated test method embodiments described above when executing the computer program 52.
The electronic device 5 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The electronic device may include, but is not limited to, a processor 50, a memory 51. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the electronic device 5 and is not meant to be limiting of the electronic device 5, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 50 may be a central processing unit (Central Processing Unit, CPU), the processor 50 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may in some embodiments be an internal storage unit of the electronic device 5, such as a hard disk or a memory of the electronic device 5. The memory 51 may in other embodiments also be an external storage device of the electronic device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the electronic device 5. The memory 51 is used for storing an operating system, application programs, boot loader (BootLoader), data, other programs, etc., such as program codes of the computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps that may implement the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that may be performed in the various method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. An automated testing method, the method comprising:
obtaining a test file, wherein the test file comprises at least one test case;
aiming at each test case, operating the target software according to the test case and a first picture to obtain an operation result, and obtaining an execution result of the test case according to the operation result, wherein the first picture is a picture comprising an operation interface of the target software;
and obtaining a test report of the target software according to the execution result of each test case.
2. The method of claim 1, wherein the test case includes address information and actions of the second picture.
3. The method according to claim 2, wherein the operating the target software according to the test case and the first picture to obtain an operation result includes:
reading a second picture according to the address information of the second picture, wherein the second picture is used for representing elements to be operated in an operation interface of the target software;
determining reference coordinates according to the first picture and the second picture, wherein the reference coordinates are positions of the elements to be operated on an operation interface of the target software;
and operating the target software according to the reference coordinates and the action to obtain the operation result.
4. A method according to claim 3, wherein said operating said target software based on said reference coordinates and said actions comprises:
and after the mouse is controlled to move to the reference coordinates, executing the operation corresponding to the action on the target software by using a mouse and/or a keyboard operation library.
5. The method of claim 1, wherein prior to the obtaining the test file, further comprising:
and starting the target software according to a configuration file, wherein the configuration file comprises the name of the target software and the installation position of the target software.
6. The method of claim 1, wherein the operating the target software according to the test case and the first picture to obtain an operation result, and obtaining an execution result of the test case according to the operation result, comprises:
according to the test case and the first picture, operating the target software to obtain an operation result;
acquiring a third picture, wherein the third picture is used for representing the operation result;
storing the third picture to a preset address;
and executing the assertion operation on the operation result to obtain the execution result of the test case.
7. The method according to any one of claims 1 to 6, wherein after obtaining the test report of the target software according to the execution result of each test case, the method further comprises:
and sending the test report to a preset object in a preset mode.
8. An automated test equipment, comprising:
reading a file unit: the method comprises the steps of obtaining a test file, wherein the test file comprises at least one test case;
test unit: the method comprises the steps that for each test case, the target software is operated according to the test case and a first picture, an operation result is obtained, an execution result of the test case is obtained according to the operation result, and the first picture is a picture comprising an operation interface of the target software;
a result acquisition unit: and the test report of the target software is obtained according to the execution results of each test case.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 7.
CN202211613702.8A 2022-12-15 2022-12-15 Automatic test method, device, electronic equipment and readable storage medium Pending CN116302925A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211613702.8A CN116302925A (en) 2022-12-15 2022-12-15 Automatic test method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211613702.8A CN116302925A (en) 2022-12-15 2022-12-15 Automatic test method, device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116302925A true CN116302925A (en) 2023-06-23

Family

ID=86796621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211613702.8A Pending CN116302925A (en) 2022-12-15 2022-12-15 Automatic test method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116302925A (en)

Similar Documents

Publication Publication Date Title
CN109828903B (en) Automatic testing method and device, computer device and storage medium
CN108073519B (en) Test case generation method and device
CN107783898B (en) Test method and test equipment for mobile application
CN108984389B (en) Application program testing method and terminal equipment
CN109783346B (en) Keyword-driven automatic testing method and device and terminal equipment
CN110826646A (en) Robot vision testing method and device, storage medium and terminal equipment
CN114546738A (en) Server general test method, system, terminal and storage medium
CN111309505B (en) Page exception handling method and device and electronic equipment
CN109840212B (en) Function test method, device and equipment of application program and readable storage medium
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN116719736A (en) Test case generation method and device for testing software interface
CN116738091A (en) Page monitoring method and device, electronic equipment and storage medium
CN111127223A (en) Insurance product testing method and device and storage medium
CN116302925A (en) Automatic test method, device, electronic equipment and readable storage medium
CN115309661A (en) Application testing method and device, electronic equipment and readable storage medium
US11698849B2 (en) Automated application testing of mutable interfaces
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
CN113868137A (en) Method, device and system for processing buried point data and server
CN112966671A (en) Contract detection method and device, electronic equipment and storage medium
CN115129575A (en) Code coverage result generation method and device
CN114443375A (en) Test method and device, electronic device and computer readable storage medium
CN110827261A (en) Image quality detection method and device, storage medium and electronic equipment
CN114969759B (en) Asset security assessment method, device, terminal and medium of industrial robot system
CN117555813B (en) Method, device, equipment and medium for determining common test case
CN116434043A (en) Image processing method, device, equipment and storage medium

Legal Events

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