CN111813659A - UI and interface based automatic test method, device, equipment and readable medium - Google Patents

UI and interface based automatic test method, device, equipment and readable medium Download PDF

Info

Publication number
CN111813659A
CN111813659A CN202010526714.1A CN202010526714A CN111813659A CN 111813659 A CN111813659 A CN 111813659A CN 202010526714 A CN202010526714 A CN 202010526714A CN 111813659 A CN111813659 A CN 111813659A
Authority
CN
China
Prior art keywords
tested
interface
delivery
test
testing
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
CN202010526714.1A
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.)
Sichuan Hongmei Intelligent Technology Co Ltd
Original Assignee
Sichuan Hongmei Intelligent 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 Sichuan Hongmei Intelligent Technology Co Ltd filed Critical Sichuan Hongmei Intelligent Technology Co Ltd
Priority to CN202010526714.1A priority Critical patent/CN111813659A/en
Publication of CN111813659A publication Critical patent/CN111813659A/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
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a device, equipment and a readable medium for automatic testing based on a UI and an interface, wherein the method comprises the following steps: acquiring a plurality of source code versions to be compiled and corresponding identification information; creating a construction task and configuring configuration information of the construction task; acquiring a construction command; determining target identification information corresponding to the construction command according to the construction command; determining a target source code version corresponding to the target identification information according to the target identification information; compiling and constructing a target source code version to obtain a to-be-tested delivery object; receiving a first delivery object to be tested according to the configuration information, and carrying out UI automatic test on the first delivery object to be tested; and receiving a second delivery object to be tested according to the configuration information, and carrying out interface automatic test on the second delivery object to be tested. The scheme of the invention can save human and material resources and avoid human errors generated in the manual test process.

Description

UI and interface based automatic test method, device, equipment and readable medium
Technical Field
The invention relates to the technical field of automated testing, in particular to an automated testing method, device, equipment and readable medium based on a UI and an interface.
Background
With the continuous growth of companies, more and more service lines and products are provided, the traditional manual testing method cannot meet the existing testing requirements, and the automatic testing of functions related to a product UI and an interface is more advantageous.
Compared with automatic tests of the UI and the interface, the UI Package generally comprises an APK (Android Package) and an IPA (iPhone Application, Apple program Application file), the functions of the UI Package are generally tested by manual clicking, and BUG (BUG problem detected in version) found in the testing process is manually recorded; the interface test usually adopts a postman (manual interface debugging tool) online interface test tool, manually sends simulation data to perform the interface test, and manually records the test result.
Therefore, in the whole testing process, the key functions of the test need to be determined manually, so that the influence of human factors is great, especially for the novice with insufficient experience, the testing range is often difficult to be determined accurately, and thus, the method is tedious, wastes manpower and material resources, and is easy to make mistakes.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a readable medium for automatic testing based on a UI and an interface, which can save human and material resources and avoid human errors generated in a manual testing process.
In a first aspect, an embodiment of the present invention provides an automated testing method based on a UI and an interface, including:
acquiring a plurality of source code versions to be compiled and identification information corresponding to each source code version in the plurality of source code versions;
storing the source code versions;
creating a construction task and configuring configuration information of the construction task;
acquiring a construction command;
determining target identification information corresponding to the construction command according to the construction command;
determining a target source code version corresponding to the target identification information according to the target identification information;
compiling and constructing the target source code version to obtain a to-be-tested delivery object, wherein the to-be-tested delivery object comprises a first to-be-tested delivery object and a second to-be-tested delivery object;
receiving the first delivery to be tested according to the configuration information, and carrying out UI automatic test on the first delivery to be tested to obtain a first test result;
and receiving the second delivery object to be tested according to the configuration information, and carrying out interface automatic test on the second delivery object to be tested to obtain a second test result.
In one possible design, after the compiling and building the target source code version to obtain the delivery to be tested and before receiving the first delivery to be tested according to the configuration information and performing the UI automation test on the first delivery to be tested to obtain the first test result, the method includes:
storing the to-be-tested deliverables;
and the database for storing the source code versions is the same as the database for storing the delivery to be tested.
In one possible design, the compiling and constructing the target source code version to obtain the deliverable to be tested includes:
compiling and constructing the target source code version by adopting a Jenkins server to obtain a to-be-tested delivery object;
the receiving the first delivery to be tested according to the configuration information, and performing UI automatic test on the first delivery to be tested to obtain a first test result, including:
carrying out UI automatic test on the first to-be-tested delivery by adopting an Airtest frame;
the receiving the second delivery to be tested according to the configuration information, and performing an interface automated test on the second delivery to be tested to obtain a second test result, including:
performing interface automatic test on the second to-be-tested deliverable by adopting a Robot Framework test Framework;
the database includes a git library.
In one possible design, the configuration information includes: the IP address and the port number of a host machine with a UI and an interface test framework, the information of the UI and the interface to be tested, and the execution time of the construction task;
the receiving the first delivery to be tested according to the configuration information, and performing UI automatic test on the first delivery to be tested to obtain a first test result, including:
receiving the first delivery to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, operating the construction task to trigger an analysis engine of a UI test frame, so that the analysis engine calls a UI test class and analyzes a UI test case to obtain a first test result;
the receiving the second delivery to be tested according to the configuration information, and performing an interface automated test on the second delivery to be tested to obtain a second test result, including:
and receiving the second deliverable to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, operating the construction task to trigger an analysis engine of an interface test framework, so that the analysis engine calls an interface test class and analyzes an interface test case to obtain a second test result.
In one possible design, the configuration information includes: the mailbox addresses of developers and testers;
receiving the first delivery to be tested according to the configuration information, carrying out UI automatic test on the first delivery to be tested, obtaining a first test result,
and/or the presence of a gas in the gas,
after receiving the second delivery object to be tested according to the configuration information and carrying out interface automatic test on the second delivery object to be tested to obtain a second test result,
the method comprises the following steps: and sending the first test result and the second test result to the mailbox address in a mail form according to the mailbox address in the configuration information.
In a second aspect, an embodiment of the present invention provides an automated testing apparatus based on a UI and an interface, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a plurality of source code versions to be compiled and identification information corresponding to each of the plurality of source code versions;
the database is used for storing the source code versions;
the system comprises a creating module, a configuration module and a processing module, wherein the creating module is used for creating a construction task and configuring configuration information of the construction task;
the second acquisition module is used for acquiring the construction command;
the first determining module is used for determining target identification information corresponding to the construction command according to the construction command;
the second determining module is used for determining a target source code version corresponding to the target identification information according to the target identification information;
the compiling and constructing module is used for compiling and constructing the target source code version to obtain a to-be-tested deliverable, wherein the to-be-tested deliverable comprises a first to-be-tested deliverable and a second to-be-tested deliverable;
the first testing module is used for receiving the first delivery object to be tested according to the configuration information and carrying out UI automatic testing on the first delivery object to be tested to obtain a first testing result;
and the second testing module is used for receiving the second delivery object to be tested according to the configuration information, and performing interface automatic testing on the second delivery object to be tested to obtain a second testing result.
In one possible design, the database is further configured to store the deliverables to be tested.
In one possible design, the configuration information includes: the IP address and the port number of a host machine with a UI and an interface test framework, the information of the UI and the interface to be tested, and the execution time of the construction task;
the first testing module is further configured to receive the first delivery to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, the construction task is run to trigger an analysis engine of a UI testing framework, so that the analysis engine calls a UI testing class and analyzes a UI testing case to obtain a first testing result;
the second testing module is further configured to receive the second deliverable to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, the construction task is run to trigger an analysis engine of an interface testing framework, so that the analysis engine calls an interface testing class and analyzes an interface testing case to obtain a second testing result.
In a third aspect, an embodiment of the present invention provides an intelligent electronic device, including: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine-readable program to perform the method described above.
In a fourth aspect, the present invention provides a computer readable medium, on which computer instructions are stored, and when executed by a processor, the computer instructions cause the processor to execute the method described above.
According to the scheme, the UI-and-interface-based automatic testing method provided by the embodiment of the invention stores and calls the plurality of source code versions, simultaneously realizes the UI automatic testing for testing the first delivery object to be tested and the interface automatic testing for testing the second delivery object to be tested, and does not need to test and record in a manual clicking and manual recording manner, so that manpower and material resources can be saved for a company, and meanwhile, the manual error generated in the manual testing process can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is an exemplary system architecture diagram in which the present invention may be applied;
FIG. 2 is a flow diagram of a UI-based and interface-based automated testing method provided by an embodiment of the invention;
FIG. 3 is a flow diagram of a UI-based and interface-based automated testing method provided by another embodiment of the invention;
FIG. 4 is a schematic diagram of a device for automated testing based on UI and interface according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a UI-based and interface-based automated testing apparatus provided by an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
Fig. 1 illustrates an exemplary system architecture to which embodiments of the UI and interface-based automated testing methods or UI and interface-based automated testing apparatus of the present application may be applied.
As shown in fig. 1, the system architecture may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for shopping-like websites browsed by the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the product information query request, and feed back a processing result (for example, target push information and product information — only an example) to the terminal device.
It should be noted that the UI-based and interface-based automated testing method provided by the embodiment of the present invention is generally executed by the server 105, and accordingly, the UI-based and interface-based automated testing apparatus is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
FIG. 2 is a flow chart of a UI-based and interface-based automated testing method provided by an embodiment of the invention. As shown in fig. 2, the UI-based and interface-based automated testing method may include the steps of:
step 201, obtaining a plurality of source code versions to be compiled and identification information corresponding to each source code version in the plurality of source code versions;
step 202, storing the plurality of source code versions;
step 203, creating a construction task and configuring configuration information of the construction task;
step 204, obtaining a construction command;
step 205, determining target identification information corresponding to the construction command according to the construction command;
step 206, determining a target source code version corresponding to the target identification information according to the target identification information;
step 207, compiling and constructing the target source code version to obtain a to-be-tested delivery object, wherein the to-be-tested delivery object comprises a first to-be-tested delivery object and a second to-be-tested delivery object;
step 208, receiving the first delivery to be tested according to the configuration information, and performing UI (user interface) automatic test on the first delivery to be tested to obtain a first test result;
and 209, receiving the second delivery object to be tested according to the configuration information, and performing interface automated testing on the second delivery object to be tested to obtain a second test result.
In the embodiment of the invention, the UI automatic test for testing the first delivery object to be tested and the interface automatic test for testing the second delivery object to be tested are realized simultaneously by storing and calling the plurality of source code versions, and the test and the record are not required to be carried out in the modes of manual clicking and manual recording, so that the manpower and material resources can be saved for a company, and meanwhile, the human errors generated in the manual test process can be avoided.
Based on the UI-based and interface-based automated testing method shown in fig. 2, in an embodiment of the present invention, after step 207 and before step 208, the method includes:
storing the to-be-tested deliverables;
and the database for storing the source code versions is the same as the database for storing the delivery to be tested.
In the embodiment of the invention, a plurality of source code versions and the deliverable to be tested are stored by utilizing the same database, so that the unified management and Control of a company are facilitated, meanwhile, the UI and the interface automatic test of the deliverable to be tested are increased, the extension of Quality management from QC (Quality Control) of research and development results to QA (Quality Assurance) of research and development processes is realized, a company-level unified continuous integrated delivery and automatic test system is established, the research and development efficiency is improved, and the seamless connection of research and development, test and online manufacturing is facilitated.
Based on the UI and interface-based automated testing method shown in fig. 2, in an embodiment of the present invention, the compiling and constructing the target source code version to obtain the to-be-tested deliverable includes:
compiling and constructing the target source code version by adopting a Jenkins server to obtain a to-be-tested delivery object;
the receiving the first delivery to be tested according to the configuration information, and performing UI automatic test on the first delivery to be tested to obtain a first test result, including:
carrying out UI automatic test on the first to-be-tested delivery by adopting an Airtest frame;
the receiving the second delivery to be tested according to the configuration information, and performing an interface automated test on the second delivery to be tested to obtain a second test result, including:
performing interface automatic test on the second to-be-tested deliverable by adopting a Robot Framework test Framework;
the database includes a git library.
In the embodiment of the invention, by using an Airtest testing frame (a cross-platform UI automatic testing frame which is suitable for games and apps) and a Robot Framework testing frame (an extensible keyword drive automatic testing frame based on Python) as a UI and interface automatic testing tool, parameter information can be sent to an interface, a testing result returned by the interface is obtained, the returned result is compared and verified, and the testing result is automatically stored; and the test times can be set for a certain functional interface, and the stability and reliability of the functional interface are verified.
Based on the UI-based and interface-based automated testing method shown in fig. 2, in an embodiment of the present invention, the configuration information includes: the IP address and the port number of a host machine with a UI and an interface test framework, the information of the UI and the interface to be tested, and the execution time of the construction task;
the receiving the first delivery to be tested according to the configuration information, and performing UI automatic test on the first delivery to be tested to obtain a first test result, including:
receiving the first delivery to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, operating the construction task to trigger an analysis engine of a UI test frame, so that the analysis engine calls a UI test class and analyzes a UI test case to obtain a first test result;
the receiving the second delivery to be tested according to the configuration information, and performing an interface automated test on the second delivery to be tested to obtain a second test result, including:
and receiving the second deliverable to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, operating the construction task to trigger an analysis engine of an interface test framework, so that the analysis engine calls an interface test class and analyzes an interface test case to obtain a second test result.
In the embodiment of the invention, the first test result and the second test result which are actually obtained can be returned by a String type method, the expected first test result and the expected second test result are compared with the first test result and the second test result which are actually obtained, and whether the obtained first test result and the second test result are in accordance with expectation is verified. Specifically, after the UI test case and the interface test case are executed, comparing whether an expected result is consistent with a test result or not on a result page of a UI and interface test frame, and if not, recording a piece of failure data; if so, a successful piece of data is recorded. Accordingly, the test results can also be fed back to the result page of the persistent integration tool (i.e., Jenkins server).
Based on the UI-based and interface-based automated testing method shown in fig. 2, in an embodiment of the present invention, the configuration information includes: the mailbox addresses of developers and testers;
receiving the first delivery to be tested according to the configuration information, carrying out UI automatic test on the first delivery to be tested, obtaining a first test result,
and/or the presence of a gas in the gas,
after receiving the second delivery object to be tested according to the configuration information and carrying out interface automatic test on the second delivery object to be tested to obtain a second test result,
the method comprises the following steps: and sending the first test result and the second test result to the mailbox address in a mail form according to the mailbox address in the configuration information.
In the embodiment of the invention, a continuous integration tool (such as a Jenkins server) sends a corresponding test result to mailbox addresses of developers and testers of the to-be-tested deliveries by mails according to configuration information, so that the Jenkins can be used for automatically executing UI and interface automation programs, the execution conditions of the UI and the interface are monitored every day, and if the UI and the interface do not pass the automatic test, the mails can be sent out to remind the corresponding personnel.
As shown in fig. 3, another embodiment of the present invention further provides an automated testing method based on UI and interface. The method comprises the following steps:
step 301, obtaining a plurality of source code versions to be compiled and identification information corresponding to each of the plurality of source code versions.
In this embodiment, when a new project is accessed to a service line, a developer needs to clone a project area created by a configuration manager to the local for development in advance, and after the development is completed, a project source code to be compiled is submitted to a database.
And step 302, storing the plurality of source code versions.
In this embodiment, several source code versions are stored, for example, using a git database. The git library is used as a unified version control tool of a company, and all source code versions and to-be-tested deliverables in the project development process can be stored in the git library for unified management and control.
Step 303, creating a construction task, and configuring configuration information of the construction task.
In the embodiment, for example, the creating and building task is performed by using a persistent integration tool (such as Jenkins server), which is an open source software project and is a persistent integration tool developed based on Java, for monitoring persistent and repetitive work, and aims to provide an open and easy-to-use software platform, so that persistent integration of software becomes possible. When a new project is accessed to the service line, the service line needs to create a new construction task on a web page of Jenkins and configure configuration information of the construction task, so as to run the construction task according to the configuration information.
Wherein the configuration information may include: the IP address and the port number of the host with the UI and interface testing framework, the information of the tested UI and interface, and the execution time of the construction task. Optionally, the configuration information may further include: the file name and file type of the test results.
And step 304, acquiring a construction command.
In this embodiment, when a certain project requires a software configuration administrator to perform an automated test on a software version, the software configuration administrator needs to send a build command for a source code first.
And 305, determining target identification information corresponding to the construction command according to the construction command.
Step 306, determining a target source code version corresponding to the target identification information according to the target identification information.
In this embodiment, for example, target identification information to be constructed in the construction command may be determined by Jenkins, and further, a target source code version to be compiled and constructed may be determined.
And 307, compiling and constructing the target source code version to obtain a to-be-tested delivery object, wherein the to-be-tested delivery object comprises a first to-be-tested delivery object and a second to-be-tested delivery object.
In this embodiment, the first delivery to be tested may be, for example, an APK, IPA, etc. delivery, and the second delivery to be tested may be, for example, a jar package.
And 308, storing the to-be-tested deliverables.
In the embodiment, a same database (such as a git library) is used for storing a plurality of source code versions and the to-be-tested deliverables, so that the unified management and control of the company are facilitated.
Step 309, receiving the first delivery to be tested according to the configuration information, and performing a UI automation test on the first delivery to be tested to obtain a first test result.
In this embodiment, the Airtest framework may be used to perform a UI automation test on the first to-be-tested delivery. The Airtest framework provides a cross-platform API (Application Interface), including installation Application, simulation input, assertion and the like, and locates UI elements based on an image recognition technology, and can perform automatic testing without embedding any code in the testing. When a new service is accessed, a tester needs to compile an automatic test case based on UI element image recognition positioning in advance according to test requirements, and when a test project is developed, a first to-be-tested delivery object is detected from a database to perform UI automatic test. After the test case script runs, the automatic test result automatically generates a detailed HTML (hypertext markup language), test report, and after the automatic test is finished, the test report can be automatically sent to mailboxes of testers and developers, so that the testers and the developers can check the automatic test result.
And 310, receiving the second delivery object to be tested according to the configuration information, and performing interface automatic test on the second delivery object to be tested to obtain a second test result.
In this embodiment, the Robot Framework may be utilized to perform an interface automated test on the second deliverable to be tested. The Robot Framework test Framework is an automatic test Framework driven by extensible keywords based on Python, is mainly used for end-to-end interface test and drive development of related interface test, is suitable for testing distributed heterogeneous application programs, and relates to various technologies and interfaces in the test process. The interface test tool supports programming languages such as python (a programming language), java (a programming language) and the like.
When a new service is accessed, a tester needs to compile an automatic test case in advance according to a test requirement; the writing case is simple and convenient, can be written in txt, tsv (text markup language) or html and other formats, is separated from background codes, and is very suitable for interface test and interface test drive development. The test report and the log can be stored in html format, and are easy to read, when the test report is required to be sent to a project group member, the file in html format is directly sent without additional processing, unlike a fitnesse (a Wiki server, a Wiki refers to a hypertext system which supports community-oriented collaborative writing, and simultaneously comprises a group of auxiliary tools supporting the writing); the steps and the execution results of each step in the log are printed, so that log (log) in the code can be reduced. The test framework also supports command line operation, and is convenient for combination with a database for continuous integration.
And 311, sending the first test result and the second test result to the mailbox address in a mail form according to the mailbox address in the configuration information.
In this embodiment, the continuous integration tool (e.g., Jenkins server) sends the corresponding test result to the mailbox addresses of the developer and tester of the to-be-tested delivery object by mail according to the configuration information, so Jenkins can be used to automatically execute the UI and interface automation program, monitor the execution conditions of the UI and interface every day, and send a mail to remind the corresponding personnel if the automatic test of the UI and interface fails.
As shown in fig. 4 and 5, the embodiment of the present invention provides a device in which an automated testing apparatus based on UI and interface is located and an automated testing apparatus based on UI and interface. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. From a hardware level, as shown in fig. 4, a hardware structure diagram of a device based on a UI and an interface automation test apparatus provided in the embodiment of the present invention is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, the device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing a packet. Taking a software implementation as an example, as shown in fig. 5, as a logical apparatus, the apparatus is formed by reading a corresponding computer program instruction in a non-volatile memory into a memory by a CPU of a device in which the apparatus is located and running the computer program instruction.
As shown in fig. 5, the automatic testing apparatus based on UI and interface provided in this embodiment includes:
a first obtaining module 501, configured to obtain a plurality of source code versions to be compiled and identification information corresponding to each of the plurality of source code versions;
a database 502 for storing the plurality of source code versions;
a creating module 503, configured to create a construction task and configure configuration information of the construction task;
a second obtaining module 504, configured to obtain a build command;
a first determining module 505, configured to determine, according to the build command, target identification information corresponding to the build command;
a second determining module 506, configured to determine, according to the target identification information, a target source code version corresponding to the target identification information;
a compiling and constructing module 507, configured to compile and construct the target source code version to obtain a to-be-tested delivery object, where the to-be-tested delivery object includes a first to-be-tested delivery object and a second to-be-tested delivery object;
the first testing module 508 is configured to receive the first delivery to be tested according to the configuration information, and perform an UI automation test on the first delivery to be tested to obtain a first testing result;
the second testing module 509 is configured to receive the second delivery object to be tested according to the configuration information, and perform an interface automated test on the second delivery object to be tested to obtain a second testing result.
In an embodiment of the present invention, the first obtaining module 501 may be configured to perform step 201 in the foregoing method embodiment, the database 502 may be configured to perform step 202 in the foregoing method embodiment, the creating module 503 may be configured to perform step 203 in the foregoing method embodiment, the second obtaining module 504 may be configured to perform step 204 in the foregoing method embodiment, the first determining module 505 may be configured to perform step 205 in the foregoing method embodiment, the second determining module 506 may be configured to perform step 206 in the foregoing method embodiment, the compiling and constructing module 507 may be configured to perform step 207 in the foregoing method embodiment, the first testing module 508 may be configured to perform step 208 in the foregoing method embodiment, and the second testing module 509 may be configured to perform step 209 in the foregoing method embodiment.
In one embodiment of the present invention, the database 502 is further configured to store the deliverables to be tested.
In one embodiment of the present invention, the configuration information includes: the IP address and the port number of a host machine with a UI and an interface test framework, the information of the UI and the interface to be tested, and the execution time of the construction task;
the first testing module 508 is further configured to receive the first delivery to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, run the construction task to trigger an analysis engine of the UI testing framework, so that the analysis engine calls a UI testing class and analyzes a UI testing case to obtain a first testing result;
the second testing module 509 is further configured to receive the second deliverable to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, run the construction task to trigger an analysis engine of an interface testing framework, so that the analysis engine calls an interface testing class and analyzes an interface testing case to obtain a second testing result.
It is to be understood that the illustrated configuration of the embodiments of the present invention does not constitute a specific limitation on the UI-based and interface-based automated testing apparatus. In other embodiments of the present invention, the UI-based and interface-automated testing apparatus may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Because the content of information interaction, execution process, and the like among the modules in the device is based on the same concept as the method embodiment of the present invention, specific content can be referred to the description in the method embodiment of the present invention, and is not described herein again.
An embodiment of the present invention further provides an intelligent electronic device, including: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine readable program to execute the UI-and-interface-based automated testing method in any embodiment of the invention.
Embodiments of the present invention also provide a computer-readable medium storing instructions for causing a computer to perform a UI-and interface-based automated testing method as described herein. Specifically, a method or an apparatus equipped with a storage medium on which a software program code that realizes the functions of any of the above-described embodiments is stored may be provided, and a computer (or a CPU or MPU) of the method or the apparatus is caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments can be implemented not only by executing the program code read out by the computer, but also by performing a part or all of the actual operations by an operation method or the like operating on the computer based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
In summary, the automatic testing method, device, apparatus and readable medium based on UI and interface provided by the embodiments of the present invention at least have the following advantages:
1. in the embodiment of the invention, the UI automatic test for testing the first delivery object to be tested and the interface automatic test for testing the second delivery object to be tested are realized simultaneously by storing and calling the plurality of source code versions, and the test and the record are not required to be carried out in the modes of manual clicking and manual recording, so that the manpower and material resources can be saved for a company, and meanwhile, the human errors generated in the manual test process can be avoided.
2. In the embodiment of the invention, a plurality of source code versions and the deliverable to be tested are stored by utilizing the same database, so that the unified management and Control of a company are facilitated, meanwhile, the UI and the interface automatic test of the deliverable to be tested are increased, the extension of Quality management from QC (Quality Control) of research and development results to QA (Quality Assurance) of research and development processes is realized, a company-level unified continuous integrated delivery and automatic test system is established, the research and development efficiency is improved, and the seamless connection of research and development, test and online manufacturing is facilitated.
3. In the embodiment of the invention, by using an Airtest testing frame (a cross-platform UI automatic testing frame which is suitable for games and apps) and a Robot Framework testing frame (an extensible keyword drive automatic testing frame based on Python) as a UI and interface automatic testing tool, parameter information can be sent to an interface, a testing result returned by the interface is obtained, the returned result is compared and verified, and the testing result is automatically stored; and the test times can be set for a certain functional interface, and the stability and reliability of the functional interface are verified.
4. In the embodiment of the invention, the first test result and the second test result which are actually obtained can be returned by a String type method, the expected first test result and the expected second test result are compared with the first test result and the second test result which are actually obtained, and whether the obtained first test result and the second test result are in accordance with expectation is verified. Specifically, after the UI test case and the interface test case are executed, comparing whether an expected result is consistent with a test result or not on a result page of a UI and interface test frame, and if not, recording a piece of failure data; if so, a successful piece of data is recorded. Accordingly, the test results can also be fed back to the result page of the persistent integration tool (i.e., Jenkins server).
5. In the embodiment of the invention, the continuous integration tool (namely, Jenkins server) sends the corresponding test result to the mailbox addresses of the developer and the tester of the to-be-tested deliverable in a mail mode according to the configuration information, so that Jenkins can be used for automatically executing the UI and the interface automation program, the execution condition of the UI and the interface is monitored every day, and if the automatic test of the UI and the interface does not pass, a mail can be sent to remind the corresponding personnel.
It should be noted that not all steps and modules in the above flowcharts and method structure diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The method structures described in the above embodiments may be physical structures or logical structures, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
In the above embodiments, the hardware unit may be implemented mechanically or electrically. For example, a hardware element may comprise permanently dedicated circuitry or logic (such as a dedicated processor, FPGA or ASIC) to perform the corresponding operations. The hardware elements may also comprise programmable logic or circuitry, such as a general purpose processor or other programmable processor, that may be temporarily configured by software to perform the corresponding operations. The specific implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
While the invention has been shown and described in detail in the drawings and in the preferred embodiments, it is not intended to limit the invention to the embodiments disclosed, and it will be apparent to those skilled in the art that various combinations of the code auditing means in the various embodiments described above may be used to obtain further embodiments of the invention, which are also within the scope of the invention.

Claims (10)

1. The automatic test method based on the UI and the interface is characterized by comprising the following steps:
acquiring a plurality of source code versions to be compiled and identification information corresponding to each source code version in the plurality of source code versions;
storing the source code versions;
creating a construction task and configuring configuration information of the construction task;
acquiring a construction command;
determining target identification information corresponding to the construction command according to the construction command;
determining a target source code version corresponding to the target identification information according to the target identification information;
compiling and constructing the target source code version to obtain a to-be-tested delivery object, wherein the to-be-tested delivery object comprises a first to-be-tested delivery object and a second to-be-tested delivery object;
receiving the first delivery to be tested according to the configuration information, and carrying out UI automatic test on the first delivery to be tested to obtain a first test result;
and receiving the second delivery object to be tested according to the configuration information, and carrying out interface automatic test on the second delivery object to be tested to obtain a second test result.
2. The automated UI and interface-based testing method of claim 1, wherein after the compiling and building of the target source code version to obtain the delivery to be tested and before the receiving of the first delivery to be tested according to the configuration information and the UI automated testing of the first delivery to be tested to obtain the first testing result, the method comprises:
storing the to-be-tested deliverables;
and the database for storing the source code versions is the same as the database for storing the delivery to be tested.
3. The automated UI and interface-based testing method of claim 2, wherein the compiling the target source code version to obtain the deliverable to be tested comprises:
compiling and constructing the target source code version by adopting a Jenkins server to obtain a to-be-tested delivery object;
the receiving the first delivery to be tested according to the configuration information, and performing UI automatic test on the first delivery to be tested to obtain a first test result, including:
carrying out UI automatic test on the first to-be-tested delivery by adopting an Airtest frame;
the receiving the second delivery to be tested according to the configuration information, and performing an interface automated test on the second delivery to be tested to obtain a second test result, including:
performing interface automatic test on the second to-be-tested deliverable by adopting a Robot Framework test Framework;
the database includes a git library.
4. The UI and interface-based automated testing method of claim 1, wherein the configuration information comprises: the IP address and the port number of a host machine with a UI and an interface test framework, the information of the UI and the interface to be tested, and the execution time of the construction task;
the receiving the first delivery to be tested according to the configuration information, and performing UI automatic test on the first delivery to be tested to obtain a first test result, including:
receiving the first delivery to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, operating the construction task to trigger an analysis engine of a UI test frame, so that the analysis engine calls a UI test class and analyzes a UI test case to obtain a first test result;
the receiving the second delivery to be tested according to the configuration information, and performing an interface automated test on the second delivery to be tested to obtain a second test result, including:
and receiving the second deliverable to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, operating the construction task to trigger an analysis engine of an interface test framework, so that the analysis engine calls an interface test class and analyzes an interface test case to obtain a second test result.
5. The UI and interface-based automated testing method of any of claims 1-4, wherein the configuration information comprises: the mailbox addresses of developers and testers;
receiving the first delivery to be tested according to the configuration information, carrying out UI automatic test on the first delivery to be tested, obtaining a first test result,
and/or the presence of a gas in the gas,
after receiving the second delivery object to be tested according to the configuration information and carrying out interface automatic test on the second delivery object to be tested to obtain a second test result,
the method comprises the following steps: and sending the first test result and the second test result to the mailbox address in a mail form according to the mailbox address in the configuration information.
6. Based on UI and interface automation testing arrangement, its characterized in that includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a plurality of source code versions to be compiled and identification information corresponding to each of the plurality of source code versions;
the database is used for storing the source code versions;
the system comprises a creating module, a configuration module and a processing module, wherein the creating module is used for creating a construction task and configuring configuration information of the construction task;
the second acquisition module is used for acquiring the construction command;
the first determining module is used for determining target identification information corresponding to the construction command according to the construction command;
the second determining module is used for determining a target source code version corresponding to the target identification information according to the target identification information;
the compiling and constructing module is used for compiling and constructing the target source code version to obtain a to-be-tested deliverable, wherein the to-be-tested deliverable comprises a first to-be-tested deliverable and a second to-be-tested deliverable;
the first testing module is used for receiving the first delivery object to be tested according to the configuration information and carrying out UI automatic testing on the first delivery object to be tested to obtain a first testing result;
and the second testing module is used for receiving the second delivery object to be tested according to the configuration information, and performing interface automatic testing on the second delivery object to be tested to obtain a second testing result.
7. The UI and interface-based automated testing device of claim 6, wherein the database is further configured to store the deliverables to be tested.
8. The UI and interface-based automated testing apparatus of claim 6, wherein the configuration information comprises: the IP address and the port number of a host machine with a UI and an interface test framework, the information of the UI and the interface to be tested, and the execution time of the construction task;
the first testing module is further configured to receive the first delivery to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, the construction task is run to trigger an analysis engine of a UI testing framework, so that the analysis engine calls a UI testing class and analyzes a UI testing case to obtain a first testing result;
the second testing module is further configured to receive the second deliverable to be tested according to the configuration information of the construction task, and when the execution time of the construction task is reached, the construction task is run to trigger an analysis engine of an interface testing framework, so that the analysis engine calls an interface testing class and analyzes an interface testing case to obtain a second testing result.
9. Intelligent electronic device, its characterized in that includes: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor, configured to invoke the machine readable program, to perform the method of any of claims 1 to 5.
10. Computer readable medium, characterized in that it has stored thereon computer instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN202010526714.1A 2020-06-09 2020-06-09 UI and interface based automatic test method, device, equipment and readable medium Pending CN111813659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010526714.1A CN111813659A (en) 2020-06-09 2020-06-09 UI and interface based automatic test method, device, equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010526714.1A CN111813659A (en) 2020-06-09 2020-06-09 UI and interface based automatic test method, device, equipment and readable medium

Publications (1)

Publication Number Publication Date
CN111813659A true CN111813659A (en) 2020-10-23

Family

ID=72845732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010526714.1A Pending CN111813659A (en) 2020-06-09 2020-06-09 UI and interface based automatic test method, device, equipment and readable medium

Country Status (1)

Country Link
CN (1) CN111813659A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113806219A (en) * 2021-08-23 2021-12-17 北京达佳互联信息技术有限公司 Test result determination method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446878A (en) * 2015-11-09 2016-03-30 上海爱数信息技术股份有限公司 Continuous program automated testing method
CN108334449A (en) * 2018-01-26 2018-07-27 北京京东金融科技控股有限公司 A kind of method and apparatus of interface automatic test

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446878A (en) * 2015-11-09 2016-03-30 上海爱数信息技术股份有限公司 Continuous program automated testing method
CN108334449A (en) * 2018-01-26 2018-07-27 北京京东金融科技控股有限公司 A kind of method and apparatus of interface automatic test

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113806219A (en) * 2021-08-23 2021-12-17 北京达佳互联信息技术有限公司 Test result determination method and device, electronic equipment and storage medium
CN113806219B (en) * 2021-08-23 2024-06-11 北京达佳互联信息技术有限公司 Test result determining method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109614313A (en) Automated testing method, device and computer readable storage medium
CN110471831B (en) Automatic method and device for compatibility test
CN110825619A (en) Automatic generation method and device of interface test case and storage medium
US20090031170A1 (en) System and method to facilitate automatic globalization verification test
US20170228220A1 (en) Self-healing automated script-testing tool
CN110740071B (en) Method, device and system for monitoring network interface
US11449414B2 (en) Mapping test parameter data elements during heterogeneous component-based testing in a portable automation framework in both API mode and UI mode
CN113778898B (en) User interface automatic test method and device, electronic equipment and storage medium
WO2021097824A1 (en) Code quality and defect analysis method, server and storage medium
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN115658529A (en) Automatic testing method for user page and related equipment
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN112650670A (en) Application testing method, device, system, electronic equipment and storage medium
CN112115051A (en) Page traversal detection method, device and equipment for application and readable storage medium
CN104899134A (en) Automatic domain name registration server testing system and method
CN111813382A (en) Intangible asset management system and method
CN112231206A (en) Script editing method for application program test, computer readable storage medium and test platform
US11269712B1 (en) Customized categorial error handling framework for heterogeneous component-based testing in a portable automation framework
CN111930625B (en) Log acquisition method, device and system based on cloud service platform
CN112506772B (en) Web automatic test method, device, electronic equipment and storage medium
CN111813659A (en) UI and interface based automatic test method, device, equipment and readable medium
CN112148618B (en) Buried point testing method and buried point testing platform
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
US11734134B2 (en) Automatically locating resources using alternative locator expressions during heterogeneous component-based testing in a portable automation framework
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201023

RJ01 Rejection of invention patent application after publication