CN117851230A - Interface testing method, device, terminal equipment and storage medium - Google Patents

Interface testing method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN117851230A
CN117851230A CN202311665205.7A CN202311665205A CN117851230A CN 117851230 A CN117851230 A CN 117851230A CN 202311665205 A CN202311665205 A CN 202311665205A CN 117851230 A CN117851230 A CN 117851230A
Authority
CN
China
Prior art keywords
test
interface
tested
control instruction
round
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
CN202311665205.7A
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 Gongjin Electronics Co Ltd
Original Assignee
Shenzhen Gongjin Electronics 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 Gongjin Electronics Co Ltd filed Critical Shenzhen Gongjin Electronics Co Ltd
Priority to CN202311665205.7A priority Critical patent/CN117851230A/en
Publication of CN117851230A publication Critical patent/CN117851230A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • 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

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 application is applicable to the technical field of computer application, and provides an interface testing method, an interface testing device, terminal equipment and a storage medium, wherein the method comprises the following steps: obtaining a test case corresponding to an interface to be tested, wherein the test case comprises at least one test item; acquiring test configuration data corresponding to the test cases, and generating test configuration information; generating a circulation control instruction according to the test configuration information; and automatically testing the interface to be tested according to the circulation control instruction, wherein the automatic test comprises at least one round of test. Therefore, the method for automatically testing the interface to be tested by using the circulation control instruction is used for generating the circulation control instruction according to the relevant test configuration data corresponding to the interface to be tested, so that the test efficiency is improved, and the labor cost is saved.

Description

Interface testing method, device, terminal equipment and storage medium
Technical Field
The application belongs to the technical field of computer application, and particularly relates to an interface testing method, an interface testing device, terminal equipment and a computer readable storage medium.
Background
As the quality requirements on the network communication products become higher and higher, the test requirements on the interfaces of the products become stricter, and the test has changed from simple normal temperature index test, reliability mounting test and the like to long-term reliability test, namely, uninterrupted long-term test on various signal indexes of the interfaces.
In the related art, signal indexes of all interfaces are monitored by using a testing instrument, so that all interfaces are tested, but the testing instrument cannot realize long-term monitoring of the signal indexes of all interfaces, and the testing instrument needs to be operated repeatedly for a long time manually, so that the problems of low testing efficiency and waste of human resources are caused.
Disclosure of Invention
The invention aims to provide an interface testing method, an interface testing device, terminal equipment and a computer readable storage medium, which can solve the problems that in the related technology, a testing instrument cannot realize long-term monitoring test on signal indexes of each interface, and the testing instrument needs to be operated repeatedly for a long time manually, so that the testing efficiency is low and the human resources are wasted.
In a first aspect, an embodiment of the present application provides an interface testing method, including: obtaining a test case corresponding to an interface to be tested, wherein the test case comprises at least one test item; acquiring test configuration data corresponding to the test cases, and generating test configuration information; generating a circulation control instruction according to the test configuration information; and automatically testing the interface to be tested according to the circulation control instruction, wherein the automatic test comprises at least one round of test.
In a possible implementation manner of the first aspect, the obtaining test configuration data corresponding to the test case and generating test configuration information include:
acquiring each coordinate of each window corresponding to the test case;
acquiring single-round test time corresponding to the test case;
acquiring test case interval time corresponding to the test case;
acquiring a total testing duration corresponding to an interface to be tested;
determining the number of test cycles according to the single-round test time, the test case interval time and the total test duration;
and generating test configuration information according to the test cases, each coordinate, single-round test time, test case interval time and test cycle times.
Optionally, in another possible implementation manner of the first aspect, the loop control instruction includes a window switching instruction, a mouse control instruction, and a loop call instruction, and the automatically testing the interface to be tested according to the loop control instruction includes:
controlling each window to be switched according to the window switching instruction;
controlling mouse coordinates and mouse events according to the mouse control command;
and according to the cyclic call instruction, the cyclic call window switching instruction and the mouse control instruction, automatically testing the interface to be tested.
Optionally, in still another possible implementation manner of the first aspect, the automatically testing the interface to be tested according to the cycle control instruction includes:
performing a first round of test on the interface to be tested according to the circulation control instruction;
if the first round of test is abnormal, sending out a test abnormal prompt;
and if the first round of test is not abnormal, carrying out subsequent test on the interface to be tested according to the circulation control instruction.
Optionally, in still another possible implementation manner of the first aspect, the interface to be tested is a voice interface, and before the obtaining a test case corresponding to the interface to be tested, the method further includes:
and mutually dialing the interface to be tested and other voice interfaces, and judging whether the interface to be tested is successfully registered.
Optionally, in another possible implementation manner of the first aspect, each of the tests corresponds to a test number, and after the automatically testing the interface to be tested according to the cycle control instruction, the method further includes:
generating each initial test report of each test item corresponding to each round of test, wherein each initial test report is named according to the corresponding test item and the test number;
and automatically generating a test report of the interface to be tested according to each initial test report.
Optionally, in still another possible implementation manner of the first aspect, the automatically generating a test report of the interface to be tested according to each initial test report includes:
extracting test data and pictures corresponding to each test item and each test number from each initial test report;
inputting test data and pictures into corresponding preset tables according to each test item and each test number;
and comparing the test data and the pictures with preset standard data in a preset table, and automatically generating a test report of the interface to be tested.
In a second aspect, the present application further provides an interface testing apparatus, including: the first acquisition module is used for acquiring a test case corresponding to the interface to be tested, wherein the test case comprises at least one test item; the second acquisition module is used for acquiring the test configuration data corresponding to the test case and generating test configuration information; the first generation module is used for generating a circulation control instruction according to the test configuration information; and the test module is used for automatically testing the interface to be tested according to the circulation control instruction, wherein the automatic test comprises at least one round of test.
In a possible implementation manner of the second aspect, the second obtaining module includes:
The first acquisition unit is used for acquiring each coordinate of each window corresponding to the test case;
the second acquisition unit is used for acquiring single-round test time corresponding to the test case;
the third acquisition unit is used for acquiring the test case interval time corresponding to the test case;
a fourth obtaining unit, configured to obtain a total test duration corresponding to the interface to be tested;
the first determining unit is used for determining the test cycle times according to the single-round test time, the test case interval time and the total test duration;
the first generation unit is used for generating test configuration information according to the test cases, the coordinates, the single-round test time, the test case interval time and the test cycle times.
Optionally, in another possible implementation manner of the second aspect, the loop control instruction includes a window switching instruction, a mouse control instruction, and a loop call instruction; correspondingly, the test module comprises:
the first control unit is used for controlling each window to be switched according to the window switching instruction;
the second control unit is used for controlling the mouse coordinates and the mouse events according to the mouse control instruction;
the first test unit is used for automatically testing the interface to be tested according to the cyclic calling window switching instruction and the mouse control instruction.
Optionally, in a further possible implementation manner of the second aspect, the test module includes:
the second test unit is used for carrying out a first round of test on the interface to be tested according to the circulation control instruction;
the abnormality judging unit is used for sending out a test abnormality prompt if the first round of test is abnormal;
and the third test unit is used for carrying out subsequent test on the interface to be tested according to the circulation control instruction if no abnormality occurs in the first round of test.
Optionally, in a further possible implementation manner of the second aspect, the interface to be tested is a voice interface; correspondingly, the interface testing device further comprises:
and the judging module is used for mutually dialing the interface to be tested and other voice interfaces and judging whether the interface to be tested is successfully registered.
Optionally, in another possible implementation manner of the second aspect, each of the tests corresponds to a test number; correspondingly, the interface testing device further comprises:
the second generation module is used for generating each initial test report of each test item corresponding to each round of test, wherein each initial test report is named according to the corresponding test item and the test number;
and the third generation module is used for automatically generating a test report of the interface to be tested according to each initial test report.
Optionally, in a further possible implementation manner of the second aspect, the third generating module includes:
the extraction unit is used for extracting test data and pictures corresponding to each test item and each test number from each initial test report;
the input unit is used for inputting the test data and the pictures into the corresponding preset tables according to each test item and each test number;
the second generation unit is used for comparing the test data and the pictures with preset standard data in a preset table and automatically generating a test report of the interface to be tested.
In a third aspect, the present application further provides a terminal device. The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor, when executing the computer program, implements the method of any implementation manner of the first aspect.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium stores a computer program which when executed by a processor implements the method of any one of the implementations of the first aspect described above.
In a fifth aspect, the present application also provides a computer program product for causing an electronic device to perform the method of any one of the implementations of the first aspect described above when the computer program product is run on the electronic device.
Compared with the prior art, the embodiment of the application has the beneficial effects that: by generating the circulation control instruction according to the relevant test configuration data corresponding to the interface to be tested, the interface to be tested is automatically tested by utilizing the circulation control instruction, so that the test efficiency is improved, and the labor cost is saved.
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 flow chart of an interface testing method according to an embodiment of the present disclosure;
FIG. 2 is a topology of a test environment provided by an embodiment of the present application;
FIG. 3 is another test environment topology provided by an embodiment of the present application;
FIG. 4 is a flow chart of an interface testing method according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an interface testing device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal device provided in 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.
The interface test method, apparatus, terminal device, storage medium and computer program provided in the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 shows a flow chart of an interface testing method according to an embodiment of the present application.
As shown in fig. 1, the interface testing method includes the following steps:
step 101, obtaining a test case corresponding to the interface to be tested.
It should be noted that, the interface testing method of the embodiment of the present application may be executed by the interface testing apparatus of the embodiment of the present application. The interface testing device of the embodiment of the application can be configured in any terminal equipment to execute the interface testing method of the embodiment of the application.
Wherein the test case may include at least one test item.
As a possible implementation manner of the present application, the interface to be tested may be an interface to be automatically tested, may be an interface on a network communication product, such as an external exchange station (foreign exchange station, FXS) interface, etc., when the interface to be tested needs to be tested (for example, long-term weather reliability test, etc.), a test case corresponding to the interface to be tested may be obtained, or a test case number may also be obtained, so as to determine a test case corresponding to the interface to be tested, where the test case may include one or more test items, for example, when the interface to be tested is the FXS interface, the test case to be tested may include test items such as a change of a gain along with a frequency, a change of an interface relative level and a gain along with a level, and the automatic test may perform one or more repeated tests on the test case.
It should be noted that, the test items included in the interfaces to be tested and the test cases listed above are only exemplary, and the interfaces to be tested and the test cases can be determined according to actual requirements and specific application scenarios during actual use, which are not limited in this embodiment of the present application.
Further, when the interface to be tested is a voice interface, it is also required to determine whether the voice interface to be tested is successfully registered, so as to improve the reliability of the interface test. That is, in one possible implementation manner of the embodiment of the present application, the interface to be tested is a voice interface, and before the step 101, the method may further include:
and mutually dialing the interface to be tested and other voice interfaces, and judging whether the interface to be tested is successfully registered.
As a possible implementation manner, when the interface to be tested is a voice interface (such as FXS interface), if the product to be tested corresponding to the voice interface (the interface to be tested is one interface on the product to be tested) is a dual-voice interface, a test environment may be built according to fig. 2, two voice interfaces on the product to be tested (one of which is the interface to be tested) may be connected with a test instrument, the test instrument may be a TCA8200 instrument, etc., the product to be tested is connected with the test instrument through a network cable, if the product to be tested corresponding to the voice interface is a single-voice interface, a test environment may be built according to fig. 3, the product to be tested may be the same product as the product to be tested, and the voice interface on the product to be tested and the partner product may be connected with the test instrument, respectively, and the product to be tested may be connected with the partner product and the test instrument through the network cable. The two voice interfaces are used for dialing each other, if the call can be used for indicating that the registration of the interface to be tested is successful, the test can be performed, if the call can not be used for indicating that the interface to be tested is possibly not registered successfully, the registration software (such as OnDo SIP Server software) can be used for registering, and the test can be performed after the registration is successful.
Step 102, test configuration data corresponding to the test cases are obtained, and test configuration information is generated.
As a possible implementation manner, test configuration data corresponding to the test cases may be obtained, where the test configuration data may be time required for testing one round of test cases, interval time between each round of test cases, and the like, and test configuration information is generated according to the obtained test configuration data.
For example, assuming that the interface to be tested is an FXS interface, the acquired test configuration information needs 2 minutes for testing one round of test cases, and the interval time between each round of test cases is 10 seconds, the test configuration information may be generated: "interface to be tested: FXS interface, single-round test is often: 2 minutes, interval time: 10 seconds).
Further, in order to make the automated test more accurate, various test case related data may be acquired to generate more detailed test configuration information, thereby increasing the reliability of the interface test. That is, in one possible implementation manner of the embodiment of the present application, the step 102 may include:
acquiring each coordinate of each window corresponding to the test case;
acquiring single-round test time corresponding to the test case;
Acquiring test case interval time corresponding to the test case;
acquiring a total testing duration corresponding to an interface to be tested;
determining the circulation times according to the single-round test time, the test case interval time and the total test duration;
and generating test configuration information according to the test cases, each coordinate, single-round test time, test case interval time and test cycle times.
As a possible implementation manner, on the user interface, the test case may correspond to a plurality of windows, for example, each test item in the test case corresponds to one window, and coordinates of each window or a button in the window on the user interface may be obtained, and may be a distance relative to the entire display screen, for example, a distance above and left side of the display screen, a distance above and right side of the display screen, a distance below and left side of the display screen, or a distance below and right side of the display screen, etc.
As an example, assuming that coordinates of a window are generated according to distances of the window or buttons in the window relative to the upper side and the left side of the display screen, a distance between one window or window button corresponding to the test case and the upper side of the display screen is 50 pixels, and a distance between the window or window button and the left side of the display screen is 200 pixels, coordinates of the window can be obtained as (50 px,200 px).
As one possible implementation manner, the single-round test time corresponding to the test case can be obtained, namely, the time required by the test case to perform one-round test can be obtained, and the test case can be pre-tested for one round and timed to obtain the single-round test time.
As one possible implementation manner of the method, the device and the system, the test case interval time corresponding to the test case can be obtained according to the configuration of a user, namely, the time interval between the end of the test case test of the previous round and the start of the test case test of the next round is always.
As one possible implementation manner of the method, the total testing duration corresponding to the interface to be tested can be obtained, namely, the total duration of the interface to be tested which needs to be monitored, and multiple repeated tests can be carried out on the test cases corresponding to the interface to be tested within the total testing duration.
As a possible implementation manner, the test cycle number may be determined according to the single-round test time, the test case interval time and the test total time length, that is, the number of repeated tests performed on the test case in the test total time length, the quotient obtained by dividing the test total time length by the sum of the single-round test time and the test case interval time may be used as the test cycle number (that is, the test cycle number=the test total time length ≡ (single-round test time + test case interval time)), and if there is a remainder, the obtained quotient may be selected as the test cycle number after being added by one according to the requirement or directly used as the test cycle number.
For example, if the total test duration is 24 hours (1440 minutes), the single-round test time is 10 minutes, and the test case interval time is 30 seconds (0.5 minutes), the number of corresponding test cycles is 137 or 138 according to 1440/(10+0.5) being equal to 137 or more 1.5.
As one possible implementation manner, the test case and corresponding coordinates, single-round test time, test case interval time and test cycle number may be combined to generate test configuration information.
For example, assuming that the interface to be tested is an FXS interface, the test case includes test items including a change in gain along with frequency, a relative level of the interface, and a change in gain along with the level, coordinates of windows corresponding to the test items are (40 px,200 px), (45 px,200 px), and (50 px,205 px), and other test configuration data are the same as those of the example, and then test configuration information may be generated as "interface to be tested: FXS interface, test item: gain versus frequency, interface relative level, gain versus level, coordinates: (40 px,200 px), (45 px,200 px), (50 px,205 px), single round test time: 10 minutes, test case interval: 0.5 min, test cycle number: 137 times).
And step 103, generating a circulation control instruction according to the test configuration information.
As a possible implementation manner, a circulation control instruction may be generated according to test configuration information corresponding to an interface to be tested, for example, an instruction for switching a window corresponding to each test item in the circulation control instruction may be generated according to information such as a test item included in a test case, an instruction for controlling movement and clicking of a mouse in the circulation control instruction may be generated according to single-round test time, a test case interval, and the like, and a circulation call instruction in the circulation control instruction may be generated according to test cycle times and the like, for circularly calling a control window switching instruction and a control mouse movement instruction.
The above-listed methods for generating the cycle control instruction according to the cycle control instruction are merely exemplary, and in actual use, a specific cycle control instruction may be generated according to an actual requirement and a specific application scenario, which is not limited in the embodiment of the present application.
And 104, automatically testing the interface to be tested according to the circulation control instruction, wherein the automatic test comprises at least one round of test.
As a possible implementation manner, the automatic test of the interface to be tested can be realized by controlling events such as window switching, mouse movement, click triggering and the like through the circulation control instruction, the automatic test can comprise at least one round of test, and the automatic test can be specifically determined according to the test circulation times, namely the circulation control instruction can also control events such as window switching, mouse movement, click triggering and the like repeatedly according to the test circulation times, so that the test of at least one round of interface to be tested is realized.
Further, the loop control instruction includes a plurality of instructions. In one possible implementation manner of the embodiment of the present application, the loop control instruction includes a window switching instruction, a mouse control instruction, and a loop call instruction, and the step 104 may include:
controlling each window to be switched according to the window switching instruction;
controlling mouse coordinates and mouse events according to the mouse control instruction;
and circularly calling the window switching instruction and the mouse control instruction according to the circularly calling instruction, and performing the automatic test on the interface to be tested.
As a possible implementation manner, each window corresponding to the test case can be switched according to the window switching instruction, so that the window which needs to be operated by the mouse is always at the uppermost part of the user display interface. The coordinates of the mouse can be controlled according to the mouse control command, namely, the mouse is moved to the corresponding window position or the position of the button in the window according to each coordinate of each window, and the mouse control command can also control mouse events such as single click, double click events and the like, so that the mouse control command can control the mouse to move to the corresponding window or the position of the button of the window, and then click or double click and other mouse events are carried out on the corresponding position, thereby realizing one-time test of the test case. The loop call instruction can repeat the loop call window switching instruction and the mouse control instruction for a plurality of times, and the number of times of loop call can be preset in the loop call instruction according to the number of times of test loop, so that the automatic test of the interface to be tested is realized.
Furthermore, in order to further improve the reliability of the interface test, the test environment can be detected. That is, in one possible implementation manner of the embodiment of the present application, the step 104 may further include:
performing a first round of test on the interface to be tested according to the circulation control instruction;
if the first round of test is abnormal, sending out a test abnormal prompt;
and if the first round of test is not abnormal, carrying out subsequent test on the interface to be tested according to the circulation control instruction.
As a possible implementation manner, a first round of test can be performed on the interface to be tested according to the circulation control instruction, if a test abnormality occurs in the first round of test, such as an abnormality of a test environment, insufficient test configuration information or an error of the circulation control instruction, the test can be suspended, and a test abnormality prompt can be sent out, such as an abnormality warning frame can be popped up at a user interface, an abnormality warning sound prompt can be sent out, and the like, so as to prompt a user to process the abnormality. If the first round of test is not abnormal, the subsequent remaining test can be carried out on the interface to be tested according to the circulation control instruction until the number of test circulation times is reached, and if the abnormality occurs in the remaining test process, the test can not be suspended, and only the test result of the round is marked as failure.
According to the report testing method, the circulation control instruction is generated according to the relevant testing configuration data corresponding to the interface to be tested, the interface to be tested is automatically tested by the aid of the circulation control instruction, testing efficiency is improved, labor cost is saved, whether abnormal testing conditions exist or not can be detected in the automatic testing process, and testing reliability is improved.
In one possible implementation manner of the method, a large amount of test data or a large amount of test reports are generated after long-term monitoring test, so that the method also relates to the problem of sorting the large amount of test data or test reports, and in order to quickly sort the test data or test reports, save the cost of manual sorting, avoid the error of manually filling data, automatically sort the data or reports generated after the test, and automatically generate the final test result of the interface to be tested according to the large amount of data or reports, thereby further improving the efficiency and reliability of the interface test and further saving the labor cost.
The method for testing an interface provided in the embodiment of the present application is further described below with reference to fig. 4.
Fig. 4 is a flow chart illustrating another method for testing an interface according to an embodiment of the present application.
As shown in fig. 4, the interface testing method includes the following steps:
step 401, obtaining a test case corresponding to the interface to be tested.
Step 402, test configuration data corresponding to the test case is obtained, and test configuration information is generated.
Step 403, generating a loop control instruction according to the test configuration information.
Step 404, performing an automated test on the interface to be tested according to the cycle control instruction, wherein the automated test includes at least one round of test.
The specific implementation process and principle of the steps 401 to 404 may refer to the detailed description of the embodiments, which is not repeated here.
Step 405, generating each initial test report of each test item corresponding to each round of test.
Each round of test can correspond to one test number, the number corresponding to the current test can be used as the test number corresponding to the current test, and the test number can be increased along with the number of times of the test.
Each initial test report may be named according to the corresponding test item and test number.
As a possible implementation manner, an initial report saving path can be generated according to the configuration operation of a user on the report saving path, after each round of testing is carried out on an interface to be tested, an initial test report corresponding to the round of testing can be generated, each test item can be corresponding to one initial test report, the initial test report can be automatically stored according to the initial report saving path, and the initial test report can be automatically named according to the test number and the test item name corresponding to the round of testing.
As an example, the test items corresponding to the interface to be tested are the gain change with frequency, the interface relative level and the gain change with level, and assuming that the initial test report corresponding to the 5 th round of test is currently generated, the test number may be 5, and 3 initial test reports corresponding to the test items may be respectively named as "gain change with frequency (5) -test report", "interface relative level (5) -test report" and "gain change with level (5) -test report".
Step 406, automatically generating test reports of the interfaces to be tested according to the initial test reports.
As a possible implementation manner, the test data in each initial test report can be summarized, the summarized test data is analyzed to obtain the test result of the interface to be tested, the test result can comprise passing and failing, the test report can be generated according to the summarized test data and the test result, the initial test result corresponding to each initial test report can be generated, all the initial test results are summarized, the final test result of the interface to be tested is determined, and the test report is generated. The test report can be automatically stored in the test report storage path according to the test report storage path preconfigured by the user.
Furthermore, in order to make the analysis result more accurate, the test data in each initial test report can be classified and extracted according to rules and then analyzed, so that the reliability of the interface test is further improved. That is, in one possible implementation manner of the embodiment of the present application, the step 406 may include:
extracting test data and pictures corresponding to each test item and each test number from each initial test report;
inputting test data and pictures into corresponding preset tables according to each test item and each test number;
and comparing the test data and the pictures with preset standard data in a preset table, and automatically generating a test report of the interface to be tested.
As one possible implementation manner of the method, the test data and the pictures in the initial test report can be extracted, the pictures are placed in folders named according to the names and the test numbers of the test items, the folders are compressed to generate compressed picture files, the extracted test data and the compressed picture files can be input into a preset table according to the test items and the test numbers, the test data of different test items and the compressed picture files correspond to different pages in the preset table, the test data of the same test item and the compressed picture files can be input into the same page of the preset table and input according to the sequence of the test numbers, the generation time of each initial test report can be extracted (if the generation time is 12 hours, the generation time can be converted into 24 hours), and then the corresponding test data and the compressed picture files are input into the preset table according to the sequence of the generation time.
As a possible implementation manner of the application, the picture in the first initial test report corresponding to each test item may also be input into a preset position (e.g., above the compressed picture file) in the preset table, so as to facilitate the user to view.
As one possible implementation manner of the method, the test data and the compressed picture file can be compared with preset standard data in a preset table to obtain a test result (which can be passed or failed) of the interface to be tested, then the test result is displayed on a first page of the preset table and all the test data, a test report of the interface to be tested is generated, and the test report can comprise all the test data input in the preset table, the compressed picture file and the test result.
According to the interface test method, the circulation control instruction is generated according to the relevant test configuration data corresponding to the interface to be tested, the interface to be tested is automatically tested by utilizing the circulation control instruction, the test efficiency and the reliability are improved, the labor cost is saved, the initial test report corresponding to each round of test can be generated, the test data and the pictures in each initial test report are extracted and then are input into the preset table, the test report of the interface to be tested is automatically generated, the labor cost is further saved, errors possibly caused by manually processing the data are avoided, and the reliability of the interface test is further improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Corresponding to the interface testing method described in the above embodiments, fig. 5 shows a block diagram of the structure of the interface testing device provided in the embodiment of the present application, and for convenience of explanation, only the portion relevant to the embodiment of the present application is shown.
Referring to fig. 5, the apparatus 50 includes:
the first obtaining module 51 is configured to obtain a test case corresponding to the interface to be tested, where the test case includes at least one test item;
the second obtaining module 52 is configured to obtain test configuration data corresponding to the test case, and generate test configuration information;
a first generating module 53, configured to generate a cycle control instruction according to the test configuration information;
the test module 54 is configured to perform an automated test on the interface to be tested according to the cycle control instruction, where the automated test includes at least one round of test.
In practical use, the interface testing device provided in the embodiment of the present application may be configured in any terminal device to execute the foregoing interface testing method.
According to the interface testing device provided by the embodiment of the application, the circulation control instruction is generated according to the relevant test configuration data corresponding to the interface to be tested, and the interface to be tested is automatically tested by utilizing the circulation control instruction, so that the testing efficiency is improved, and the labor cost is saved.
In one possible implementation form of the present application, the second obtaining module 52 includes:
the first acquisition unit is used for acquiring each coordinate of each window corresponding to the test case;
the second acquisition unit is used for acquiring single-round test time corresponding to the test case;
the third acquisition unit is used for acquiring the test case interval time corresponding to the test case;
a fourth obtaining unit, configured to obtain a total test duration corresponding to the interface to be tested;
the first determining unit is used for determining the test cycle times according to the single-round test time, the test case interval time and the total test duration;
the first generation unit is used for generating test configuration information according to the test cases, the coordinates, the single-round test time, the test case interval time and the test cycle times.
Further, in another possible implementation form of the present application, the loop control instruction includes a window switching instruction, a mouse control instruction, and a loop call instruction; correspondingly, the test module comprises:
The first control unit is used for controlling each window to be switched according to the window switching instruction;
the second control unit is used for controlling the mouse coordinates and the mouse events according to the mouse control instruction;
the first test unit is used for automatically testing the interface to be tested according to the cyclic calling window switching instruction and the mouse control instruction.
In yet another possible implementation form of the present application, the test module 54 includes:
the second test unit is used for carrying out a first round of test on the interface to be tested according to the circulation control instruction;
the abnormality judging unit is used for sending out a test abnormality prompt if the first round of test is abnormal;
and the third test unit is used for carrying out subsequent test on the interface to be tested according to the circulation control instruction if no abnormality occurs in the first round of test.
Further, in still another possible implementation form of the present application, the interface to be tested is a voice interface; correspondingly, the interface testing device 50 further includes:
and the judging module is used for mutually dialing the interface to be tested and other voice interfaces and judging whether the interface to be tested is successfully registered.
Further, in another possible implementation form of the present application, each of the above-mentioned tests corresponds to a test number; correspondingly, the interface testing device 50 further includes:
The second generation module is used for generating each initial test report of each test item corresponding to each round of test, wherein each initial test report is named according to the corresponding test item and the test number;
and the third generation module is used for automatically generating a test report of the interface to be tested according to each initial test report.
Further, in still another possible implementation form of the present application, the third generating module includes:
the extraction unit is used for extracting test data and pictures corresponding to each test item and each test number from each initial test report;
the input unit is used for inputting the test data and the pictures into the corresponding preset tables according to each test item and each test number;
the second generation unit is used for comparing the test data and the pictures with preset standard data in a preset table and automatically generating a test report of the interface to be tested.
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 referred to in the method embodiment section, and will not be described herein again.
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.
In order to implement the above embodiment, the present application further proposes a terminal device.
Fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
As shown in fig. 6, the terminal apparatus 200 includes:
a memory 210 and at least one processor 220, a bus 230 connecting the different components (including the memory 210 and the processor 220), the memory 210 storing a computer program that when executed by the processor 220 implements the interface testing methods described in embodiments of the present application.
Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Terminal device 200 typically includes a variety of electronic device readable media. Such media can be any available media that is accessible by terminal device 200 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 210 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 240 and/or cache memory 250. Terminal device 200 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 260 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 230 via one or more data medium interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
Program/utility 280 having a set (at least one) of program modules 270 may be stored in, for example, memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 270 generally perform the functions and/or methods in the embodiments described herein.
Terminal device 200 can also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), one or more devices that enable a user to interact with the terminal device 200, and/or any device (e.g., network card, modem, etc.) that enables the terminal device 200 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 292. Also, terminal device 200 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, via network adapter 293. As shown, network adapter 293 communicates with other modules of terminal device 200 over bus 230. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with terminal device 200, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 220 executes various functional applications and data processing by running programs stored in the memory 210.
It should be noted that, the implementation process and the technical principle of the terminal device in this embodiment refer to the foregoing explanation of the interface testing method in this embodiment, and are not repeated herein.
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.
The present embodiments provide a computer program product which, when run on a terminal device, causes the terminal device to perform steps that enable the respective method embodiments described above to be implemented.
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 in the methods 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 may implement the steps of each method embodiment described above when executed by a processor. 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 (Random Access Memory, RAM), 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/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function 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 interface testing method, comprising:
obtaining a test case corresponding to an interface to be tested, wherein the test case comprises at least one test item;
acquiring test configuration data corresponding to the test case, and generating test configuration information;
Generating a circulation control instruction according to the test configuration information;
and automatically testing the interface to be tested according to the circulation control instruction, wherein the automatic test comprises at least one round of test.
2. The method of claim 1, wherein the obtaining the test configuration data corresponding to the test case and generating the test configuration information comprise:
acquiring each coordinate of each window corresponding to the test case;
acquiring single-round test time corresponding to the test case;
acquiring test case interval time corresponding to the test case;
acquiring the total testing duration corresponding to the interface to be tested;
determining the test cycle times according to the single-round test time, the test case interval time and the total test duration;
and generating the test configuration information according to the test cases, the coordinates, the single-round test time, the test case interval time and the test cycle times.
3. The method of claim 2, wherein the loop control instructions include a window switch instruction, a mouse control instruction, and a loop call instruction, and wherein automatically testing the interface under test according to the loop control instructions comprises:
Controlling each window to be switched according to the window switching instruction;
controlling mouse coordinates and mouse events according to the mouse control instruction;
and circularly calling the window switching instruction and the mouse control instruction according to the circularly calling instruction, and performing the automatic test on the interface to be tested.
4. A method according to any one of claims 1 to 3, wherein said automatically testing said interface under test according to said cyclical control instruction comprises:
performing a first round of test on the interface to be tested according to the circulation control instruction;
if the first round of test is abnormal, sending out a test abnormality prompt;
and if the first round of test is not abnormal, carrying out subsequent test on the interface to be tested according to the circulation control instruction.
5. A method according to any one of claims 1 to 3, wherein the interface to be tested is a voice interface, and before the test case corresponding to the interface to be tested is obtained, the method further comprises:
and mutually dialing the interface to be tested and other voice interfaces, and judging whether the interface to be tested is successfully registered.
6. A method according to any one of claims 1 to 3, wherein each of the test rounds corresponds to a test number, and wherein after the automated testing of the interface under test according to the cyclical control instruction, further comprises:
Generating each initial test report of each test item corresponding to each round of test, wherein each initial test report is named according to the corresponding test item and the test number;
and automatically generating a test report of the interface to be tested according to each initial test report.
7. The method of claim 6, wherein automatically generating the test report for the interface under test based on each of the initial test reports comprises:
extracting test data and pictures corresponding to the test items and the test numbers from the initial test reports;
inputting the test data and the pictures into corresponding preset tables according to the test items and the test numbers;
and comparing the test data and the pictures with preset standard data in the preset table, and automatically generating the test report of the interface to be tested.
8. An interface testing apparatus, comprising:
the first acquisition module is used for acquiring a test case corresponding to the interface to be tested, wherein the test case comprises at least one test item;
the second acquisition module is used for acquiring the test configuration data corresponding to the test case and generating test configuration information;
The first generation module is used for generating a circulation control instruction according to the test configuration information;
and the test module is used for automatically testing the interface to be tested according to the circulation control instruction, wherein the automatic test comprises at least one round of test.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, causes the terminal device to implement the method as claimed in any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by an electronic device, implements the method of any one of claims 1 to 7.
CN202311665205.7A 2023-12-05 2023-12-05 Interface testing method, device, terminal equipment and storage medium Pending CN117851230A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311665205.7A CN117851230A (en) 2023-12-05 2023-12-05 Interface testing method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311665205.7A CN117851230A (en) 2023-12-05 2023-12-05 Interface testing method, device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117851230A true CN117851230A (en) 2024-04-09

Family

ID=90542553

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311665205.7A Pending CN117851230A (en) 2023-12-05 2023-12-05 Interface testing method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117851230A (en)

Similar Documents

Publication Publication Date Title
CN108984389B (en) Application program testing method and terminal equipment
CN101738550B (en) Electronic device test device and test method
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN112416775B (en) Software automatic test method and device based on artificial intelligence and electronic equipment
CN111309505B (en) Page exception handling method and device and electronic equipment
CN109710439B (en) Fault processing method and device
CN112115038A (en) Application testing method and device and storage medium
CN109144852A (en) Scan method, device, computer equipment and the storage medium of static code
CN111414309A (en) Automatic test method of application program, computer equipment and storage medium
CN108572895B (en) Stability test method for automatically checking software and hardware configuration under Linux
CN110888731B (en) Method, device, equipment and storage medium for acquiring route data
CN108595332B (en) Software testing method and device
CN109189679A (en) Interface test method and system, electronic equipment, storage medium
CN110968517B (en) Automatic test method, apparatus, platform and computer readable storage medium
CN115022201B (en) Data processing function test method, device, equipment and storage medium
CN117851230A (en) Interface testing method, device, terminal equipment and storage medium
CN111258875A (en) Interface test method and system, electronic device and storage medium
CN104579825A (en) Method and device for monitoring server of application in real time and computer equipment
CN111274143B (en) Buried point test method, buried point test device, buried point test equipment and storage medium
CN114827550A (en) RPA and AI combined monitoring equipment inspection method and device and electronic equipment
CN114064510A (en) Function testing method and device, electronic equipment and storage medium
CN114264904A (en) Full liquid crystal instrument testing method and system based on simulation and machine vision
CN111106979B (en) Method and equipment for switch threshold alarm test
CN112131611A (en) Data correctness verification method, device, equipment, system and storage medium
CN116820946B (en) Method and device for automatically testing compatibility of target software

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