CN107092535A - Method and apparatus for the data storage of test interface - Google Patents

Method and apparatus for the data storage of test interface Download PDF

Info

Publication number
CN107092535A
CN107092535A CN201710253456.2A CN201710253456A CN107092535A CN 107092535 A CN107092535 A CN 107092535A CN 201710253456 A CN201710253456 A CN 201710253456A CN 107092535 A CN107092535 A CN 107092535A
Authority
CN
China
Prior art keywords
local
data
stored
interface
file
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.)
Granted
Application number
CN201710253456.2A
Other languages
Chinese (zh)
Other versions
CN107092535B (en
Inventor
刘涛
唐远征
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Lei Teng Software Ltd Co
Original Assignee
Shanghai Lei Teng Software Ltd Co
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 Lei Teng Software Ltd Co filed Critical Shanghai Lei Teng Software Ltd Co
Priority to CN201710253456.2A priority Critical patent/CN107092535B/en
Publication of CN107092535A publication Critical patent/CN107092535A/en
Application granted granted Critical
Publication of CN107092535B publication Critical patent/CN107092535B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0787Storage of error reports, e.g. persistent data storage, storage using memory protection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Abstract

The purpose of the application is to provide a kind of method and apparatus of the data storage for test interface, and the application is by obtaining the data to be stored for test interface;Local folders are obtained according to the configuration file of the test interface;Environment, port name according to where the request of the test interface create local file in the local folders;It is stored in after the data to be stored are formatted into processing in the local file.So as to which the data of critical data or reuse be stored in locally, local file read-write capability is realized, and processing is formatted to data to be stored, with dictionary type data storage, subsequent read data then can find corresponding value by the key in dictionary.

Description

Method and apparatus for the data storage of test interface
Technical field
The application is related to computer realm, more particularly to a kind of data storage for test interface method and apparatus.
Background technology
With the development of test industry, functional test, performance test and automatic test are successively occurred in that, at present, big portion The framework for dividing platform has no longer been traditional MVC structures, and system is constantly towards distribution, service center and high availability Direction is developed, system architecture numerous and complicated of today, and the interface between system is numerous and jumbled various, traditional functional test, performance test The demand that meets System Development has been difficult to it with automatic test, in the urgent need to one kind is more efficient practical and can continue to carry out Test mode ensure the quality of system, the test of traditional interface testing mainly for individual interface, it is impossible to carry out multiple The returned data of front interface, not Easy Test and iteratively faster are tested and can not transmitted in the linkage of interface.
At present, the Postman of appearance, is to adapt to most of business scenario, conveniently an interface testing instrument, The flow chart of overall architecture thinking is as shown in figure 1, configuration registry interface parameters first, SID is obtained after logining successfully from server (SessionId, the unique mark of session) then, replicates SID to the message header of tested interface manually as reliable session tokens (Headers) in, other specification is normally written, and sends request, after being finished, and is obtained interface returned data and is returned, checks Whether interface returned data is expected results.Above-mentioned framework, it is impossible to reading and writing of files, when calling non-login interface every time, is required for Reacquire new SID, complex operation, not convenient and easy error.
Apply for content
The purpose of the application is to provide a kind of method and apparatus of the data storage for test interface, solves existing The problem of critical data in technology needed for test interface can not locally be read and write.
According to the one side of the application, there is provided a kind of method of the data storage for test interface, this method bag Include:
Obtain the data to be stored for test interface;
Local folders are obtained according to the configuration file of the test interface;
Environment, port name according to where the request of the test interface create local text in the local folders Part;
It is stored in after the data to be stored are formatted into processing in the local file.
Further, it is stored in after the data to be stored being formatted into processing in the local file, including:
The data to be stored are formatted and are processed as dictionary type, and are stored in the local file.
Further, local folders are obtained according to the configuration file of the test interface, including:
The store path of the data to be stored is obtained from the configuration file of the test interface;
According to the store path judge it is local whether existing local folders, if so, then obtaining the local file Folder, if it is not, then generating the corresponding local folders of the configuration file.
Further, the data to be stored include the corresponding session unique identification information of the test interface.
Further, the data to be stored are formatted after being stored in after processing in the local file, bag Include:
Account in the configuration file obtains the corresponding session of the test interface only from the local file One identification information.
Further, the account in the configuration file obtains the test interface correspondence from the local file Session unique identification information before, including:
If test interface is non-login interface, the request of non-login interface is obtained;
Login interface to be called is determined according to the request of the non-login interface;
The configuration file is determined according to the login interface to be called.
Further, the account in the configuration file obtains the test interface correspondence from the local file Session unique identification information, including:
Account in the configuration file obtains the login interface correspondence to be called from the local file Session unique identification information;
The session unique mark that the session unique identification information is carried out data transmission as the non-login interface.
Further, the account in the configuration file obtains the test interface correspondence from the local file Session unique identification information, including:
The request that account in the configuration file obtains the test interface from the local file is corresponding Key assignments;
The corresponding value of the key assignments is determined in the dictionary according to the key assignments, the value of the determination is regard as the meeting Talk about unique identification information.
According to the application on the other hand, a kind of equipment of the data storage for test interface is additionally provided, it is described to set It is standby to include:
First acquisition device, for obtaining the data to be stored for test interface;
Second acquisition device, for obtaining local folders according to the configuration file of the test interface;
Creating device, for the environment where the request according to the test interface, port name in the local file Local file is created in folder;
Storage device, for being stored in after the data to be stored are formatted into processing in the local file.
Further, the storage device is used for:
The data to be stored are formatted and are processed as dictionary type, and are stored in the local file.
Further, second acquisition device is used for:
The store path of the data to be stored is obtained from the configuration file of the test interface;
According to the store path judge it is local whether existing local folders, if so, then obtaining the local file Folder, if it is not, then generating the corresponding local folders of the configuration file.
Further, the data to be stored include the corresponding session unique identification information of the test interface.
Further, the equipment also includes:
Inquiry unit, the test interface is obtained for the account in the configuration file from the local file Corresponding session unique identification information.
Further, the equipment includes:
Acquisition request device, if being non-login interface for test interface, obtains the request of non-login interface;
Calling device, login interface to be called is determined for the request according to the non-login interface;
Determining device, for determining the configuration file according to the login interface to be called.
Further, the inquiry unit is used for:
Account in the configuration file obtains the login interface correspondence to be called from the local file Session unique identification information;
The session unique mark that the session unique identification information is carried out data transmission as the non-login interface.
Further, the inquiry unit is used for:
The request that account in the configuration file obtains the test interface from the local file is corresponding Key assignments;
The corresponding value of the key assignments is determined in the dictionary according to the key assignments, the value of the determination is regard as the meeting Talk about unique identification information.
Compared with prior art, the application is by obtaining the data to be stored for test interface;Connect according to the test The configuration file of mouth obtains local folders;Environment, port name according to where the request of the test interface is at described Local file is created in ground file;It is stored in after the data to be stored are formatted into processing in the local file. So as to which the data of critical data or reuse be stored in locally, local file read-write capability is realized.Further, treat and deposit The data of storage are formatted processing, and with dictionary type data storage, subsequent read data can then be looked into by the key in dictionary Find corresponding value.
Brief description of the drawings
By reading the detailed description made to non-limiting example made with reference to the following drawings, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 shows the configuration diagram of interface testing in the prior art;
Fig. 2 shows the interface architecture schematic diagram of high-efficiency layered server end in the embodiment of the application one;
Fig. 3 shows a kind of method flow of the data storage for test interface provided according to the one side of the application Schematic diagram;
Fig. 4 shows to be used for the flow chart of the data storage of test interface in the embodiment of the application one;
Fig. 5 shows a kind of device structure of the data storage for test interface provided on the other hand according to the application Schematic diagram;
Same or analogous reference represents same or analogous part in accompanying drawing.
Embodiment
The application is described in further detail below in conjunction with the accompanying drawings.
In one typical configuration of the application, terminal, the equipment of service network and trusted party include one or more Processor (CPU), input/output interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM), Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, magnetic disk storage or other magnetic storage apparatus or Any other non-transmission medium, the information that can be accessed by a computing device available for storage.Defined according to herein, computer Computer-readable recording medium does not include the data-signal and carrier wave of non-temporary computer readable media (transitory media), such as modulation.
Fig. 2 shows the interface architecture schematic diagram of high-efficiency layered server end in the embodiment of the application one;Run Script first, It is loaded into environment, URL (URL), port name, account, required parameter, asserts condition, structured query sentence (SQL statement);Then, configuration file is loaded into, according to account, the session unique mark (SID) of local file storage is taken out, is loaded into Encrypted template generates encryption information, is automatically generated after legal message header (header), request interface, passed through according to incoming parameter Analysis server returned content judges whether interface correctly handles the request, if so, message body (Body) content is then taken out, when Associated databases are connected during incoming SQL statement, SQL statement is performed, Query Result is returned and is processed as JSON forms, by traveling through key (key) mode verifies whether corresponding value (value) is correct, if correctly, test passes through, if failure, output epicycle is surveyed Test result;When the Body contents of taking-up do not have incoming SQL statement, flow is asserted into static state, by asserting condition judgment knot Whether fruit meets business need, if so, then test passes through, if it is not, then test crash, determines whether other use being not carried out Example, next use-case is read if having and is tested.When the interface called is not handled correctly, then judge whether SID is expired, if It is out of date, then login module is called, according to environment, request end generates parameter, the encryption information of login, if logining successfully, The SID of acquisition deposits local file in key-value pair form, and the SID that local file is deposited is taken out according to account, performs above-mentioned test Process.When interface is not handled correctly and SID is not out of date, if taking out error information expected results, then it is successfully tested.
By the interface testing configuration diagram shown in Fig. 2, the problem of script versatility is not strong is solved, by data Designed with shallow-layer encapsulation, the prototype pattern of module etc., make script after receiving and performing order, excessively join without manual configuration Number, you can automatically generate corresponding parameter sets, realization is fast, easily performed.Solve asking for local reading and writing of files Topic, critical data is preserved to local, and it is dictionary (Dictionary) to preserve form, and the later stage reads data, then passes through key (key) corresponding value (value) can be found, the problem of can not introducing external libraries is solved, and the data after encryption are direct Call function is returned, the problem of can not reading and writing database is solved, the database specified can be connected and obtain or update test correlation Data, solve the problem of mode of asserting is excessively single, obtain after interface returned data and data base querying data, with key- The mode that value is compared, can quickly, largely judge to assert whether interface data is accurate, meanwhile, use above-mentioned framework, Ke Yikai Application programming interfaces (API) are put to other tests or open frame, can be expanded.
Using the test mode of the interface architecture schematic diagram shown in above-mentioned Fig. 2, wherein, it is main on the function of locally reading and writing It is embodied in the local preservation of data that are crucial or reusing.Concrete implementation mode is realized by following examples:
Fig. 3 shows a kind of method flow of the data storage for test interface provided according to the one side of the application Schematic diagram, this method includes:Step S11~step S14, wherein, in step s 11, obtain for the to be stored of test interface Data;In step s 12, local folders are obtained according to the configuration file of the test interface;In step s 13, according to institute State the environment where the request of test interface, port name and create local file in the local folders;In step S14 In, it is stored in after the data to be stored are formatted into processing in the local file.So as to by critical data or repetition The data used are stored in locally, realize local file read-write capability.
Specifically, in step s 11, the data to be stored for test interface are obtained;Here, the data to be stored are For the critical data or the data of reuse of test interface, if may be implemented in local preservation, in follow-up inquired about Directly from local reading, login interface is called so as to reduce, server resource is saved.
Specifically, in step s 12, local folders are obtained according to the configuration file of the test interface;Here, obtaining , it is necessary to save it in locally after to data to be stored, obtained according to the configuration file of test interface be used for storing waiting to deposit first Store up data local folders, wherein, configuration file include project name, environment title, the login account of database, password, Address, host domain name, client name, local file store path etc., in test interface, it is necessary to critical data or repetition If the data used are stored in local file, server resource is easy to use and saved, locally read-write capability is being realized, is entering The local local file for whether having storage critical data or reusing data is got during row data storage from configuration file Folder, so as to which this kind of data to be stored are preserved into local folders.
Specifically, in step s 13, environment according to where the request of the test interface, port name are at described Local file is created in ground file;Here, environment refers to for computer hardware necessary to completing Experience of Software Testing Work, soft Part, the network equipment, the general name of historical data, environment can be test environment, or development environment or other application Environment, the local file created is the storage file form of data to be stored, such as can be text, different environment, Port name can correspond to the title of different texts, so as to it is follow-up correct, rapidly read stored data.
Specifically, in step S14, the local file is stored in after the data to be stored are formatted into processing In.Default storage format is processed into here, data to be stored are formatted, to be stored in local file, lattice Formulaization processing includes being processed as dictionary format, character string, list etc., in the embodiment of the application one, by the data to be stored It is formatted and is processed as dictionary type, and be stored in the local file, here, data to be stored is entered with dictionary type Go and store, because dictionary type is that key-value pair mode sets up data, wherein, key (key) is index, and value (value) is to need preservation Data, so as to subsequent read, update.
Preferably, in step s 12, the storage of the data to be stored is obtained from the configuration file of the test interface Path;According to the store path judge it is local whether existing local folders, if so, then obtain the local folders, If it is not, then generating the corresponding local folders of the configuration file.In the embodiment of the application one, read configuration file, from The store path that data to be stored are obtained in file is put, and checks whether the path has been present, it is local literary if being determined in the presence of if Part is pressed from both sides, if being not present, generates local folders, file consolidation is stored in file, be easy to manage and inquire about.
Preferably, the data to be stored include the corresponding session unique identification information of the test interface.In the application In one embodiment, session unique identification information (SID) is a key and the data reused, for after login interface, Server gives user one mark, it was demonstrated that the user is legal and logged user, when the user asks other interfaces again, SID needs to be included in, it is therefore desirable to local to preserve.
In the embodiment of the application one, the local file is stored in after the data to be stored are formatted into processing In after, methods described includes:Step S15, described in the account in the configuration file is obtained from the local file The corresponding session unique identification information of test interface.Here, the account in configuration file obtains the test interface correspondence Session unique mark (SID) be used for recognize user, can as calling interface validation certificate, it is to avoid repetition call, it is another Aspect, it is ensured that the safety of server.It should be noted that SID has the term of validity, for example, some time that afternoon engraves record New SID, then in one day from this moment, when calling non-login interface, can get the new record SID, it is not necessary to repeat to obtain from login interface.Believed in fig. 2 according to environment, the parameter of request port generation login and encryption Breath, after logining successfully, because the account in locally stored also not out of date SID, therefore in configuration file is from local text SID is obtained in part, for follow-up data communication.
In the embodiment of the application one, the account in the configuration file obtains the survey from the local file Before the corresponding session unique identification information of mouth of trying, methods described includes:Step S151, if test interface connects for non-login Mouthful, then obtain the request of non-login interface;Step S152, determines that login to be called connects according to the request of the non-login interface Mouthful;Step S153, the configuration file is determined according to the login interface to be called.Here, interface is divided into according to function Two major classes:In login interface and non-login interface, such as returned ticket flow, " login interface-booking interface-returned ticket interface ", wherein, Booking interface and returned ticket interface are non-login interface.The request of non-login interface needs the SID conducts that incoming login interface is provided Reliable Dialog Token, and pass through the follow-up data communication of SID progress, it is therefore desirable to according to asking for the non-login interface got The SID of non-login interface login interface to be used is determined when asking, then determines login interface to be called first, so that it is determined that Configuration file, and then corresponding SID is got according to configuration file from local file.
Preferably, in step S15, the account in the configuration file obtained from the local file described in treat The corresponding session unique identification information of login interface called;It regard the session unique identification information as the non-login interface The session unique mark carried out data transmission.The SID that above-mentioned non-login interface is used is specifically described by example below Acquisition process:Account in the configuration file obtains the request correspondence of the test interface from the local file Key assignments;The corresponding value of the key assignments is determined in the dictionary according to the key assignments, the value of the determination is regard as the meeting Talk about unique identification information.
In the embodiment of the application one, the SID of login interface is stored in local file, the type of storage is word Allusion quotation type, non-login interface extracts corresponding SID in local file by the key (key) of determination, wherein, in dictionary with Key it is corresponding value (value) be SID so that avoid repeat from login interface obtain SID, and key be it is unique, can be exactly SID or renewal are read, while saving server resource.
In summary, Fig. 4 shows to be used for the flow chart of the data storage of test interface in the embodiment of the application one, it would be desirable to The data (data to be stored) of preservation are sent to local file maker, and local file maker reads configuration file, acquisition pair The storage path answered, and judge that the corresponding local folders for being used for storing local file in the path whether there is, if it is not, then creating Local folders are built, after existing or new establishment local folders, text is created according to request environment, port name, Then, processing is formatted to needing data to be saved by reformatting processor, with dictionary type data storage.So as to solve Determined local reading and writing of files the problem of, the data of critical data or reuse are preserved to local, and it is dictionary to preserve form, Subsequent read data, then can find corresponding value by the key in dictionary, obtain or update the related data of test.
Fig. 5 shows a kind of device structure of the data storage for test interface provided on the other hand according to the application Schematic diagram, the equipment includes:First acquisition device 11, the second acquisition device 12, creating device 13 and storage device 14, wherein, First acquisition device 11 is used for, and obtains the data to be stored for test interface;Second acquisition device 12 is used for, and is surveyed according to described Try mouth configuration file obtain local folders;Creating device 13 is used for, the ring according to where the request of the test interface Border, port name create local file in the local folders;Storage device 14, for the data to be stored to be carried out It is stored in after formatting processing in the local file.It is real so as to which the data of critical data or reuse be stored in locally Existing local file read-write capability.
Fig. 2 shows the interface architecture schematic diagram of high-efficiency layered server end in the embodiment of the application one;Run Script first, It is loaded into environment, URL (URL), port name, account, required parameter, asserts condition, structured query sentence (SQL statement);Then, configuration file is loaded into, according to account, the session unique mark (SID) of local file storage is taken out, is loaded into Encrypted template generates encryption information, is automatically generated after legal message header (header), request interface, passed through according to incoming parameter Analysis server returned content judges whether interface correctly handles the request, if so, message body (Body) content is then taken out, when Associated databases are connected during incoming SQL statement, SQL statement is performed, Query Result is returned and is processed as JSON forms, by traveling through key (key) mode verifies whether corresponding value (value) is correct, if correctly, test passes through, if failure, output epicycle is surveyed Test result;When the Body contents of taking-up do not have incoming SQL statement, flow is asserted into static state, by asserting condition judgment knot Whether fruit meets business need, if so, then test passes through, if it is not, then test crash, determines whether other use being not carried out Example, next use-case is read if having and is tested.When the interface called is not handled correctly, then judge whether SID is expired, if It is out of date, then login module is called, according to environment, request end generates parameter, the encryption information of login, if logining successfully, The SID of acquisition deposits local file in key-value pair form, and the SID that local file is deposited is taken out according to account, performs above-mentioned test Process.When interface is not handled correctly and SID is not out of date, if taking out error information expected results, then it is successfully tested.
By the interface testing configuration diagram shown in Fig. 2, the problem of script versatility is not strong is solved, by data Designed with shallow-layer encapsulation, the prototype pattern of module etc., make script after receiving and performing order, excessively join without manual configuration Number, you can automatically generate corresponding parameter sets, realization is fast, easily performed.Solve asking for local reading and writing of files Topic, critical data is preserved to local, and it is dictionary (Dictionary) to preserve form, and the later stage reads data, then passes through key (key) corresponding value (value) can be found, the problem of can not introducing external libraries is solved, and the data after encryption are direct Call function is returned, the problem of can not reading and writing database is solved, the database specified can be connected and obtain or update test correlation Data, solve the problem of mode of asserting is excessively single, obtain after interface returned data and data base querying data, with key- The mode that value is compared, can quickly, largely judge to assert whether interface data is accurate, meanwhile, use above-mentioned framework, Ke Yikai Application programming interfaces (API) are put to other tests or open frame, can be expanded.
Using the test mode of the interface architecture schematic diagram shown in above-mentioned Fig. 2, wherein, it is main on the function of locally reading and writing It is embodied in the local preservation of data that are crucial or reusing.Concrete implementation mode is carried out real by the equipment described in Fig. 5 It is existing:
Specifically, the first acquisition device 11, for obtaining the data to be stored for test interface;Here, described wait to deposit It is critical data or the data of reuse for test interface to store up data, if may be implemented in local preservation, is subsequently being entered Login interface directly is called so as to reduce from local reading during row inquiry, server resource is saved.
Specifically, the second acquisition device 12, for obtaining local folders according to the configuration file of the test interface; This, gets after data to be stored, it is necessary to save it in local, is obtained according to the configuration file of test interface be used for depositing first Store up the local folders of data to be stored, wherein, configuration file include project name, environment title, the login account of database, Password, address, host domain name, client name, local file store path etc., in test interface, it is necessary to critical data If or the data reused are stored in local file, are easy to use and save server resource, read-write is realized local Function, carries out getting the local sheet for whether having storage critical data or reusing data during data storage from configuration file Ground file, so as to which this kind of data to be stored are preserved into local folders.
Specifically, creating device 13, for the environment where the request according to the test interface, port name described Local file is created in local folders;Here, environment refer in order to computer hardware necessary to completing Experience of Software Testing Work, Software, the network equipment, the general name of historical data, environment can be test environment, or development environment or other application Environment, the local file created be data to be stored storage file form, such as can be text, different rings Border, port name can correspond to the title of different texts, so as to it is follow-up correct, rapidly read stored data.
Specifically, storage device 14, for the data to be stored are formatted after processing be stored in it is described local In file.Default storage format is processed into here, data to be stored are formatted, to be deposited in local file Storage, formatting processing includes being processed as dictionary format, character string, list etc., will be described to be stored in the embodiment of the application one Data, which are formatted, is processed as dictionary type, and is stored in the local file, here, by data to be stored with dictionary class Type is stored, because dictionary type is that key-value pair mode sets up data, wherein, key (key) is index, and value (value) is to need The data of preservation, so as to subsequent read, update.
Preferably, the second acquisition device 12, for obtaining the number to be stored from the configuration file of the test interface According to store path;According to the store path judge it is local whether existing local folders, if so, then obtaining described local File, if it is not, then generating the corresponding local folders of the configuration file.In the embodiment of the application one, configuration text is read Part, obtains the store path of data to be stored from configuration file, and checks whether the path has been present, and is determined if in the presence of if Local folders, if being not present, generate local folders, file consolidation are stored in file, are easy to manage and inquire about.
Preferably, the data to be stored include the corresponding session unique identification information of the test interface.In the application In one embodiment, session unique identification information (SID) is a key and the data reused, for after login interface, Server gives user one mark, it was demonstrated that the user is legal and logged user, when the user asks other interfaces again, SID needs to be included in, it is therefore desirable to local to preserve.
In the embodiment of the application one, the equipment includes:Inquiry unit 15, for the data to be stored to be carried out into lattice After being stored in after formulaization processing in the local file, the account in the configuration file is obtained from the local file Take the corresponding session unique identification information of the test interface.Connect here, the account in configuration file obtains the test Mouthful corresponding session unique mark (SID) is used to recognize user, can as calling interface validation certificate, it is ensured that server Safety.It should be noted that SID has the term of validity, for example, some time that afternoon, which carves, have recorded new SID, then from this when Carve in one day started, when calling non-login interface, the SID of the new record can be got, it is not necessary to which repetition connects from login Mouth is obtained.The parameter and encryption information of login are generated according to environment, request port in fig. 2, after logining successfully, because local Store also not out of date SID, therefore the account in configuration file obtains SID from local file, for follow-up Data communication.
In the embodiment of the application one, the equipment includes:Acquisition request device 151, if being stepped on for test interface to be non- Interface is recorded, then obtains the request of non-login interface;Calling device 152, for being determined to treat according to the request of the non-login interface The login interface called;Determining device 153, for determining the configuration file according to the login interface to be called.Here, Interface is divided into two major classes according to function:In login interface and non-login interface, such as returned ticket flow, " login interface-booking connects Mouth-returned ticket interface ", wherein, booking interface and returned ticket interface are non-login interface.The request of non-login interface needs incoming log in The SID that interface is provided passes through the follow-up data communication of SID progress as reliable Dialog Token, it is therefore desirable to according to acquisition To non-login interface request when determine the SID of non-login interface login interface to be used, then determine first to be called Login interface, so that it is determined that configuration file, and then corresponding SID is got according to configuration file from local file.
Preferably, inquiry unit 15, institute is obtained for the account in the configuration file from the local file State the corresponding session unique identification information of login interface to be called;It regard the session unique identification information as the non-login The session unique mark that interface carries out data transmission.It is specifically described what above-mentioned non-login interface was used by example below SID acquisition process:Account in the configuration file obtains the request of the test interface from the local file Corresponding key assignments;The corresponding value of the key assignments is determined in the dictionary according to the key assignments, the value of the determination is regard as institute State session unique identification information.
In the embodiment of the application one, the SID of login interface is stored in local file, the type of storage is word Allusion quotation type, non-login interface extracts corresponding SID in local file by the key (key) of determination, wherein, in dictionary with Key it is corresponding value (value) be SID so that avoid repeat from login interface obtain SID, and key be it is unique, can be exactly SID or renewal are read, while saving server resource.
In summary, Fig. 4 shows to be used for the flow chart of the data storage of test interface in the embodiment of the application one, it would be desirable to The data (data to be stored) of preservation are sent to local file maker, and local file maker reads configuration file, acquisition pair The storage path answered, and judge that the corresponding local folders for being used for storing local file in the path whether there is, if it is not, then creating Local folders are built, after existing or new establishment local folders, text is created according to request environment, port name, Then, processing is formatted to needing data to be saved by reformatting processor, with dictionary type data storage.So as to solve Determined local reading and writing of files the problem of, the data of critical data or reuse are preserved to local, and it is dictionary to preserve form, Subsequent read data, then can find corresponding value by the key in dictionary, obtain or update the related data of test.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the application to the application God and scope.So, if these modifications and variations of the application belong to the scope of the application claim and its equivalent technologies Within, then the application is also intended to comprising including these changes and modification.
It should be noted that the application can be carried out in the assembly of software and/or software and hardware, for example, can adopt Realized with application specific integrated circuit (ASIC), general purpose computer or any other similar hardware device.In one embodiment In, the software program of the application can realize steps described above or function by computing device.Similarly, the application Software program (including related data structure) can be stored in computer readable recording medium storing program for performing, for example, RAM memory, Magnetically or optically driver or floppy disc and similar devices.In addition, some steps or function of the application can employ hardware to realize, example Such as, as coordinating with processor so as to performing the circuit of each step or function.
In addition, the part of the application can be applied to computer program product, such as computer program instructions, when its quilt When computer is performed, by the operation of the computer, it can call or provide according to the present processes and/or technical scheme. And the programmed instruction of the present processes is called, it is possibly stored in fixed or moveable recording medium, and/or pass through Broadcast or the data flow in other signal bearing medias and be transmitted, and/or be stored according to described program instruction operation In the working storage of computer equipment.Here, including a device according to one embodiment of the application, the device includes using In the memory and processor for execute program instructions of storage computer program instructions, wherein, when the computer program refers to When order is by the computing device, method and/or skill of the plant running based on foregoing multiple embodiments according to the application are triggered Art scheme.
It is obvious to a person skilled in the art that the application is not limited to the details of above-mentioned one exemplary embodiment, Er Qie In the case of without departing substantially from spirit herein or essential characteristic, the application can be realized in other specific forms.Therefore, no matter From the point of view of which point, embodiment all should be regarded as exemplary, and be nonrestrictive, scope of the present application is by appended power Profit is required rather than described above is limited, it is intended that all in the implication and scope of the equivalency of claim by falling Change is included in the application.Any reference in claim should not be considered as to the claim involved by limitation.This Outside, it is clear that the word of " comprising " one is not excluded for other units or step, and odd number is not excluded for plural number.That is stated in device claim is multiple Unit or device can also be realized by a unit or device by software or hardware.The first, the second grade word is used for table Show title, and be not offered as any specific order.

Claims (16)

1. a kind of method of data storage for test interface, wherein, methods described includes:
Obtain the data to be stored for test interface;
Local folders are obtained according to the configuration file of the test interface;
Environment, port name according to where the request of the test interface create local file in the local folders;
It is stored in after the data to be stored are formatted into processing in the local file.
2. according to the method described in claim 1, wherein, the data to be stored are formatted after processing be stored in it is described In local file, including:
The data to be stored are formatted and are processed as dictionary type, and are stored in the local file.
3. according to the method described in claim 1, wherein, according to the configuration file of the test interface obtain local folders, Including:
The store path of the data to be stored is obtained from the configuration file of the test interface;
According to the store path judge it is local whether existing local folders, if so, then obtain the local folders, if It is no, then generate the corresponding local folders of the configuration file.
4. according to the method described in claim 1, wherein, the data to be stored include the corresponding session of the test interface only One identification information.
5. method according to claim 4, wherein, the data to be stored are formatted after processing described in being stored in After in local file, including:
Account in the configuration file obtains the corresponding session of the test interface from the local file and uniquely marked Know information.
6. method according to claim 5, wherein, the account in the configuration file is obtained from the local file Before taking the corresponding session unique identification information of the test interface, including:
If test interface is non-login interface, the request of non-login interface is obtained;
Login interface to be called is determined according to the request of the non-login interface;
The configuration file is determined according to the login interface to be called.
7. method according to claim 6, wherein, the account in the configuration file is obtained from the local file The corresponding session unique identification information of the test interface is taken, including:
Account in the configuration file obtains the corresponding meeting of the login interface to be called from the local file Talk about unique identification information;
The session unique mark that the session unique identification information is carried out data transmission as the non-login interface.
8. method according to claim 2, the account in the configuration file obtains institute from the local file The corresponding session unique identification information of test interface is stated, including:
Account in the configuration file obtains the corresponding key assignments of request of the test interface from the local file;
The corresponding value of the key assignments is determined in the dictionary according to the key assignments, using the value of the determination as the session only One identification information.
9. a kind of equipment of data storage for test interface, wherein, the equipment includes:
First acquisition device, for obtaining the data to be stored for test interface;
Second acquisition device, for obtaining local folders according to the configuration file of the test interface;
Creating device, for the environment where the request according to the test interface, port name in the local folders Create local file;
Storage device, for being stored in after the data to be stored are formatted into processing in the local file.
10. equipment according to claim 9, wherein, the storage device is used for:
The data to be stored are formatted and are processed as dictionary type, and are stored in the local file.
11. equipment according to claim 9, wherein, second acquisition device is used for:
The store path of the data to be stored is obtained from the configuration file of the test interface;
According to the store path judge it is local whether existing local folders, if so, then obtain the local folders, if It is no, then generate the corresponding local folders of the configuration file.
12. equipment according to claim 9, wherein, the data to be stored include the corresponding session of the test interface Unique identification information.
13. equipment according to claim 12, wherein, the equipment also includes:
Inquiry unit, the test interface correspondence is obtained for the account in the configuration file from the local file Session unique identification information.
14. equipment according to claim 13, wherein, the equipment includes:
Acquisition request device, if being non-login interface for test interface, obtains the request of non-login interface;
Calling device, login interface to be called is determined for the request according to the non-login interface;
Determining device, for determining the configuration file according to the login interface to be called.
15. equipment according to claim 14, wherein, the inquiry unit is used for:
Account in the configuration file obtains the corresponding meeting of the login interface to be called from the local file Talk about unique identification information;
The session unique mark that the session unique identification information is carried out data transmission as the non-login interface.
16. equipment according to claim 10, the inquiry unit is used for:
Account in the configuration file obtains the corresponding key assignments of request of the test interface from the local file;
The corresponding value of the key assignments is determined in the dictionary according to the key assignments, using the value of the determination as the session only One identification information.
CN201710253456.2A 2017-04-18 2017-04-18 Method and apparatus for data storage of test interface Active CN107092535B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710253456.2A CN107092535B (en) 2017-04-18 2017-04-18 Method and apparatus for data storage of test interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710253456.2A CN107092535B (en) 2017-04-18 2017-04-18 Method and apparatus for data storage of test interface

Publications (2)

Publication Number Publication Date
CN107092535A true CN107092535A (en) 2017-08-25
CN107092535B CN107092535B (en) 2020-06-19

Family

ID=59638579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710253456.2A Active CN107092535B (en) 2017-04-18 2017-04-18 Method and apparatus for data storage of test interface

Country Status (1)

Country Link
CN (1) CN107092535B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107995160A (en) * 2017-10-26 2018-05-04 常熟市第人民医院 A kind of JSON data packet encrypting and decrypting methods based on high in the clouds management and control
CN108683567A (en) * 2018-05-30 2018-10-19 郑州云海信息技术有限公司 A kind of switch port fault testing method and system based on MCS and server
CN109739701A (en) * 2018-12-14 2019-05-10 北京奇安信科技有限公司 Interface test method and device
CN110046288A (en) * 2019-04-19 2019-07-23 新华三技术有限公司 The method and device of data is extracted from message body
CN110348217A (en) * 2019-05-28 2019-10-18 深圳壹账通智能科技有限公司 Interface test method, device, electronic equipment and storage medium
CN113434419A (en) * 2021-06-29 2021-09-24 青岛海尔科技有限公司 Interface test case assertion method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103237094A (en) * 2013-04-17 2013-08-07 北京亿赞普网络技术有限公司 Method and device for user identification
CN103701800A (en) * 2013-12-25 2014-04-02 贝壳网际(北京)安全技术有限公司 Cookie processing method, cookie processing device, browser and client
CN104009880A (en) * 2013-02-27 2014-08-27 阿里巴巴集团控股有限公司 Web test method, proxy server and Web test device
CN104410650A (en) * 2014-12-24 2015-03-11 四川金网通电子科技有限公司 Method for authenticating user based on Session and Cookie
CN105337949A (en) * 2014-08-13 2016-02-17 中国移动通信集团重庆有限公司 SSO (Single Sign On) authentication method, web server, authentication center and token check center

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104009880A (en) * 2013-02-27 2014-08-27 阿里巴巴集团控股有限公司 Web test method, proxy server and Web test device
CN103237094A (en) * 2013-04-17 2013-08-07 北京亿赞普网络技术有限公司 Method and device for user identification
CN103701800A (en) * 2013-12-25 2014-04-02 贝壳网际(北京)安全技术有限公司 Cookie processing method, cookie processing device, browser and client
CN105337949A (en) * 2014-08-13 2016-02-17 中国移动通信集团重庆有限公司 SSO (Single Sign On) authentication method, web server, authentication center and token check center
CN104410650A (en) * 2014-12-24 2015-03-11 四川金网通电子科技有限公司 Method for authenticating user based on Session and Cookie

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《ASP动态网页设计》编委会: "《ASP动态网页设计》", 31 August 2007, 北京:中国计划出版社 *
臭臭爸爸: "Http自动跳转Https的接口测试实践", 《HTTPS://WWW.CNBLOGS.COM/APPSTEST/P/4962336.HTML》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107995160A (en) * 2017-10-26 2018-05-04 常熟市第人民医院 A kind of JSON data packet encrypting and decrypting methods based on high in the clouds management and control
CN108683567A (en) * 2018-05-30 2018-10-19 郑州云海信息技术有限公司 A kind of switch port fault testing method and system based on MCS and server
CN109739701A (en) * 2018-12-14 2019-05-10 北京奇安信科技有限公司 Interface test method and device
CN110046288A (en) * 2019-04-19 2019-07-23 新华三技术有限公司 The method and device of data is extracted from message body
CN110348217A (en) * 2019-05-28 2019-10-18 深圳壹账通智能科技有限公司 Interface test method, device, electronic equipment and storage medium
CN113434419A (en) * 2021-06-29 2021-09-24 青岛海尔科技有限公司 Interface test case assertion method and device

Also Published As

Publication number Publication date
CN107092535B (en) 2020-06-19

Similar Documents

Publication Publication Date Title
CN107092535A (en) Method and apparatus for the data storage of test interface
CN107122297A (en) The method and apparatus that request message for test interface is generated
CN107122296A (en) The method and apparatus that data for test interface are asserted
US10705801B2 (en) Data processing systems for identity validation of data subject access requests and related methods
CN107122258A (en) Method and apparatus for the state code check of test interface
CN109101415A (en) Interface test method, system, equipment and the storage medium compared based on database
US20090165026A1 (en) Method and apparatus for electronic data discovery
CN104361119B (en) A kind of method and system of data scrubbing
US20130054650A1 (en) Automatic detection of columns to be obfuscated in database schemas
US20060047496A1 (en) Method, system and program product for recording and replaying target service interaction data
US20200004762A1 (en) Data processing systems and methods for automatically detecting and documenting privacy-related aspects of computer software
CN109951475A (en) Multi-platform user account information synchronous method and system, server
CN109783543A (en) Data query method, apparatus, equipment and storage medium
US20120316927A1 (en) Computer-implemented method and apparatus for integrating heterogeneous business processes
CN107770151A (en) A kind of enterprise's integrated work management system and its method
US11222309B2 (en) Data processing systems for generating and populating a data inventory
CN110362630A (en) Data managing method, device, equipment and computer readable storage medium
US20220269820A1 (en) Artificial intelligence based data redaction of documents
CN107423105A (en) A kind of automatic generation method of interface document
CN116069577A (en) Interface testing method, equipment and medium for RPC service
US20050177630A1 (en) Service analysis
US8037109B2 (en) Generation of repeatable synthetic data
CN116450107A (en) Method and device for secondary development of software by low-code platform and electronic equipment
CN110517010B (en) Data processing method, system and storage medium
CN112395591A (en) Encryption method and system

Legal Events

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