CN112148607A - Interface testing method and device for service scene - Google Patents

Interface testing method and device for service scene Download PDF

Info

Publication number
CN112148607A
CN112148607A CN202011008059.7A CN202011008059A CN112148607A CN 112148607 A CN112148607 A CN 112148607A CN 202011008059 A CN202011008059 A CN 202011008059A CN 112148607 A CN112148607 A CN 112148607A
Authority
CN
China
Prior art keywords
interface
tested
test
information
configuration information
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
CN202011008059.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.)
Beijing Tongbang Zhuoyi Technology Co ltd
Original Assignee
Beijing Tongbang Zhuoyi 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 Beijing Tongbang Zhuoyi Technology Co ltd filed Critical Beijing Tongbang Zhuoyi Technology Co ltd
Priority to CN202011008059.7A priority Critical patent/CN112148607A/en
Publication of CN112148607A publication Critical patent/CN112148607A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The application relates to a method and a device for testing an interface of a service scene, wherein the method comprises the following steps: acquiring interface logic information configured for a service scene to be tested and interface configuration information of each interface to be tested on a test configuration page; under the condition of receiving a test starting instruction, testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report; and displaying the test report on a test result page. The method and the device solve the technical problem that the interface testing efficiency of the service scene is low.

Description

Interface testing method and device for service scene
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for testing an interface of a service scenario.
Background
In the prior art, the automatic test of an interface scene is executed by using java + testing or groovy + spot or python + httpparent technology in a code writing mode, but the test task of the scene cannot be realized by many testers without development capability. In this way, the operator is required to have strong code and frame capabilities, but the common practice is that the person writing the code does not know about the business and the person who knows about the business does not write the code. The testing process wastes much time for the testing personnel, resulting in low testing efficiency.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The application provides a method and a device for testing an interface of a service scene, which are used for at least solving the technical problem of low efficiency of testing the interface of the service scene in the related technology.
According to an aspect of an embodiment of the present application, a method for testing an interface of a service scenario is provided, including:
acquiring interface logic information configured for a service scene to be tested and interface configuration information of each interface to be tested on a test configuration page;
under the condition of receiving a test starting instruction, testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report;
and displaying the test report on a test result page.
Optionally, the obtaining, on the test configuration page, interface logic information configured for the service scenario to be tested and interface configuration information of each interface to be tested includes:
acquiring the interface logic information input on the test configuration page, wherein the interface logic information is used for indicating the execution sequence of the to-be-tested interfaces included in the to-be-tested service scene;
receiving the interface configuration information input for each interface to be tested;
storing the interface logic information in a scene table of a database, and storing the interface configuration information in a step table of the database.
Optionally, receiving the interface configuration information input for each interface to be tested includes:
under the condition that the target interface in the interface logic information is detected to be executed with selection operation, displaying an interface information configuration window corresponding to the target interface;
under the condition that the interface information configuration window is detected to execute the determined operation, converting the data input on the interface information configuration window into target interface configuration information corresponding to the target interface, wherein the target interface configuration information comprises: the target interface configuration information further comprises global variable replacement information, the waiting inquiry identifier is used for indicating whether the target interface needs to wait for inquiry, and the target interface configuration information further comprises waiting inquiry information under the condition that the waiting inquiry identifier is used for indicating that the target interface needs to wait for inquiry.
Optionally, the testing the service scenario to be tested according to the interface logic information and the interface configuration information of each interface to be tested, and obtaining a test report includes:
reading the interface logic information from a scene table of the database;
executing operation on each interface to be tested according to the execution sequence of the interfaces to be tested indicated by the interface logic information;
in the process of executing operation on each interface to be tested, calling interface configuration information corresponding to each interface to be tested from the step table of the database;
testing each interface to be tested according to the interface configuration information to obtain a test result corresponding to each interface to be tested;
and generating the test report according to the test result corresponding to each interface to be tested.
Optionally, the testing each interface to be tested according to the interface configuration information, and obtaining a test result corresponding to each interface to be tested includes:
under the condition that the interface configuration information is used for indicating that each interface to be tested needs to replace a variable, acquiring the variable to be replaced from the interface configuration information; replacing the variable in the test process by using the variable to be replaced;
waiting for inquiry and acquiring an inquiry result under the condition that the interface configuration information is used for indicating that each interface to be tested needs to wait for inquiry; and determining the next interface to be tested according to the query result.
Optionally, the generating the test report according to the test result corresponding to each interface to be tested includes:
reading a verification rule and a verification parameter under the condition that the test result corresponding to each interface to be tested needs to be calculated and verified;
calculating and checking the test result according to the checking rule and the checking parameter to obtain a checking result;
and generating the test report according to the verification result.
Optionally, before the service scenario to be tested is tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report, the method further includes one of the following:
determining to receive the test starting instruction under the condition that a starting button displayed on the test configuration page is triggered;
and determining to receive the test starting instruction under the condition that the current time reaches the trigger time corresponding to the service scene to be tested.
According to another aspect of the embodiments of the present application, there is also provided an interface testing apparatus for a service scenario, including:
the acquisition module is used for acquiring interface logic information configured for the service scene to be tested and interface configuration information of each interface to be tested on a test configuration page;
the test module is used for testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested under the condition of receiving a test starting instruction to obtain a test report;
and the display module is used for displaying the test report on a test result page.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the application, interface logic information configured for a service scene to be tested and interface configuration information of each interface to be tested are acquired on a test configuration page; under the condition of receiving a test starting instruction, testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report; the method for displaying the test report on the test result page allows a tester to configure test contents, such as interface logic information and interface configuration information of each interface to be tested, on the test configuration page, and the application can convert the configured information into an actual test process according to the configuration on the test configuration page to test the interface to be tested in the service scene, so that the aims of rapidly configuring the interface information of the service scene and automatically testing the interface of the service scene are fulfilled, the technical effect of improving the interface test efficiency of the service scene is achieved, and the technical problem of low interface test efficiency of the service scene is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram of a hardware environment of an interface testing method of a service scenario according to an embodiment of the present application;
fig. 2 is a flowchart of an interface testing method for an alternative service scenario according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative test configuration page according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an automated testing process according to an alternative embodiment of the present application;
FIG. 5 is a schematic illustration of a visual interface scenario automated testing process according to an alternative embodiment of the present application;
FIG. 6 is a schematic diagram of an interface testing apparatus for an alternative service scenario according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present application, an embodiment of a method for testing an interface of a service scenario is provided.
Optionally, in this embodiment, the interface testing method of the service scenario may be applied to a hardware environment formed by the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal, and a database may be provided on the server or separately from the server for providing data storage services for the server 103, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like. The interface testing method of the service scenario in the embodiment of the present application may be executed by the server 103, or may be executed by the terminal 101, or may be executed by both the server 103 and the terminal 101. The method for the terminal 101 to execute the interface test of the service scenario in the embodiment of the present application may also be executed by a client installed thereon.
Fig. 2 is a flowchart of an interface testing method for an optional service scenario according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, acquiring interface logic information configured for a service scene to be tested and interface configuration information of each interface to be tested on a test configuration page;
step S204, under the condition of receiving a test starting instruction, testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report;
and step S206, displaying the test report on a test result page.
Through the steps S202 to S206, the tester only needs to configure the test content, such as the interface logic information and the interface configuration information of each interface to be tested, on the test configuration page, and the application can convert the configured information into the actual test process according to the configuration on the test configuration page to test the interface to be tested in the service scenario, thereby achieving the purposes of fast configuration of the interface information of the service scenario and automatic test of the interface of the service scenario, thereby achieving the technical effect of improving the interface test efficiency of the service scenario, and further solving the technical problem of low interface test efficiency of the service scenario.
Optionally, in this embodiment, the interface testing method of the service scenario may be, but is not limited to, applied to an application, a plug-in, a tool, or a device having a testing function of the service scenario. Such as: a plug-in with a test function of a service scene can be developed and installed on test software, and testers can call the plug-in to perform interface test of the service scene by clicking an icon on the test software.
In the technical solution provided in step S202, the test configuration page is used for receiving test information input by a tester, where the test information may include, but is not limited to: interface logic information and interface configuration information for each interface to be tested, etc. The interface logic information may be used to indicate the interfaces to be tested in the service scenario and the step relationship between the interfaces. The interface configuration information is used for indicating the parameters, calling modes, calling rules and other information of each interface to be tested.
As an alternative embodiment, in step S202, the interface logic information configured for the service scenario to be tested and the interface configuration information of each interface to be tested may be obtained through, but are not limited to, the following processes:
s11, acquiring the interface logic information input on the test configuration page, where the interface logic information is used to indicate an execution sequence of the to-be-tested interfaces included in the to-be-tested service scenario;
s12, receiving the interface configuration information input for each interface to be tested;
and S13, storing the interface logic information in a scene table of a database, and storing the interface configuration information in a step table of the database.
Optionally, in this embodiment, the interface logic information is used to indicate an execution sequence of the interfaces to be tested included in the service scenario to be tested. The tester can configure the interfaces to be tested and the execution sequence among the interfaces on the test configuration page, such as: the interface to be tested comprises an interface 1, an interface 2 and an interface 3, the execution sequence among the interfaces can be that the interface 2 is executed if a result 1 is obtained after the interface 1 is executed, and the interface 3 is executed if a result 2 is obtained after the interface 1 is executed.
Optionally, in this embodiment, the tester may also configure interface configuration information for each interface.
Optionally, in this embodiment, after receiving information configured on the test configuration page by the tester, the information may be stored in a database, the database may be divided into a scenario table and a step table, the scenario table in the database is used to store interface logic information, and the step table in the database is used to store interface configuration information.
As an alternative embodiment, the interface configuration information input for each interface to be tested may be received, but is not limited to, in the following manner:
s21, when detecting that the target interface in the interface logic information is executed with the selection operation, displaying the interface information configuration window corresponding to the target interface;
s22, when it is detected that the determining operation is performed on the interface information configuration window, converting data input on the interface information configuration window into target interface configuration information corresponding to the target interface, where the target interface configuration information includes: the target interface configuration information further comprises global variable replacement information, the waiting inquiry identifier is used for indicating whether the target interface needs to wait for inquiry, and the target interface configuration information further comprises waiting inquiry information under the condition that the waiting inquiry identifier is used for indicating that the target interface needs to wait for inquiry.
Optionally, in this embodiment, a tester may configure interface configuration information corresponding to an interface in an interface information configuration window corresponding to the interface by performing a selection operation on each interface.
Optionally, in this embodiment, the target interface configuration information may include, but is not limited to: inputting data, outputting data, replacing identification of global variable and waiting inquiry identification.
Optionally, in this embodiment, the global variable replacement identifier is used to indicate whether the target interface needs to replace the global variable, and in a case that the global variable identifier is used to indicate that the target interface needs to replace the global variable, the target interface configuration information further includes global variable replacement information. Some interfaces can replace global variables, some interfaces do not need to replace the global variables, whether the interfaces need to replace the global variables can be indicated through options of global variable replacement marks on an interface information configuration window, and if a tester selects the options, an area for inputting global variable replacement information can be provided for the tester.
Optionally, in this embodiment, the wait query identifier is used to indicate whether the target interface needs to wait for the query, and in a case that the wait query identifier is used to indicate that the target interface needs to wait for the query, the target interface configuration information further includes wait query information. Some interfaces can wait for inquiry, some interfaces do not need to wait for inquiry, whether the interfaces need to wait for inquiry or not can be indicated on the interface information configuration window through the option of the waiting inquiry identification, and if the tester selects the option, an area for inputting the waiting inquiry information can be provided for the tester.
For example: in this embodiment, an input method of test information of an optional interface is provided, fig. 3 is a schematic diagram of an optional test configuration page according to an embodiment of the present application, and as shown in fig. 3, a tester may add an interface to be tested on the test configuration page, for example: interface 3486: loan product configuration, interface 3487: query for loan deposit information, interface 3489: public queries, and the like. When the tester clicks on interface 3486: when checking the configuration of the loan products, displaying an interface information configuration window corresponding to the interface on the interface, and configuring input data, output data, global variable replacement information, waiting for query information and other contents for the interface by a tester on the interface information configuration window. Different steps corresponding to different return values can be configured in the waiting inquiry information.
In the technical solution provided in step S204, the test starting instruction may be triggered by, but not limited to, a button, an icon, a waiting time, and the like.
As an alternative embodiment, in the step S204, the service scenario to be tested may be tested, but is not limited to, by the following means:
s31, reading the interface logic information from the scene table of the database;
s32, executing operation to each interface to be tested according to the execution sequence of the interfaces to be tested indicated by the interface logic information;
s33, in the process of executing operation to each interface to be tested, calling interface configuration information corresponding to each interface to be tested from the step table of the database;
s34, testing each interface to be tested according to the interface configuration information to obtain a test result corresponding to each interface to be tested;
and S35, generating the test report according to the test result corresponding to each interface to be tested.
Optionally, in this embodiment, the test plug-in performs automatic test of the service scenario according to the configuration of the tester on the test configuration page. Data is retrieved from the database by interacting with the database, such as: reading interface logic information from a scene table of the database, and calling interface configuration information corresponding to each interface to be tested from a step table of the database.
Optionally, in this embodiment, in the process of testing each interface to be tested to obtain the test result corresponding to each interface to be tested:
s41, acquiring the variables to be replaced from the interface configuration information under the condition that the interface configuration information is used for indicating that each interface to be tested needs to replace the variables; replacing the variable in the test process by using the variable to be replaced;
s42, when the interface configuration information is used to indicate that each interface to be tested needs to wait for inquiry, waiting for inquiry and obtaining an inquiry result; and determining the next interface to be tested according to the query result.
Optionally, in this embodiment, whether the corresponding interface needs to replace the global variable may be determined according to the global variable replacement identifier carried in the target interface configuration information. And determining whether to wait for inquiry according to the waiting inquiry identifier carried in the target interface configuration information.
As an alternative embodiment, the test report may be generated, but is not limited to, in the following manner:
s51, reading a check rule and a check parameter under the condition that the test result corresponding to each interface to be tested needs to be calculated and checked;
s52, calculating and checking the test result according to the checking rule and the checking parameter to obtain a checking result;
and S53, generating the test report according to the verification result.
Optionally, in this embodiment, if the test result needs to be calculated and verified, a calculation and verification process of the test result may be executed by reading a preset and stored verification rule and verification parameters, and a test report may be generated according to the verification result obtained in the calculation and verification process.
As an alternative embodiment, before the step S204, one of the following steps is further included:
s61, determining to receive the test starting instruction under the condition that the starting button displayed on the test configuration page is triggered;
and S62, determining to receive the test starting instruction under the condition that the current time reaches the trigger time corresponding to the service scene to be tested.
Optionally, in this embodiment, a start button may be set on the test configuration page to trigger the test process. A trigger time may also be set for the test procedure to initiate the test procedure.
In an optional embodiment, a process of performing an automatic test on a service scene by a background is provided, and fig. 4 is a schematic diagram of an automatic test process according to an optional embodiment of the present application, where as shown in fig. 4, the background automatically performs a test process according to a configuration of a tester on a front-end page, initializes parameters in the scene through a data initialization interface, then executes an interface a according to interface logic information, and an entry parameter of the interface a uses a global variable X to assign a value of an exit parameter-AA of the interface a to a global variable a. And after the interface A is executed, executing an interface B, enabling the input parameter of the interface B to use the output parameter key-a and the global variable a of the interface A, endowing the output parameter key-B of the interface B to the global variable B, then entering a waiting state returning process, calling a query state interface, waiting until the time is up, calling the query state interface again, and if the waiting time is exceeded, returning to fail and terminating execution. Otherwise, the expected value that the returned state meets is determined, if the expected value 1 is met, interface C is executed, if the expected value 2 is met, interface D is executed, and if the expected value 3 is met, interface F is executed. And finally executing to the interface E to judge whether the output key-C of the interface C is equal to the global variable a-the global variable b. If not, determining that the scene execution fails, and if so, determining that the scene execution succeeds. And cleaning the data in the process through a data cleaning interface. After the test, a test report can be generated according to the information obtained in the test and the test result.
In the technical solution provided in step S206, the test report may be, but is not limited to, displayed on a display page, and may also be sent to a designated device for display.
The application also provides an optional embodiment, which provides a visual interface scene automatic test process, an operator can complete the test of the service scene assembled by the interface through page operation configuration and execution, and the automatic regression test of the service scene interface layer can be realized by utilizing the timing task. Fig. 5 is a schematic diagram of an automated testing process of a visualized interface scenario according to an alternative embodiment of the present application, where, as shown in fig. 5, the automated testing process is divided into five stages, and in the page configuration stage, an operator may arrange interfaces and sequences to be executed, and variables to be replaced at each step or result information to be queried. And storing the information configured by the user in a scene table and a step table in the database falling stage. In the front-end trigger execution stage, a user can trigger or set a timing task to trigger the automatic test process through one key at the front end. And in the back-end data reading execution stage, the back-end reads the scene table, executes the scene table according to the arranged interface sequence, performs variable replacement if the variables need to be replaced in the execution process, waits for query if the variables need to be replaced, determines to execute the next step according to the result returned by the query interface, and finally reads the check rule and the parameters to perform result calculation check if the result calculation check needs to be performed. In the report generation phase, a test report is generated.
Through the process, the automatic test of the service scene based on the interface is simpler, time-saving and efficient (saving a lot of time compared with code writing). The requirement on operators is lower, almost people can perform automatic test on interface scenes, and the capability limit of codes is completely released. The execution data can be effectively collected through the platform execution, and later statistical analysis is facilitated.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling an electronic device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiment of the present application, there is also provided an interface testing apparatus for a service scenario, which is used for implementing the interface testing method for the service scenario. Fig. 6 is a schematic diagram of an interface testing apparatus for an alternative service scenario according to an embodiment of the present application, and as shown in fig. 6, the apparatus may include:
the obtaining module 62 is configured to obtain, on the test configuration page, interface logic information configured for the service scenario to be tested and interface configuration information of each interface to be tested;
the test module 64 is configured to, in a case that a test start instruction is received, test the service scenario to be tested according to the interface logic information and the interface configuration information of each interface to be tested, so as to obtain a test report;
and a display module 66, configured to display the test report on a test result page.
It should be noted that the obtaining module 62 in this embodiment may be configured to execute the step S202 in this embodiment, the testing module 64 in this embodiment may be configured to execute the step S204 in this embodiment, and the displaying module 66 in this embodiment may be configured to execute the step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the module, a tester only needs to configure test contents, such as interface logic information, interface configuration information of each interface to be tested and the like, on the test configuration page, and the application can convert the configured information into an actual test process according to the configuration on the test configuration page to test the interface to be tested in a service scene, so that the aims of rapidly configuring the interface information of the service scene and automatically testing the interface of the service scene are fulfilled, the technical effect of improving the interface test efficiency of the service scene is realized, and the technical problem of low interface test efficiency of the service scene is solved.
As an alternative embodiment, the obtaining module includes:
an obtaining unit, configured to obtain the interface logic information input on the test configuration page, where the interface logic information is used to indicate an execution sequence of interfaces to be tested included in the service scenario to be tested;
the receiving unit is used for receiving the interface configuration information input for each interface to be tested;
and the storage unit is used for storing the interface logic information in a scene table of a database and storing the interface configuration information in a step table of the database.
As an alternative embodiment, the receiving unit is configured to:
under the condition that the target interface in the interface logic information is detected to be executed with selection operation, displaying an interface information configuration window corresponding to the target interface;
under the condition that the interface information configuration window is detected to execute the determined operation, converting the data input on the interface information configuration window into target interface configuration information corresponding to the target interface, wherein the target interface configuration information comprises: the target interface configuration information further comprises global variable replacement information, the waiting inquiry identifier is used for indicating whether the target interface needs to wait for inquiry, and the target interface configuration information further comprises waiting inquiry information under the condition that the waiting inquiry identifier is used for indicating that the target interface needs to wait for inquiry.
As an alternative embodiment, the test module comprises:
the reading unit is used for reading the interface logic information from the scene table of the database;
the execution unit is used for executing operation on each interface to be tested according to the execution sequence of the interfaces to be tested indicated by the interface logic information;
the calling unit is used for calling the interface configuration information corresponding to each interface to be tested from the step table of the database in the process of executing operation on each interface to be tested;
the testing unit is used for testing each interface to be tested according to the interface configuration information to obtain a testing result corresponding to each interface to be tested;
and the generating unit is used for generating the test report according to the test result corresponding to each interface to be tested.
As an alternative embodiment, the test unit is configured to:
under the condition that the interface configuration information is used for indicating that each interface to be tested needs to replace a variable, acquiring the variable to be replaced from the interface configuration information; replacing the variable in the test process by using the variable to be replaced;
waiting for inquiry and acquiring an inquiry result under the condition that the interface configuration information is used for indicating that each interface to be tested needs to wait for inquiry; and determining the next interface to be tested according to the query result.
As an alternative embodiment, the generating unit is configured to:
reading a verification rule and a verification parameter under the condition that the test result corresponding to each interface to be tested needs to be calculated and verified;
calculating and checking the test result according to the checking rule and the checking parameter to obtain a checking result;
and generating the test report according to the verification result.
As an alternative embodiment, the apparatus further comprises one of:
the first determining module is used for determining that the test starting instruction is received under the condition that a starting button displayed on the test configuration page is triggered before the test is performed on the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report;
and the second determining module is used for determining to receive the test starting instruction under the condition that the current time reaches the trigger time corresponding to the service scene to be tested before the service scene to be tested is tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the present application, there is also provided an electronic device for implementing the interface testing method for the service scenario.
Fig. 7 is a block diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 7, the electronic device may include: one or more processors 701 (only one of which is shown), a memory 703, and a transmission apparatus 705, which may also include an input/output device 707, as shown in fig. 7.
The memory 703 may be configured to store software programs and modules, such as program instructions/modules corresponding to the interface testing method and apparatus for a service scenario in the embodiment of the present application, and the processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 703, that is, implements the interface testing method for the service scenario. The memory 703 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory 703 may further include memory located remotely from the processor 701, which may be connected to electronic devices through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 705 is used for receiving or transmitting data via a network, and may also be used for data transmission between a processor and a memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 705 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 705 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Among other things, the memory 703 is used to store application programs.
The processor 701 may call the application program stored in the memory 703 through the transmission means 705 to perform the following steps:
acquiring interface logic information configured for a service scene to be tested and interface configuration information of each interface to be tested on a test configuration page;
under the condition of receiving a test starting instruction, testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report;
and displaying the test report on a test result page.
By adopting the embodiment of the application, a scheme for testing the interface of the service scene is provided. The tester only needs to configure the test content, such as interface logic information and interface configuration information of each interface to be tested, on the test configuration page, and the application can convert the configured information into an actual test process according to the configuration on the test configuration page to test the interface to be tested in the service scene, so that the aims of rapidly configuring the interface information of the service scene and automatically testing the interface of the service scene are fulfilled, the technical effect of improving the interface test efficiency of the service scene is achieved, and the technical problem of low interface test efficiency of the service scene is solved.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It will be understood by those skilled in the art that the structure shown in fig. 7 is merely an illustration, and the electronic device may be a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 7 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program for instructing hardware associated with an electronic device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium may be used to execute a program code of an interface testing method of a service scenario.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
acquiring interface logic information configured for a service scene to be tested and interface configuration information of each interface to be tested on a test configuration page;
under the condition of receiving a test starting instruction, testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report;
and displaying the test report on a test result page.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. An interface testing method for a service scenario is characterized by comprising the following steps:
acquiring interface logic information configured for a service scene to be tested and interface configuration information of each interface to be tested on a test configuration page;
under the condition of receiving a test starting instruction, testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested to obtain a test report;
and displaying the test report on a test result page.
2. The method of claim 1, wherein obtaining the interface logic information configured for the service scenario to be tested and the interface configuration information of each interface to be tested on the test configuration page comprises:
acquiring the interface logic information input on the test configuration page, wherein the interface logic information is used for indicating the execution sequence of the to-be-tested interfaces included in the to-be-tested service scene;
receiving the interface configuration information input for each interface to be tested;
storing the interface logic information in a scene table of a database, and storing the interface configuration information in a step table of the database.
3. The method of claim 2, wherein receiving the interface configuration information input for each interface under test comprises:
under the condition that the target interface in the interface logic information is detected to be executed with selection operation, displaying an interface information configuration window corresponding to the target interface;
under the condition that the interface information configuration window is detected to execute the determined operation, converting the data input on the interface information configuration window into target interface configuration information corresponding to the target interface, wherein the target interface configuration information comprises: the target interface configuration information further comprises global variable replacement information, the waiting inquiry identifier is used for indicating whether the target interface needs to wait for inquiry, and the target interface configuration information further comprises waiting inquiry information under the condition that the waiting inquiry identifier is used for indicating that the target interface needs to wait for inquiry.
4. The method of claim 2, wherein testing the service scenario to be tested according to the interface logic information and the interface configuration information of each interface to be tested, and obtaining a test report comprises:
reading the interface logic information from a scene table of the database;
executing operation on each interface to be tested according to the execution sequence of the interfaces to be tested indicated by the interface logic information;
in the process of executing operation on each interface to be tested, calling interface configuration information corresponding to each interface to be tested from the step table of the database;
testing each interface to be tested according to the interface configuration information to obtain a test result corresponding to each interface to be tested;
and generating the test report according to the test result corresponding to each interface to be tested.
5. The method of claim 4, wherein testing each interface to be tested according to the interface configuration information to obtain a test result corresponding to each interface to be tested comprises:
under the condition that the interface configuration information is used for indicating that each interface to be tested needs to replace a variable, acquiring the variable to be replaced from the interface configuration information; replacing the variable in the test process by using the variable to be replaced;
waiting for inquiry and acquiring an inquiry result under the condition that the interface configuration information is used for indicating that each interface to be tested needs to wait for inquiry; and determining the next interface to be tested according to the query result.
6. The method of claim 4, wherein generating the test report according to the test result corresponding to each interface to be tested comprises:
reading a verification rule and a verification parameter under the condition that the test result corresponding to each interface to be tested needs to be calculated and verified;
calculating and checking the test result according to the checking rule and the checking parameter to obtain a checking result;
and generating the test report according to the verification result.
7. The method of claim 1, wherein before the service scenario to be tested is tested according to the interface logic information and the interface configuration information of each interface to be tested, and a test report is obtained, the method further comprises one of:
determining to receive the test starting instruction under the condition that a starting button displayed on the test configuration page is triggered;
and determining to receive the test starting instruction under the condition that the current time reaches the trigger time corresponding to the service scene to be tested.
8. An interface testing apparatus for a service scenario, comprising:
the acquisition module is used for acquiring interface logic information configured for the service scene to be tested and interface configuration information of each interface to be tested on a test configuration page;
the test module is used for testing the service scene to be tested according to the interface logic information and the interface configuration information of each interface to be tested under the condition of receiving a test starting instruction to obtain a test report;
and the display module is used for displaying the test report on a test result page.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 7 by means of the computer program.
CN202011008059.7A 2020-09-23 2020-09-23 Interface testing method and device for service scene Pending CN112148607A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011008059.7A CN112148607A (en) 2020-09-23 2020-09-23 Interface testing method and device for service scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011008059.7A CN112148607A (en) 2020-09-23 2020-09-23 Interface testing method and device for service scene

Publications (1)

Publication Number Publication Date
CN112148607A true CN112148607A (en) 2020-12-29

Family

ID=73897876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011008059.7A Pending CN112148607A (en) 2020-09-23 2020-09-23 Interface testing method and device for service scene

Country Status (1)

Country Link
CN (1) CN112148607A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434405A (en) * 2021-06-24 2021-09-24 青岛海尔科技有限公司 Method and device for determining test file, storage medium and electronic device
CN113553235A (en) * 2021-07-19 2021-10-26 猪八戒股份有限公司 Business scene monitoring method and device, electronic equipment and storage medium
CN113704133A (en) * 2021-09-10 2021-11-26 广西东信易通科技有限公司 Interface test organization method and system and computer equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6785540B1 (en) * 1999-11-30 2004-08-31 Agilent Technologies, Inc. Monitoring system and method implementing test configuration logic
CN107977308A (en) * 2016-10-25 2018-05-01 传化物流集团有限公司 interface test method and device
CN109614310A (en) * 2018-10-22 2019-04-12 中国平安财产保险股份有限公司 Management method, device, computer equipment and the storage medium of test interface
CN110147320A (en) * 2019-04-19 2019-08-20 平安普惠企业管理有限公司 Interface test method, device and electronic equipment
CN110795328A (en) * 2018-08-01 2020-02-14 北京京东尚科信息技术有限公司 Interface testing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6785540B1 (en) * 1999-11-30 2004-08-31 Agilent Technologies, Inc. Monitoring system and method implementing test configuration logic
CN107977308A (en) * 2016-10-25 2018-05-01 传化物流集团有限公司 interface test method and device
CN110795328A (en) * 2018-08-01 2020-02-14 北京京东尚科信息技术有限公司 Interface testing method and device
CN109614310A (en) * 2018-10-22 2019-04-12 中国平安财产保险股份有限公司 Management method, device, computer equipment and the storage medium of test interface
CN110147320A (en) * 2019-04-19 2019-08-20 平安普惠企业管理有限公司 Interface test method, device and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434405A (en) * 2021-06-24 2021-09-24 青岛海尔科技有限公司 Method and device for determining test file, storage medium and electronic device
CN113434405B (en) * 2021-06-24 2023-06-13 青岛海尔科技有限公司 Method and device for determining test file, storage medium and electronic device
CN113553235A (en) * 2021-07-19 2021-10-26 猪八戒股份有限公司 Business scene monitoring method and device, electronic equipment and storage medium
CN113704133A (en) * 2021-09-10 2021-11-26 广西东信易通科技有限公司 Interface test organization method and system and computer equipment

Similar Documents

Publication Publication Date Title
CN111522922B (en) Log information query method and device, storage medium and computer equipment
CN112148607A (en) Interface testing method and device for service scene
CN105787364B (en) Automatic testing method, device and system for tasks
CN110833693B (en) Game running method and device, storage medium and electronic device
CN111782635B (en) Data processing method and device, storage medium and electronic device
CN106326120B (en) Regression testing method and device for application software and electronic equipment
CN105303112A (en) Component calling bug detection method and apparatus
CN111124567B (en) Operation recording method and device for target application
CN110489324A (en) Method, apparatus that test page jumps, storage medium, electronic device
CN112148606B (en) Buried point test method, buried point test device, buried point test equipment and computer readable medium
CN107463391B (en) Task processing method, device and equipment
CN109828920A (en) A kind of log analysis method, device and computer readable storage medium
CN111782317A (en) Page testing method and device, storage medium and electronic device
CN114356631A (en) Fault positioning method and device, computer equipment and storage medium
CN112306471A (en) Task scheduling method and device
CN110399723B (en) Vulnerability detection method and device, storage medium and electronic device
CN110674023B (en) Interface testing method and device
CN111045879A (en) Pressure test report generation method and device and storage medium
CN111708712A (en) User behavior test case generation method, flow playback method and electronic equipment
CN110825609B (en) Service testing method, device and system
CN110704307A (en) Application product testing method and device, user equipment and computer storage medium
CN114978360A (en) Automatic testing method and device for communication equipment, electronic equipment and storage medium
CN111210279B (en) Target user prediction method and device and electronic equipment
CN111782291A (en) Test page starting method and device
CN111552634A (en) Method and device for testing front-end system and storage medium

Legal Events

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