CN112363944A - Method and equipment for comparing return values of multiple environment interfaces - Google Patents

Method and equipment for comparing return values of multiple environment interfaces Download PDF

Info

Publication number
CN112363944A
CN112363944A CN202011312254.9A CN202011312254A CN112363944A CN 112363944 A CN112363944 A CN 112363944A CN 202011312254 A CN202011312254 A CN 202011312254A CN 112363944 A CN112363944 A CN 112363944A
Authority
CN
China
Prior art keywords
return
interface
result
environment
values
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
CN202011312254.9A
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.)
Shanghai Yueyi Network Information Technology Co Ltd
Original Assignee
Shanghai Yueyi Network Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Yueyi Network Information Technology Co Ltd filed Critical Shanghai Yueyi Network Information Technology Co Ltd
Priority to CN202011312254.9A priority Critical patent/CN112363944A/en
Publication of CN112363944A publication Critical patent/CN112363944A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

The application aims at providing a method and equipment for comparing return values of multiple environment interfaces, wherein relevant information of an interface is input, wherein the relevant information comprises an interface domain name, a path, main equipment information and cookie information; acquiring a first return result of an interface request of an online environment and a second return result of the interface request of a specified main equipment environment; processing the first return result and the second return result and comparing the corresponding interface return values to obtain a comparison result; and storing the comparison result and the interface return value into a database. Thereby greatly shortening the time of the regression test of the multi-environment interface.

Description

Method and equipment for comparing return values of multiple environment interfaces
Technical Field
The present application relates to the field of computers, and in particular, to a method and apparatus for multi-environment interface return value comparison.
Background
In the daily test process, the service function is often not modified, but a plurality of server interfaces are required to be tested in a regression manner, for example, fastjson upgrading is performed, a console interface is switched from an http interface to an jsf interface, sometimes, more than 100 interfaces are involved in early stage fastjson upgrading, the manual regression testing of the interfaces needs at least 3 days, the efficiency is low, and the time is wasted.
Disclosure of Invention
An object of the present application is to provide a method and an apparatus for comparing return values of multiple environment interfaces, which solve the problem of low test efficiency when manual regression test interfaces are required in the prior art.
According to one aspect of the present application, there is provided a method for multi-environment interface return value comparison, the method comprising:
inputting relevant information of an interface, wherein the relevant information comprises an interface domain name, a path, main equipment information and cookie information;
acquiring a first return result of an interface request of an online environment and a second return result of the interface request of a specified main equipment environment;
processing the first return result and the second return result and comparing the corresponding interface return values to obtain a comparison result;
and storing the comparison result and the interface return value into a database.
Further, the processing the first returned result and the second returned result includes:
removing the timestamp fields in the first returned result and the second returned result.
Further, comparing the corresponding interface return values after processing the first return result and the second return result, including:
and judging whether the passwords of the return values of the first return result and the second return result with the timestamp fields removed are the specified values, and if so, comparing the corresponding interface return values.
Further, after storing the comparison result and the interface return value into the database, the method includes:
and displaying the comparison result in the front-end list, and displaying the comparison detail information based on the acquired query request.
Further, comparing the corresponding interface return values after processing the first return result and the second return result, including:
and judging whether the passwords of the return values of the first return result and the second return result with the timestamp fields removed are the specified values, and if not, checking the record information of the return results of the history interfaces of the online environment and the specified main equipment environment.
Further, after obtaining a first return result of the interface request of the online environment and a second return result of the interface request of the specified host device environment, the method includes:
and if the first return result and/or the second return result are/is failure, judging whether the input related information of the interface is correct and judging whether the interface can be called.
According to yet another aspect of the present application, there is also provided an apparatus for multi-environment interface return value comparison, the apparatus including:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method as previously described.
According to yet another aspect of the present application, there is also provided a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the method as described above.
Compared with the prior art, the method and the device have the advantages that the relevant information of the interface is input, wherein the relevant information comprises the interface domain name, the path, the main equipment information and the cookie information; acquiring a first return result of an interface request of an online environment and a second return result of the interface request of a specified main equipment environment; processing the first return result and the second return result and comparing the corresponding interface return values to obtain a comparison result; and storing the comparison result and the interface return value into a database. Thereby greatly shortening the time of the regression test of the multi-environment interface.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a method flow diagram for multi-environment interface return value comparison provided in accordance with an aspect of the present application;
FIG. 2 illustrates a schematic diagram of an interface page in an embodiment of the present application;
FIG. 3 is a flow chart illustrating a method for interface comparison between two environments in an embodiment of the present application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (e.g., Central Processing Units (CPUs)), input/output interfaces, network interfaces, and memory.
The Memory may include volatile Memory in a computer readable medium, Random Access Memory (RAM), and/or nonvolatile Memory such as Read Only Memory (ROM) or flash Memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, Phase-Change RAM (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other Memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassette tape, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
FIG. 1 illustrates a flow diagram of a method for multi-environment interface return value comparison, according to an aspect of the present application, the method comprising: step S11-step S14, wherein in step S11, relevant information of the interface is recorded, wherein the relevant information comprises an interface domain name, a path, main equipment information and cookie information; in step S12, a first return result of the interface request of the online environment and a second return result of the interface request of the specified host apparatus environment are acquired; in step S13, after the first return result and the second return result are processed, the corresponding interface return values are compared to obtain a comparison result; in step S14, the comparison result and the interface return value are stored in a database. Therefore, the time of the regression test of the multi-environment interface is greatly shortened.
Specifically, in step S11, relevant information of the interface is entered, where the relevant information includes an interface domain name, a path, master device information, and cookie information; here, the interface is a server interface, and an interface page may be created, and information related to the interface, that is, an interface domain name, a path, master device information (host), and cookie information, may be entered on the interface page, as shown in fig. 2.
Specifically, in step S12, a first return result of the interface request of the online environment and a second return result of the interface request of the specified host device environment are acquired; the input relevant information of the interface can be stored in the interface list page, that is, the interface list page has a plurality of tasks, and each task corresponds to the relevant information of each interface, so that relevant operations such as comparison, editing, deletion, history viewing and the like can be performed on the interface. When the comparison operation is carried out, requesting an online environment interface and returning a first return result corresponding to the online environment, requesting to designate an interface of a main equipment (host) environment and returning a second return result corresponding to the host environment, so as to obtain return results of two different environments for subsequent comparison; wherein, the host environment is a pre-sending environment or a testing environment.
Specifically, in step S13, after the first return result and the second return result are processed, the corresponding interface return values are compared to obtain a comparison result; comparing the obtained return results of the two environments, namely comparing the first return result with the second return result, processing the two return results to obtain an interface return value during comparison, and comparing the interface return values to obtain a comparison result; the first return result comprises a password, a timestamp field, a file name, modified file attribute information, character string matching information and the like, and the structure of the second return result is the same as that of the first return result.
Specifically, in step S14, the comparison result and the interface return value are stored in the database. And storing the interface return values corresponding to the two environments obtained by the processing according to the comparison result, and inputting the interface return values into a database so as to check the historical comparison result in the following process.
In an embodiment of the present application, in step S13, the timestamp fields in the first returned result and the second returned result are removed. Here, when processing the returned results of the two environments, the timestamp field in each returned result is removed, for example, currentTime is removed. The timestamp field can be carried in the interface return value in every request, and the timestamp is the time of current server, and accurate to the millisecond, has precedence when requesting online interface and pre-sent interface to the timestamp in pre-sent interface and the online interface return value is different, need remove the timestamp in order to can accurately carry out the contrast of online interface and pre-sent interface.
Next to the above embodiment, in step S13, it may be determined whether the passwords of the return values of the first return result and the second return result from which the timestamp fields are removed are the specified values, and if so, the corresponding interface return values are compared. Here, it is determined whether a code (code) of a returned value in the returned result is a specified value, for example, when the unified specification of the interface is 200, it is determined whether the returned code is 200, if so, the interface data is normal, and when the returned code is not 200, for example, 500, 501, 777, and the like, the interface is abnormal.
In an embodiment of the present application, after the comparison result and the interface return value are stored in the database, the comparison result may be displayed in a front-end list, and the comparison detail information may be displayed based on the acquired query request. Here, the comparison result of the two environments is displayed in the front-end list, so that whether the online environment interface passes the test or not can be judged, and the detail information of the comparison result is displayed based on the query request of the user.
In an embodiment of the present application, in step S13, it is determined whether the password with the returned values of the first returned result and the second returned result of the timestamp field removed is a specified value, and if not, the record information of the returned results of the history interfaces of the online environment and the specified host device environment is checked. If the code of the return value of the return result is not 200, the return of the interface of the online environment is inconsistent with the return of the interface of the pre-sending environment, and the user is prompted to view historical record information, wherein the historical record information comprises the return results of the historical interfaces of the two environments.
In an embodiment of the present application, after a first return result of an interface request of an online environment and a second return result of an interface request of an appointed master device environment are obtained, if the first return result and/or the second return result are/is a failure, it is determined whether the entered relevant information of the interface is correct and whether the interface can be called. Here, if the return result of the online environment is failure, or the return result of the main device environment is failure, or both the return results are failure, it is necessary to determine whether the related information of the entered interface of the server is correct, and whether the entered interface can be called up, so as to check the cause.
In a specific embodiment of the present application, as shown in fig. 3, an interface domain name, a path, a host, and a cookie are first entered, and the entered information is stored and executed; then, requesting an online environment interface and returning a result, and requesting an interface of a specified host environment and returning a result, removing a timestamp field in the returned results of the online and specified host interfaces, such as currentTime, judging whether codes of two environment returned values are 200, if not, judging that a comparison result is failure, storing the comparison result and the interface returned values into a database, if so, comparing the returned values of the two environments, then storing the comparison result and the interface returned values into the database, displaying the comparison result in a front-end list, inquiring the specific returned values of the comparison detail interface, and also visually distinguishing the specific returned values, thereby greatly shortening the test regression time.
Furthermore, the embodiment of the present application also provides a computer readable medium, on which computer readable instructions are stored, the computer readable instructions being executable by a processor to implement the aforementioned method for multi-environment interface return value comparison.
In an embodiment of the present application, there is further provided an apparatus for multi-environment interface return value comparison, the apparatus including:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method as previously described.
For example, the computer readable instructions, when executed, cause the one or more processors to:
inputting relevant information of an interface, wherein the relevant information comprises an interface domain name, a path, main equipment information and cookie information;
acquiring a first return result of an interface request of an online environment and a second return result of the interface request of a specified main equipment environment;
processing the first return result and the second return result and comparing the corresponding interface return values to obtain a comparison result;
and storing the comparison result and the interface return value into a database.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (8)

1. A method for multi-environment interface return value comparison, the method comprising:
inputting relevant information of an interface, wherein the relevant information comprises an interface domain name, a path, main equipment information and cookie information;
acquiring a first return result of an interface request of an online environment and a second return result of the interface request of a specified main equipment environment;
processing the first return result and the second return result and comparing the corresponding interface return values to obtain a comparison result;
and storing the comparison result and the interface return value into a database.
2. The method of claim 1, wherein processing the first returned result and the second returned result comprises:
removing the timestamp fields in the first returned result and the second returned result.
3. The method of claim 2, wherein comparing the corresponding interface return values after processing the first return result and the second return result comprises:
and judging whether the passwords of the return values of the first return result and the second return result with the timestamp fields removed are the specified values, and if so, comparing the corresponding interface return values.
4. The method of claim 1, wherein storing the comparison result and the interface return value in a database comprises:
and displaying the comparison result in the front-end list, and displaying the comparison detail information based on the acquired query request.
5. The method of claim 2, wherein comparing the corresponding interface return values after processing the first return result and the second return result comprises:
and judging whether the passwords of the return values of the first return result and the second return result with the timestamp fields removed are the specified values, and if not, checking the record information of the return results of the history interfaces of the online environment and the specified main equipment environment.
6. The method of claim 1, wherein obtaining the first returned result of the interface request of the online environment and the second returned result of the interface request of the specified host device environment comprises:
and if the first return result and/or the second return result are/is failure, judging whether the input related information of the interface is correct and judging whether the interface can be called.
7. An apparatus for multi-environment interface return value comparison, the apparatus comprising:
one or more processors; and
memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method of any of claims 1 to 6.
8. A computer readable medium having computer readable instructions stored thereon which are executable by a processor to implement the method of any one of claims 1 to 6.
CN202011312254.9A 2020-11-20 2020-11-20 Method and equipment for comparing return values of multiple environment interfaces Pending CN112363944A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011312254.9A CN112363944A (en) 2020-11-20 2020-11-20 Method and equipment for comparing return values of multiple environment interfaces

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011312254.9A CN112363944A (en) 2020-11-20 2020-11-20 Method and equipment for comparing return values of multiple environment interfaces

Publications (1)

Publication Number Publication Date
CN112363944A true CN112363944A (en) 2021-02-12

Family

ID=74533069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011312254.9A Pending CN112363944A (en) 2020-11-20 2020-11-20 Method and equipment for comparing return values of multiple environment interfaces

Country Status (1)

Country Link
CN (1) CN112363944A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174495A (en) * 2022-06-20 2022-10-11 平安银行股份有限公司 Resource allocation method based on parallel routing and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107193747A (en) * 2017-05-27 2017-09-22 北京金山安全软件有限公司 Code testing method and device and computer equipment
CN108170612A (en) * 2018-01-23 2018-06-15 百度在线网络技术(北京)有限公司 A kind of automated testing method, device and server
CN109739700A (en) * 2018-12-12 2019-05-10 中国联合网络通信集团有限公司 A kind of interface test method and device
CN111190808A (en) * 2018-11-14 2020-05-22 北京京东尚科信息技术有限公司 Automated testing method, system, device and computer readable storage medium
CN111552632A (en) * 2020-03-27 2020-08-18 北京奇艺世纪科技有限公司 Interface testing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107193747A (en) * 2017-05-27 2017-09-22 北京金山安全软件有限公司 Code testing method and device and computer equipment
CN108170612A (en) * 2018-01-23 2018-06-15 百度在线网络技术(北京)有限公司 A kind of automated testing method, device and server
CN111190808A (en) * 2018-11-14 2020-05-22 北京京东尚科信息技术有限公司 Automated testing method, system, device and computer readable storage medium
CN109739700A (en) * 2018-12-12 2019-05-10 中国联合网络通信集团有限公司 A kind of interface test method and device
CN111552632A (en) * 2020-03-27 2020-08-18 北京奇艺世纪科技有限公司 Interface testing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174495A (en) * 2022-06-20 2022-10-11 平安银行股份有限公司 Resource allocation method based on parallel routing and related equipment

Similar Documents

Publication Publication Date Title
CN106656536B (en) Method and equipment for processing service calling information
CN111221743B (en) Automatic test method and system
CN107122296B (en) Method and apparatus for data assertion for test interface
CN107092535B (en) Method and apparatus for data storage of test interface
CN107943694B (en) Test data generation method and device
US9940215B2 (en) Automatic correlation accelerator
CN111444101A (en) Method and device for automatically creating product test defects
CN112363944A (en) Method and equipment for comparing return values of multiple environment interfaces
CN110147313B (en) Log output method and device
CN116738091A (en) Page monitoring method and device, electronic equipment and storage medium
CN112256984A (en) Method and device for acquiring interface background screenshot corresponding to webpage
CN111767213A (en) Method and device for testing database check points, electronic equipment and storage medium
CN111639094A (en) Chemical product formula retrieval implementation method and device and storage medium
CN112835779A (en) Test case determination method and device and computer equipment
CN114465926B (en) Recursive server monitoring method, device, equipment and storage medium
CN116010244A (en) Automatic test method, device, electronic equipment and storage medium
CN112148721B (en) Data checking method and device, electronic equipment and storage medium
CN114330278A (en) Method and equipment for judging consistency of returned data
CN112631905A (en) Execution process data management method and device, computer equipment and storage medium
CN113742213A (en) Method, system, and medium for data analysis
US8321844B2 (en) Providing registration of a communication
CN112631929A (en) Test case generation method and device, storage medium and electronic equipment
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN117130946B (en) Test scene generation method and device, electronic equipment and readable storage medium
CN113392022B (en) Test requirement analysis method, device, computer readable medium and program product

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
CB02 Change of applicant information

Address after: Room 1101-1103, No. 433, Songhu Road, Yangpu District, Shanghai

Applicant after: Shanghai wanwansheng Environmental Protection Technology Group Co.,Ltd.

Address before: Room 1101-1103, No. 433, Songhu Road, Yangpu District, Shanghai

Applicant before: SHANGHAI YUEYI NETWORK INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20210212

RJ01 Rejection of invention patent application after publication