CN107122301B - Interface testing method and device - Google Patents

Interface testing method and device Download PDF

Info

Publication number
CN107122301B
CN107122301B CN201710287592.3A CN201710287592A CN107122301B CN 107122301 B CN107122301 B CN 107122301B CN 201710287592 A CN201710287592 A CN 201710287592A CN 107122301 B CN107122301 B CN 107122301B
Authority
CN
China
Prior art keywords
test
interface
terminal
client
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.)
Active
Application number
CN201710287592.3A
Other languages
Chinese (zh)
Other versions
CN107122301A (en
Inventor
刘明波
陈少杰
张文明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Internet Service Co ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710287592.3A priority Critical patent/CN107122301B/en
Publication of CN107122301A publication Critical patent/CN107122301A/en
Application granted granted Critical
Publication of CN107122301B publication Critical patent/CN107122301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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 an interface testing method and device, and relates to the technical field of software testing. The interface testing method and the device are applied to a testing host which is in communication connection with a testing terminal, an automatic testing frame is installed in the testing host, a client to be tested runs in the testing terminal, and the automatic testing frame comprises a preset data acquisition function. The method comprises the following steps: acquiring the service requirement of the client through the data acquisition function; detecting an interface to be tested of the client to obtain a page element of the interface to be tested and positioning data corresponding to the page element; and performing function test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested. Therefore, cross-platform client interface test is not required to be executed by means of a third-party driver, and the client interface test is simpler and more convenient. The consumption of human resources is reduced, and the later maintenance cost is also reduced.

Description

Interface testing method and device
Technical Field
The invention relates to the technical field of software testing, in particular to an interface testing method and device.
Background
Software testing is the process of operating a program under specified conditions to discover bugs, to measure software quality, and to evaluate whether it can meet design requirements. Software testing is generated in connection with the generation of software. With the advent of the internet and the era, the market demand of software testing is getting larger and larger, and the manual testing obviously cannot meet the market demand. Whereby the automated testing is silently motivated. The current automatic test is roughly divided into two types of cross-platform and non-cross-platform, wherein the non-cross-platform automatic test needs to design different automatic test frames aiming at different platforms, obviously, the manufacturing cost is extremely high, and the time consumption is extremely high; the cross-platform automated test framework needs to depend on a data driving framework of a third party in the implementation, so that the implementation cost and the maintenance cost of the automated test are increased. The maintenance difficulty is increased.
Disclosure of Invention
The present invention is directed to an interface testing method for improving the above-mentioned problems.
Another objective of the present invention is to provide an interface testing apparatus for improving the above mentioned problems.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
the embodiment of the invention provides an interface test method, which is applied to a test host in communication connection with a test terminal, wherein an automatic test frame is installed in the test host, a client to be tested runs in the test terminal, the automatic test frame comprises a preset data acquisition function, and the interface test method comprises the following steps: acquiring the service requirement of the client through the data acquisition function; detecting an interface to be tested of the client to obtain a page element of the interface to be tested and positioning data corresponding to the page element; generating a test case according to the service requirement and the page element; performing a function test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested; and generating the test report according to the test result.
The invention also provides an interface testing device, which is applied to a testing host computer in communication connection with a testing terminal, wherein an automatic testing frame is installed in the testing host computer, a client to be tested runs in the testing terminal, the automatic testing frame comprises a preset data acquisition function, and the device comprises: the data acquisition module is used for acquiring the service requirement of the client through the data acquisition function; the page element detection module is used for detecting an interface to be tested of the client to obtain page elements of the interface to be tested and positioning data corresponding to the page elements; the test case assembly module is used for generating a test case according to the service requirement and the page element; the test execution module is used for carrying out functional test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested; and the report generating module is used for generating the test report according to the test result.
Compared with the prior art, the interface testing method and device provided by the invention are provided. The automatic testing system is applied to a testing host which is in communication connection with a testing terminal, an automatic testing frame is installed in the testing host, a client to be tested runs in the testing terminal, and the automatic testing frame comprises a preset data acquisition function. The method comprises the following steps: acquiring the service requirement of the client through the data acquisition function; detecting an interface to be tested of the client to obtain a page element of the interface to be tested and positioning data corresponding to the page element; and performing function test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested. Thereby, the cross-platform automatic test is no longer aided by a third-party program. The consumption of human resources is reduced, and the later maintenance cost is also reduced.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram of a test host according to a preferred embodiment of the present invention.
Fig. 2 is a flowchart illustrating steps of an interface testing method according to a preferred embodiment of the present invention.
Fig. 3 is a flowchart illustrating sub-steps of step S103 in fig. 2.
Fig. 4 is a flowchart illustrating sub-steps of step S104 in fig. 2.
Fig. 5 is a functional block diagram of an interface testing apparatus according to a preferred embodiment of the present invention.
FIG. 6 is a functional sub-module diagram of the test case assembly module shown in FIG. 5.
FIG. 7 is a functional sub-block diagram of the test execution module shown in FIG. 5.
Icon: 100-a test host; 111-a memory; 112-a processor; 113-a communication unit; 114-a display unit; 200-an interface test device; 201-a data acquisition module; 202-a page element detection module; 203-test case assembly module; 2031-obtaining sub-module; 2032-assembling the submodules; 204-a test execution module; 2041-a positioning sub-module; 2042-execution submodule; 2043-a receive submodule; 2044-comparison submodule; 205-report generation module; 300-automatic test framework.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Fig. 1 is a block diagram of a test host 100 according to a preferred embodiment of the present invention. The test host 100 includes an interface test apparatus 200, an automatic test framework 300, a memory 111, a processor 112, a communication unit 113, and a display unit 114.
The memory 111, the processor 112, the communication unit 113 and the display unit 114 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The interface testing apparatus 200 includes at least one software function module which can be stored in the memory 111 in the form of software or Firmware (Firmware) or is fixed in an Operating System (OS) of the testing host 100. The processor 112 is used for executing executable modules stored in the memory 111, such as software functional modules and computer programs included in the interface testing device 200 and the automatic testing framework 300.
The Memory 111 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 111 is used to store programs or data. The communication unit 113 is configured to establish a communication connection between the test host 100 and another communication terminal, so as to implement data interaction between the test host 100 and the other communication terminal.
The display unit 114 is used to provide an interactive interface (e.g., a user interface) between the test host 100 and a tester or to display image data. In this embodiment, the display unit 114 may be a liquid crystal display or a touch display. In the case of a touch display, the display can be a capacitive touch screen or a resistive touch screen, which supports single-point and multi-point touch operations.
It should be understood that the configuration shown in fig. 1 is merely a schematic diagram of the configuration of the test host 100, and the test host 100 may include more or less components than those shown in fig. 1, or have a different configuration than that shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
First embodiment
Referring to fig. 2, fig. 2 is a flowchart illustrating an interface testing method according to an embodiment of the present invention. The interface test method is applied to a test host 100 connected to a test terminal (not shown). Alternatively, the test terminal and the test host 100 may be electrically connected, or may be communicatively connected through the communication unit 113. The automatic test framework 300 installed in the test host 100 includes a preset data acquisition driver. It should be noted that the data acquisition driver includes an encapsulated data acquisition function. And the test terminal runs a client to be tested, namely a test packet to be tested. The method comprises the following steps:
and step S101, acquiring terminal state information, terminal basic information, client basic information and service requirements of the client of the test terminal through the data acquisition function.
In this embodiment, the corresponding data is acquired from the test terminal by calling the program interface of the data acquisition driver and then using the data acquisition function. It should be noted that the terminal state information may include, but is not limited to, a connection state, a connection mode, terminal power state information, and the like between the test terminal and the test host 100; the terminal basic information may be, but is not limited to, information such as version, model, manufacturer, etc. of the test terminal; the client basic information may include, but is not limited to, the version, the applicable environment, the writing language, etc. of the client; the business requirements of the client can include functions and the like required to be realized by the client interface. Alternatively, the program interface of the data acquisition driver may be a program call interface obtained by pre-packaging the ReadConfig class and the init class. Optionally, the init class includes a function of acquiring the terminal basic information and the client basic information, such as connect _ phone, get _ deviceName, get _ android _ version, and start _ server. The ReadConfig class includes a function for getConfigValue to obtain client-related information (the client-related information includes a client service requirement, a client source code, and the like), and a function for getcmdValue to obtain terminal state information. Optionally, when the test terminal accesses the test host 100, the test host 100 automatically calls the init and ReadConfig program interfaces to obtain the terminal state information, the terminal basic information, the client basic information, and the service requirements of the client of the test terminal.
Step S102, detecting an interface to be tested of the client to obtain a page element of the interface to be tested and positioning data corresponding to the page element.
In this embodiment, the page elements may include, but are not limited to, input controls or, touch keys, slide controls, text, pictures, audio, animation, video, and the like in the interface to be tested. The location data may be, but is not limited to, the id, name, class name, xpath, and hierarchical Style Sheets (CSSs) of the page element. The positioning data corresponding to each page element is defined when the program of the client side is written. The obtaining of the positioning data corresponding to the page element may include at least one of an id, a name, a class name, an xpath, and a CSS of the page element. Optionally, the page element of the interface to be tested and the positioning data corresponding to the page element may be obtained from the obtained program corresponding to the client.
And step S103, generating a test case according to the service requirement and the page element.
In this embodiment, a test case may be a set of test inputs, execution conditions, and expected results produced according to the business requirements of the client. It should be noted that the expected result is that the execution result obtained in response to the test input in the case that the client is in the execution condition can meet the expectation of the programmer. Referring to fig. 3, the step S103 includes the following sub-steps:
and step S1031, obtaining a preset binding event corresponding to the page element according to the page element.
In this embodiment, when the program of the client is written, a corresponding preset binding event of the page element is defined, where the binding event is an action that the page element needs to perform, for example, a sliding element performs a sliding event, and an input window is used for performing an event of inputting characters.
And a substep S1032, arranging the order of executing the corresponding preset binding event by the page element according to the service requirement, so as to generate the test case.
In this embodiment, the page elements are arranged to execute the corresponding binding event sequence to generate test inputs and construct execution conditions. Optionally, the binding event corresponding to each page element may be packaged in advance to obtain the event execution call interface. And sequentially setting the sequence of calling the event execution calling interfaces according to the sequence of executing the binding events by the page elements.
And step S104, performing function test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested.
In this embodiment, the page elements are functionally tested, that is, the binding event is executed according to the page elements corresponding to the test input in the test case. Testsuite containers, for example, are called to implement case loading and execution. When the execution result fed back by the test terminal after the execution is finished is the same as the expected result in the test case, the test result is successful; otherwise, the test result is test failure. Referring to fig. 4, the step S104 includes the following sub-steps:
and a substep S1041 of positioning the corresponding page element by using the page element positioning function according to the order of executing the corresponding binding event by the page element in the test case and the positioning data corresponding to the page element in sequence.
In this embodiment, the automatic test framework 300 includes a pre-packaged page element positioning function. And calling a program interface packaged by a page element positioning function according to the sequence of executing the corresponding binding events by the page elements and the positioning data corresponding to the page elements in sequence, and positioning the page elements in the interface of the client. Optionally, when only one page element executes the corresponding binding event at the same time point, the page element positioning function may be at least one of an id positioning function, a name positioning function, a classname positioning function, an xpath positioning function, and a css positioning function; when multiple page elements need to execute corresponding binding events at the same time point, the page element positioning function may also be an ids positioning function, a names positioning function, or the like, so as to conveniently perform positioning operation on the multiple elements.
And a substep S1042, sequentially controlling the located page elements to traverse and execute corresponding binding events.
In this embodiment, if a page element is located, the located page element is controlled to execute the corresponding binding event until the event corresponding to the last page element in the test case is executed.
And a substep S1043 of receiving an execution result fed back by the test terminal.
In this embodiment, the execution result may be state data executed after the client has executed the test case and an interface image of the execution result after the client has executed the test case. For example, after the test case for sending information is executed, if the sending is successful, the execution state data is a message for successfully sending information; and after the test case for sending the information is executed, if the sending fails, the execution state data is an error message for sending the information. Optionally, it may be obtained, but not limited to, by a work log or other feedback result of the terminal communicatively connected to the test terminal. And after the test terminal finishes executing, the execution result is fed back to the test host 100.
And a substep S1044 of comparing the execution result with the service requirement to obtain the test result.
In this embodiment, the test host 100 compares the execution result with the preset result in the test case. Optionally, the execution state data in the preset result and the execution state data in the execution result may be compared to determine whether the interface image in the execution result is the same as the interface image in the preset result.
And step S105, generating the test report according to the test result.
In this embodiment, the test report is generated according to the test result, the terminal state information of the test terminal, the terminal basic information, and the client basic information. Optionally, when the test result is a test failure, generating the test report according to the received execution result interface image of the client intercepted by the test terminal, the test failure state data, the terminal state information of the test terminal, the terminal basic information and the client basic information; and when the test result is that the test is successful, generating the test report according to the successful test state data, the terminal state information of the test terminal, the basic terminal information and the basic client information. For example, all the data of test case operation is put into result \ date \ xxx, the data of case operation includes the basic information of the test package, the case name, the execution state, the test result and the execution result interface image of the client when the test fails, and the test report in the HTML format is generated by calling the HTML testrunner. And displayed by the display unit 114.
After the test report is generated, when the test is carried out again, and the basic information of the client to be tested is detected to be different from the client tested last time, after the confirmation instruction input by the tester is obtained, the method further comprises the step of unloading the terminal state information, the terminal basic information and the client basic information of the test terminal.
Second embodiment
Fig. 5 is a functional block diagram of an interface testing apparatus 200 according to a preferred embodiment of the invention. The interface testing device 200 is applied to a testing host 100 in communication connection with a testing terminal, wherein an automatic testing framework 300 is installed in the testing host 100, a client to be tested runs in the testing terminal, and the automatic testing framework 300 comprises a preset data acquisition function. The interface testing apparatus 200 includes a data obtaining module 201, a page element detecting module 202, a test case assembling module 203, a test executing module 204, and a report generating module 205.
The data obtaining module 201 is configured to obtain, through the data obtaining function, terminal state information of the test terminal, terminal basic information, the client basic information, and a service requirement of the client.
In the embodiment of the present invention, step S101 may be performed by the data acquiring module 201.
The page element detection module 202 is configured to detect an interface to be tested of the client, so as to obtain a page element of the interface to be tested and location data corresponding to the page element.
In an embodiment of the present invention, step S102 may be performed by the page element detection module 202.
And the test case assembling module 203 is used for generating a test case according to the service requirement and the page element.
In the embodiment of the present invention, step S103 may be executed by the test case assembling module 203. As shown in fig. 6, the test case assembly module 203 further includes the following sub-modules:
the obtaining sub-module 2031 obtains a preset binding event corresponding to the page element according to the page element.
In the embodiment of the present invention, the sub-step S1031 may be executed by the obtaining sub-module 2031.
The assembling sub-module 2032 is configured to arrange, according to the service requirement, a sequence in which the page element executes a corresponding preset binding event, so as to generate the test case.
In an embodiment of the present invention, sub-step S1032 may be performed by the assembling sub-module 2032.
And the test execution module 204 is configured to perform a functional test on the page element on the interface to be tested based on the test case and the positioning data, so as to obtain a test result of the interface to be tested.
In the embodiment of the present invention, step S104 may be executed by the test execution module 204. As shown in fig. 7, the test execution module 204 includes the following functional sub-modules:
the positioning sub-module 2041 is configured to sequentially position, according to the order in which the page elements in the test case execute the corresponding binding events, the corresponding page elements according to the positioning data corresponding to the page elements by using the page element positioning function.
In the embodiment of the present invention, the sub-step S1041 may be performed by the positioning sub-module 2041.
The execution sub-module 2042 is configured to sequentially control the located page elements to traverse and execute corresponding binding events.
In the embodiment of the present invention, the sub-step S1042 may be performed by the execution sub-module 2042.
The receiving submodule 2043 is configured to receive an execution result fed back by the test terminal.
In the embodiment of the present invention, the sub-step S1043 may be performed by the receiving sub-module 2043.
The comparison submodule 2044 is configured to compare the execution result with the service requirement to obtain the test result.
In an embodiment of the present invention, the sub-step S1044 may be performed by the comparing sub-module 2044.
And a report generating module 205, configured to generate the test report according to the test result.
In the embodiment of the present invention, step S105 may be performed by the report generating module 205.
In summary, the present invention provides a method and an apparatus for testing an interface. The automatic testing system is applied to a testing host which is in communication connection with a testing terminal, an automatic testing frame is installed in the testing host, a client to be tested runs in the testing terminal, and the automatic testing frame comprises a preset data acquisition function. The method comprises the following steps: acquiring the service requirement of the client through the data acquisition function; detecting an interface to be tested of the client to obtain a page element of the interface to be tested and positioning data corresponding to the page element; and performing function test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested. Thereby, the cross-platform automatic test is no longer aided by a third-party program. The consumption of human resources is reduced, and the later maintenance cost is also reduced.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. An interface test method is applied to a test host which is in communication connection with a test terminal, wherein an automatic test frame is installed in the test host, and a client to be tested runs in the test terminal, and is characterized in that the automatic test frame comprises a preset data acquisition function, and the interface test method comprises the following steps:
acquiring the service requirement of the client through the data acquisition function;
detecting an interface to be tested of the client, and acquiring a page element of the interface to be tested and positioning data corresponding to the page element from a program corresponding to the client;
generating a test case according to the service requirement and the page element; wherein, include: acquiring a preset binding event corresponding to the page element according to the page element; arranging the sequence of the corresponding preset binding events executed by the page elements according to the service requirements to generate the test case;
performing a function test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested;
and generating a test report according to the test result.
2. The interface testing method of claim 1, wherein the automatic testing framework further comprises a page element positioning function packaged in advance, and the step of performing a functional test on the page element on the interface to be tested based on the test case and the positioning data to obtain the test result of the interface to be tested comprises:
according to the sequence of executing the corresponding binding events by the page elements in the test case, sequentially positioning the corresponding page elements according to the positioning data corresponding to the page elements by using the page element positioning function;
sequentially controlling the positioned page elements to traverse and execute corresponding binding events;
receiving an execution result fed back by the test terminal;
and comparing the execution result with the service requirement to obtain the test result.
3. The interface testing method of claim 1, wherein the step of generating the test report based on the test results comprises:
when the test result is that the test fails, generating the test report according to the received interface image of the client and the test failure state data intercepted by the test terminal;
and when the test result is that the test is successful, generating the test report according to the state data of the test success.
4. The interface testing method of claim 1, further comprising:
acquiring terminal state information, terminal basic information and client basic information of the test terminal through the data acquisition function;
the step of generating the test report according to the test result comprises: and generating the test report according to the test result, the terminal state information of the test terminal, the basic terminal information and the basic client information.
5. The interface testing method of claim 4, wherein the method further comprises: and after the test report is generated, unloading the terminal state information, the terminal basic information and the client basic information of the test terminal.
6. An interface testing device is applied to a testing host computer which is in communication connection with a testing terminal, wherein an automatic testing framework is installed in the testing host computer, and a client to be tested runs in the testing terminal, and the interface testing device is characterized in that the automatic testing framework comprises a preset data acquisition function, and the device comprises:
the data acquisition module is used for acquiring the service requirement of the client through the data acquisition function;
the page element detection module is used for detecting an interface to be tested of the client and obtaining page elements of the interface to be tested and positioning data corresponding to the page elements from a program corresponding to the client;
the test case assembly module is used for generating a test case according to the service requirement and the page element; wherein, the test case assembly module comprises: the obtaining submodule is used for obtaining a preset binding event corresponding to the page element according to the page element; the assembly submodule is used for arranging the sequence of the corresponding preset binding events executed by the page elements according to the service requirements so as to generate the test case;
the test execution module is used for carrying out functional test on the page elements on the interface to be tested based on the test case and the positioning data to obtain a test result of the interface to be tested;
and the report generating module is used for generating a test report according to the test result.
7. The interface testing apparatus of claim 6, wherein the automated test framework includes a pre-packaged page element positioning function, the test execution module comprising:
the positioning sub-module is used for positioning the corresponding page elements according to the sequence of executing the corresponding binding events by the page elements in the test case, and the positioning sub-module is used for positioning the corresponding page elements by utilizing the page element positioning function according to the positioning data corresponding to the page elements in sequence;
the execution submodule is used for sequentially controlling the positioned page elements to traverse and execute corresponding binding events;
the receiving submodule is used for receiving the execution result fed back by the test terminal;
and the comparison submodule is used for comparing the execution result with the service requirement so as to obtain the test result.
8. The interface test apparatus of claim 6,
the data acquisition module is further used for acquiring terminal state information, terminal basic information and client basic information of the test terminal through the data acquisition function;
the mode for the report generation module to execute the test report generation according to the test result comprises the following steps: and generating the test report according to the test result, the terminal state information of the test terminal, the basic terminal information and the basic client information.
CN201710287592.3A 2017-04-27 2017-04-27 Interface testing method and device Active CN107122301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710287592.3A CN107122301B (en) 2017-04-27 2017-04-27 Interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710287592.3A CN107122301B (en) 2017-04-27 2017-04-27 Interface testing method and device

Publications (2)

Publication Number Publication Date
CN107122301A CN107122301A (en) 2017-09-01
CN107122301B true CN107122301B (en) 2020-04-10

Family

ID=59725448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710287592.3A Active CN107122301B (en) 2017-04-27 2017-04-27 Interface testing method and device

Country Status (1)

Country Link
CN (1) CN107122301B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804318A (en) * 2018-05-24 2018-11-13 北京金山安全软件有限公司 Page element testing method and device, electronic equipment and storage medium
CN109345383A (en) * 2018-08-13 2019-02-15 兴业证券股份有限公司 Security software information service monitoring method and storage medium
CN109542764B (en) * 2018-10-17 2023-08-18 平安健康保险股份有限公司 Webpage automatic testing method and device, computer equipment and storage medium
CN109344074B (en) * 2018-10-19 2022-06-03 中国银行股份有限公司 Cross-platform automatic testing method and system
CN111209183A (en) * 2018-11-22 2020-05-29 中国电信股份有限公司 UI function traversal test method and device
CN109603154B (en) * 2018-12-14 2022-05-20 网易(杭州)网络有限公司 Game interface testing method, client, hosting server and system
CN111475394B (en) * 2019-01-24 2023-06-20 阿里巴巴集团控股有限公司 Application testing method and device
CN110209572A (en) * 2019-05-06 2019-09-06 深圳法大大网络科技有限公司 Ui testing method, ui testing system and terminal
CN110851366A (en) * 2019-11-18 2020-02-28 中国银行股份有限公司 Method and device for realizing regression test
CN111045934A (en) * 2019-11-29 2020-04-21 北京三快在线科技有限公司 Page analysis method, device, client, storage medium and electronic equipment
CN111723006B (en) * 2020-05-25 2022-03-08 四川九洲电器集团有限责任公司 Automatic test frame and industrial computer based on C #
CN111782524A (en) * 2020-06-29 2020-10-16 京东数字科技控股有限公司 Application testing method and device, storage medium and electronic device
CN113448839B (en) * 2020-12-24 2024-01-26 北京新氧科技有限公司 Application program testing method, device, equipment and storage medium
CN113127354B (en) * 2021-04-21 2023-08-11 武汉思普崚技术有限公司 Automatic test method, device, equipment and storage medium based on Web UI

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461900A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 User interface testing method, center control server, test terminal and system
CN105373469A (en) * 2014-08-25 2016-03-02 广东金赋信息科技有限公司 Interface based software automation test method
CN105630674A (en) * 2015-12-17 2016-06-01 北京奇虎科技有限公司 Test method and device capable of aiming at interface
CN106528394A (en) * 2015-09-09 2017-03-22 中兴通讯股份有限公司 Software measurement detection method and system
CN106547687A (en) * 2016-10-14 2017-03-29 深圳前海微众银行股份有限公司 Application testing method, apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105373469A (en) * 2014-08-25 2016-03-02 广东金赋信息科技有限公司 Interface based software automation test method
CN104461900A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 User interface testing method, center control server, test terminal and system
CN106528394A (en) * 2015-09-09 2017-03-22 中兴通讯股份有限公司 Software measurement detection method and system
CN105630674A (en) * 2015-12-17 2016-06-01 北京奇虎科技有限公司 Test method and device capable of aiming at interface
CN106547687A (en) * 2016-10-14 2017-03-29 深圳前海微众银行股份有限公司 Application testing method, apparatus and system

Also Published As

Publication number Publication date
CN107122301A (en) 2017-09-01

Similar Documents

Publication Publication Date Title
CN107122301B (en) Interface testing method and device
US10853232B2 (en) Adaptive system for mobile device testing
CN108959068B (en) Software interface testing method, device and storage medium
CN106415480B (en) High-speed application for installation on a mobile device for enabling remote configuration of the mobile device
JP6889520B2 (en) Diagnostic analyzer related information aggregation method and aggregation system
WO2013075612A1 (en) Auto login method and device
WO2019227708A1 (en) Online debugging apparatus and method for test case, and computer-readable storage medium
US10620978B2 (en) Simulation desktop establishment method and related apparatus
US20150331784A1 (en) System and method for controlling test script execution by smartphone
CN106126424A (en) A kind of visual automated testing method of script, device and mobile terminal
CN111949607B (en) Method, system and device for monitoring UDT file
CN112115051A (en) Page traversal detection method, device and equipment for application and readable storage medium
CN111881054B (en) User interface automatic test method, system, equipment and storage medium
JP6238221B2 (en) Apparatus, method and program for monitoring execution of software
CN108540344B (en) Router upgrading test method and system
EP2608003A1 (en) Method and device for movement of image object
CN115688706A (en) Information verification method, device, equipment and storage medium
CN110781142B (en) Data import method and device, server and storage medium
CN115543831A (en) Test script generation method, device, equipment and storage medium
KR101691929B1 (en) An apparatus for implementing an automation of a web user interface and method therefor
WO2017096889A1 (en) Method and device for upgrading and downgrading system
CN109324822B (en) PWA (public warning assistant) item detection method, computer-readable storage medium and terminal device
KR20130067959A (en) Method and appratus for processing error of application
CN113656301A (en) Interface testing method, device, equipment and storage medium
CN111026466A (en) File processing method and device, computer readable storage medium and electronic equipment

Legal Events

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

Effective date of registration: 20231109

Address after: Room 606-609, Compound Office Complex Building, No. 757, Dongfeng East Road, Yuexiu District, Guangzhou, Guangdong Province, 510699

Patentee after: China Southern Power Grid Internet Service Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right