Invention content
Based on this, it is necessary in view of the above technical problems, provide a kind of test data that can effectively improve and prepare efficiency
Test data querying method, device, computer equipment and storage medium.
A kind of test data querying method, the method includes:
Mouse action and keyboard operation are simulated, browser is opened, into query page;
Read test demand file has recorded newly-increased product identification in the testing requirement file and corresponding multiple looks into
Ask field;
Mouse action is simulated, is selected in the query page according to the corresponding multiple queries field of the newly-increased product identification
Select querying condition;
Inquiry request is generated using the querying condition, the inquiry request is sent to server;
Receive the corresponding test data of existing procucts that the server returns.
The inquiry field includes product inquiry field in one of the embodiments, and user inquires field, described
Read test demand file includes:
Corresponding product inquiry field is read respectively according to the newly-increased product identification and user inquires field;
The product is inquired into field and the user inquires field and corresponds in the newly-increased product identification deposit array.
The field includes product category and test environment in one of the embodiments,;The test data includes production
Product data and user data;It is described to generate inquiry request using selected inquiry field, the inquiry request is sent to clothes
Business device include:
The corresponding inquiry request of the newly-increased product identification is generated using selected product category and test environment;
The inquiry request is sent to server, the server is inquired according to test environment in corresponding database
Product data corresponding with the product category and/or user data.
The corresponding test word of newly-increased product identification is also recorded in the testing requirement file in one of the embodiments,
Section;The method further includes:
Corresponding test field is stored in array according to the newly-increased product identification;
The array is traversed, cycle, which executes, reads corresponding test field, according to the test field read in the test
Extracting data corresponding contents;
The content extracted is stored in the corresponding test file of the newly-increased product identification.
The method further includes in one of the embodiments,:
When server does not return to the test data of test data or return less than preset quantity, the new volume increase is obtained
Product identify corresponding operation flow;
Test data corresponding with the newly-increased product identification is generated according to the operation flow.
It is described in one of the embodiments, that survey corresponding with the newly-increased product identification is generated according to the operation flow
Trying data includes:
User data is generated according to pre-set categories and obtains request, and acquisition request is sent to server;
Receive the user data corresponding to the existing procucts for the pre-set categories that server returns;
The corresponding interface is called according to the procedure links, corresponding product data are generated according to the interface;
When in procedure links there are when manual operation, using the user data analog manual operation inquired, described in generation
The corresponding product data of newly-increased product identification.
A kind of test data inquiry unit, described device include:
Read module, is used for read test demand file, have recorded in the testing requirement file newly-increased product identification with
And corresponding multiple queries field;
Enquiry module opens browser, into query page for simulating mouse action and keyboard operation;Simulate mouse
Mark operation selects querying condition according to the corresponding multiple queries field of the newly-increased product identification in the query page;Profit
Inquiry request is generated with the querying condition;
Communication module, for the inquiry request to be sent to server;Receive the existing procucts that the server returns
Corresponding test data.
Described device further includes in one of the embodiments,:
Data generation module, the test data for not returning to test data or return when server are less than preset quantity
When, obtain the corresponding operation flow of the newly-increased product identification;It is generated and the newly-increased product identification according to the operation flow
Corresponding test data.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing
The step of device realizes above-mentioned each embodiment of the method when executing the computer program.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor
The step of above-mentioned each embodiment of the method is realized when row.
Above-mentioned test data querying method, device, computer equipment and storage medium, for increase newly product setup test number
According to when, terminal simulation mouse action and keyboard operation open browser and enter query page.Terminal read test demand text
Part simulates mouse action, by the corresponding multiple queries field of newly-increased product identification in testing requirement file in query page
Select querying condition.Terminal generates corresponding inquiry request using querying condition, and inquiry request is sent to server.Server
For inquiring the corresponding test data of existing procucts according to the inquiry request, it is possible thereby to using the test data of existing procucts as
The test data of newly-increased product.In the whole process, it need not manually be directed to newly-increased product and write test data, it can be directly sharp
Newly-increased product is tested with the test data of existing procucts.And it is not required to manual queries and can be automatically performed test data
Inquiry, effectively saves the work of tester, improves the working efficiency of test data preparation.
Specific implementation mode
It is with reference to the accompanying drawings and embodiments, right in order to make the object, technical solution and advantage of the application be more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not
For limiting the application.
Test data querying method provided by the present application, can be applied in application environment as shown in Figure 1.Wherein, eventually
End 102 is communicated by network with server 104.Wherein, terminal 102 can be, but not limited to be various personal computers, pen
Remember that this computer, smart mobile phone, tablet computer, server 104 can use the either multiple server compositions of independent server
Server cluster is realized.It is mounted with application program in terminal 102.When tester needs to prepare to increase the corresponding test of product newly
When data, start application program, terminal 102 obtains the corresponding chained address of query page.It is clear by simulating mouse action opening
Look at device, simulating keyboard operation inputs chained address in the address field of browser, into query page.102 read test of terminal
Demand file has recorded newly-increased product identification and corresponding multiple queries field in testing requirement file.Terminal 102 simulates mouse
Mark operation, carries out selection operation, using being selected according to the corresponding multiple queries field of newly-increased product identification in query page
Inquiry field generate inquiry request, inquiry request is sent to server 104.Server 104 is according to test environment corresponding
Product data corresponding with product category are inquired in database.The corresponding test data of existing procucts that server 104 returns.
Terminal 102 can be using the test data of existing procucts as the test data of newly-increased product.It in the whole process, need not be artificial
Test data is write for newly-increased product, directly newly-increased product can be tested using the test data of existing procucts, by
This improves the working efficiency of test data preparation.
In one embodiment, as shown in Fig. 2, providing a kind of test data querying method, it is applied to Fig. 1 in this way
In terminal for illustrate, include the following steps:
Step 202, mouse action and keyboard operation are simulated, browser is opened, into query page.
Application program is mounted in terminal.It, can be with when tester needs to prepare to increase the corresponding test data of product newly
It is inquired automatically by the application program.Specifically, when application program launching, the corresponding chained address of query page is obtained.It is logical
It crosses simulation mouse action and opens browser, simulating keyboard operation inputs chained address in the address field of browser, into inquiry
The page.
Further, before entering query page, terminal can also simulate mouse action and key by application program
Disk operation inputs corresponding username and password in login page, and logging request is sent to server.After logining successfully, into
Enter query page.
Step 204, read test demand file has recorded newly-increased product identification and corresponding more in testing requirement file
A inquiry field.
Terminal can pre-save testing requirement file.Testing requirement file can be that terminal local generates, and also may be used
To be that other-end is sent, it can also be what terminal was downloaded from server.Newly-increased product is had recorded in testing requirement file
Mark and inquiry field.Multiple newly-increased product identifications can be recorded in testing requirement file, each newly-increased product identification can be with
Corresponding multiple queries field.
Inquiry field includes that product inquiry field and user inquire field.Terminal is read respectively according to newly-increased product identification
Corresponding product inquiry field and user inquire field, and product is inquired field and user inquires field correspondence and increases product newly
In mark deposit array.
It is appreciated that terminal, which can first carry out step 202, is executing step 204, step 204 can also be first carried out and executed again
Step 202.The sequencing of the two steps does not limit.
Step 206, mouse action is simulated, is selected in query page according to the corresponding multiple queries field of newly-increased product identification
Select querying condition.
Step 208, inquiry request is generated using querying condition, inquiry request is sent to server.
Step 210, the corresponding test data of existing procucts that server returns is received.
Query page includes multiple queries field, and inquiry field includes product category and test environment etc..Wherein, it produces
Category can also not include major category and subclass.Terminal simulation mouse action identifies and its right according to the new product read
The multiple queries field answered selects corresponding multiple queries field, as querying condition in query page.Wherein, terminal can
To select multiple product categories and/or multiple test environments as querying condition.Terminal generates inquiry request using querying condition,
And the inquiry request is sent to server.Server is inquired and product category phase according to test environment in associated databases
Corresponding product data.Wherein, multiple databases are deployed on server, database can be corresponding with test environment.It is same
A test environment can be only applicable to the product test of a product type, and the product for being readily applicable to multiple product types is surveyed
Examination.
It utilizes querying condition to generate inquiry request in one of the embodiments, inquiry request is sent to server packet
It includes:Using selected product category and selected test environment as querying condition, it is corresponding to generate newly-increased product identification
Inquiry request;Inquiry request is sent to server, server be used to inquire in corresponding database according to inquiry request and
The corresponding product data of product category and/or user data.
Test data includes product data and user data.Product data and user data can be inquired simultaneously, can also
Separately inquiry.When product data inquiry field corresponding with user data is identical, terminal can generate while inquire product number
According to this and the inquiry request of user data, the inquiry request of product data can also be generated respectively and the inquiry of user data is asked
It asks.When product data inquiry field difference corresponding with user data, terminal can generate product respectively according to inquiry field
The inquiry request of data and the inquiry request of user data.
By taking product data and user data are independently inquired as an example, query page can be as shown in Figure 3.Major category corresponds to
Inquiry field include:New hand prefecture, current, regular, P2P, high-end financing, fund, insurance.The corresponding inquiry field of subclass
Including:Odd jobs treasured T+0, odd jobs treasured T+14, odd jobs treasured T+28, super odd jobs treasured, odd jobs treasured, monetary fund, auspicious No. 8 of China.Test
The corresponding inquiry field of environment includes that multiple test dehorns are known, for example, MOBILE1, MOBILE2, MOBILE3, MOBILE4,
MOBILE5、MOBILE6、MOBILE7、MOBILE8、MOBILE9、QA7、STGM。
Multiple queries field of the terminal corresponding to the newly-increased product identification read, terminal simulation mouse action,
It is " current " that the corresponding inquiry field of major category is selected in the query page, the corresponding inquiry field of subclass is " odd jobs treasured T+
14 ", the corresponding inquiry field of test environment is " QA7 ".Terminal continues to simulate mouse action, is clicked in query page again
" product inquiry " generates the corresponding inquiry request of product data using the inquiry field chosen as querying condition.Terminal will
The inquiry request is sent to server, and server inquires corresponding product data according to test environment in the database.QA7 this
There are the existing procucts that 3 meet querying condition, product identification under one test environment is respectively:13881416,14054616,
14150340.When terminal simulates mouse again is moved to the corresponding icon of one of product, this can be shown with terminal
The product data of product.Further, terminal can also inquire corresponding user data by a similar method, and institute is obtained with this
The test data needed.
In the present embodiment, when for newly-increased product setup test data, terminal simulation mouse action and keyboard operation are beaten
It opens browser and enters query page.Terminal read test demand file simulates mouse action, will be newly-increased in testing requirement file
The corresponding multiple queries field of product identification selects querying condition in query page.Terminal is generated corresponding using querying condition
Inquiry request is sent to server by inquiry request.Server is used to inquire the corresponding survey of existing procucts according to the inquiry request
Data are tried, it is possible thereby to using the test data of existing procucts as the test data of newly-increased product.In the whole process, it does not need
It is artificial to write test data for newly-increased product, directly newly-increased product can be surveyed using the test data of existing procucts
Examination.And be not required to manual queries and can be automatically performed the inquiry of test data, the work of tester is effectively saved, is improved
The working efficiency that test data prepares.
In one embodiment, inquiry field includes that product inquiry field and user inquire field, read test demand
File includes:Corresponding product inquiry field is read respectively according to newly-increased product identification and user inquires field;Product is looked into
It askes field and user inquires field and corresponds in newly-increased product identification deposit array.
Inquiry field includes that product inquiry field and user inquire field, can be with when terminal read test demand file
Corresponding product inquiry field is read according to newly-increased product identification and user inquires field, and according to newly-increased product identification
The product read is inquired into field and user inquires in field deposit array.Wherein, multiple newly-increased product identifications are corresponding
Inquiry field can be stored in the same array, can also be stored in different arrays.The corresponding product of same newly-increased product identification
Inquiry field is inquired field with user and can be stored in the same array, can also be stored in different arrays.
When terminal is inquired, product inquiry field can be read directly in corresponding array according to newly-increased product identification
And/or user inquires field, simulation mouse action is inquired field according to the product inquiry field read and/or user and is being inquired
Selection operation is carried out in the page, generates corresponding inquiry request.When being stored in the corresponding inquiry of multiple newly-increased product identifications in array
When field, terminal can traverse array, read the corresponding inquiry field of multiple newly-increased product identifications respectively, and cycle executes
Inquiry operation.It is stored in array by the inquiry field needed for inquiring, effectively increases the search efficiency of test data.
In one embodiment, the corresponding test field of newly-increased product identification is also recorded in testing requirement file;It is connecing
After receiving the corresponding test data of existing procucts that server returns, this method further includes:The screening step of test data.Such as figure
Shown in 4, specifically include:
Step 402, corresponding test field is stored in by array according to newly-increased product identification;
Step 404, array is traversed, cycle, which executes, reads corresponding test field, is being tested according to the test field read
Extracting data corresponding contents;
Step 406, the content extracted is stored in and increases the corresponding test file of product identification newly.
In the present embodiment, due to newly-increased there is otherness, terminal also to need to existing production between product and existing procucts
The product data of product carry out differentiation screening with user data, to obtain the test data to match with testing requirement.
The corresponding test field of newly-increased product identification can also be recorded in testing requirement file.Terminal can be in testing requirement
Corresponding test field is read according to newly-increased product identification in file, and the test field read is stored in array.Work as survey
In examination demand file when having recorded multiple newly-increased product identifications, terminal can also be by the corresponding test word of multiple newly-increased product identifications
Section is respectively in corresponding deposit array.Wherein, the different newly-increased corresponding test fields of product identification can be stored in same array,
It can be stored in different arrays.
Terminal reads corresponding test field in array, is screened to test data using the test field read,
The content to match is extracted, the content to match is stored in and increases the corresponding test file of product newly.Terminal-pair array is traversed,
Cycle execution test is from the operation read and screened, until completing the corresponding screening operation of all newly-increased product identifications.Its
In, the first test field for screening product data can be different from the second test field for screening user data, can also part
It is identical.Terminal can be screened according to the first test field in product data, and the product to match with newly-increased product is obtained
Data.Terminal can be screened according to the second data in user data, and the user data to match with newly-increased product is obtained.
Terminal will be in the corresponding test file of the product data and user data that match with newly-increased product deposit.Whole process is not required to
Manual operation, can not only obtain with the stringent matched test data of the testing requirement of newly-increased product, and effectively reduce survey
The work of examination personnel improves the working efficiency of test data preparation.
It should be understood that although each step in the flow chart of Fig. 2 and Fig. 4 is shown successively according to the instruction of arrow
Show, but these steps are not the inevitable sequence indicated according to arrow to be executed successively.Unless expressly state otherwise herein, this
There is no stringent sequences to limit for the execution of a little steps, these steps can execute in other order.Moreover, Fig. 2 and Fig. 4
In at least part step may include that either these sub-steps of multiple stages or stage are not necessarily multiple sub-steps
Completion is executed in synchronization, but can be executed at different times, the execution in these sub-steps or stage sequence is not yet
Necessarily carry out successively, but can either the sub-step of other steps or at least part in stage be in turn with other steps
Or it alternately executes.
In one embodiment, this method further includes:When server does not return to test data or the test data of return
When less than preset quantity, obtains and increase the corresponding operation flow of product identification newly;It is generated and newly-increased product identification according to operation flow
Corresponding test data.
For the newly-increased product of new business, may there is not yet corresponding existing procucts.When terminal carries out automation inquiry
When, server inquiry failure fails to return to corresponding test data.It is also possible to there is only a small amount of existing procucts, terminal is returned
The product quantity corresponding to test data returned is less than preset value, then cannot be satisfied testing requirement.At this point, terminal need generate with
The opposite test data of newly-increased product identification.Terminal obtains corresponding operation flow, operation flow packet according to newly-increased product identification
Include multiple procedure links.Terminal generates corresponding test data according to multiple procedure links.Corresponding to different newly-increased products
Operation flow is different, and different operation flows includes different procedure links.
Generating test data corresponding with newly-increased product identification according to operation flow in one of the embodiments, includes:
User data acquisition request is generated according to pre-set categories, request will be obtained and be sent to server, receive the default of server return
User data corresponding to the existing procucts of classification;The corresponding interface is called according to procedure links, corresponding production is generated according to interface
Product data;When, there are when manual operation, using the user data analog manual operation inquired, generation is new to be increased production in procedure links
Product identify corresponding product data.
The existing procucts user data used in test is saved in database.Purchase of the user data in financial product
Buying, redeem etc. has certain versatility in on-line operations.Therefore, when terminal fail to inquire it is corresponding with newly-increased product identification
User data when, the user data that terminal can be corresponding to the existing procucts using pre-set categories surveys newly-increased product
Examination.Pre-set categories can be the classification being close with newly-increased product.For example, pre-set categories can be the major category with newly-increased product
It is same or similar.
Terminal calls corresponding interface, the interface that different procedure links are called can be different according to procedure links.Eventually
End generates the corresponding product data of the procedure links by calling interface.For example, in the procedure links of product restocking, terminal can
With calling interface, newly-increased product is sent to website, Product Status is revised as " reaching the standard grade ".It is manually grasped when existing in procedure links
When making, terminal can utilize the user data of the existing procucts of the pre-set categories inquired, analog manual operation to generate new volume increase
Product identify corresponding product data.For example, the user data inquired, the people in the investment link can be utilized with terminal
Work operates, and inputs personal information and account information etc., submits investment requests.Terminal calling interface believes personal information account
It ceases and is checked, and check corresponding investment amount, User Status, risk class etc., calling interface carries out if meeting the requirements
Investment amount freezes, and pay status is set to " freezing ".
For increasing product newly, if failing to inquire effective test data, terminal can be generated according to operation flow with it is new
Increase the corresponding test data of product identification.In whole process, it can be automatically performed according to being pre-configured with, effectively reduce test
Personnel write the work of test data, are provided a convenient for tester.
In one embodiment, as shown in figure 5, providing a kind of test data inquiry unit, including:Read module 502,
Enquiry module 504 and communication module 506, wherein:
Read module 502, is used for read test demand file, have recorded in testing requirement file newly-increased product identification and
Corresponding multiple queries field.
Enquiry module 504 opens browser, into query page for simulating mouse action and keyboard operation;Simulation
Mouse action selects querying condition according to the corresponding multiple queries field of newly-increased product identification in query page;Utilize inquiry
Condition generates inquiry request.
Communication module 506, for inquiry request to be sent to server;It is corresponding to receive the existing procucts that server returns
Test data.
In one embodiment, inquiry field includes that product inquiry field and user inquire field, and read module is also used
According to increasing newly, product identification reads corresponding product inquiry field respectively and user inquires field;By product inquire field with
And user inquires field and corresponds in newly-increased product identification deposit array.
In one embodiment, inquiry field includes product category and test environment;Test data include product data and
User data;Enquiry module is additionally operable to using selected product category and selected test environment as querying condition, raw
At the corresponding inquiry request of newly-increased product identification;Communication module is additionally operable to inquiry request being sent to server, and server is used for
Product data corresponding with product category and/or user data are inquired in corresponding database according to inquiry request.
In one embodiment, the corresponding test field of newly-increased product identification is also recorded in testing requirement file;The dress
It sets and further includes:Screening module, for corresponding test field to be stored in array according to newly-increased product identification;Traverse array, cycle
It executes and reads corresponding test field, corresponding contents are extracted in test data according to the test field read;By what is extracted
Content deposit increases the corresponding test file of product identification newly.
In one embodiment, which further includes:Data generation module, for work as server do not return test data or
When the test data that person returns is less than preset quantity, obtains and increase the corresponding operation flow of product identification newly;It is given birth to according to operation flow
At test data corresponding with newly-increased product identification.
In one embodiment, data generation module is additionally operable to generate user data acquisition request according to pre-set categories, will
It obtains request and is sent to server;Receive the user data corresponding to the existing procucts for the pre-set categories that server returns;According to
Procedure links call the corresponding interface, and corresponding product data are generated according to interface;When in procedure links there are when manual operation, profit
With the user data analog manual operation inquired, generates and increase the corresponding product data of product identification newly.
Specific about test data inquiry unit limits the limit that may refer to above for test data querying method
Fixed, details are not described herein.Modules in above-mentioned test data inquiry unit can fully or partially through software, hardware and its
It combines to realize.Above-mentioned each module can be embedded in or in the form of hardware independently of in the processor in computer equipment, can also
It is stored in a software form in the memory in computer equipment, in order to which processor calls the above modules of execution corresponding
Operation.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure
Figure can be as shown in Figure 6.The computer equipment includes the processor connected by system bus, memory, network interface, display
Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited
Reservoir includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system and computer journey
Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating
The network interface of machine equipment is used to communicate by network connection with external terminal.When the computer program is executed by processor with
Realize a kind of test data querying method.The display screen of the computer equipment can be that liquid crystal display or electric ink are shown
Screen, the input unit of the computer equipment can be the touch layer covered on display screen, can also be on computer equipment shell
Button, trace ball or the Trackpad of setting can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Fig. 6, is only tied with the relevant part of application scheme
The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment
May include either combining certain components than more or fewer components as shown in the figure or being arranged with different components.
In one embodiment, a kind of computer equipment, including memory and processor are provided, which is stored with
Computer program, the processor realize the step in above-mentioned each embodiment of the method when executing computer program.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program realizes the step in above-mentioned each embodiment of the method when being executed by processor.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein,
Any reference to memory, storage, database or other media used in each embodiment provided herein,
Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include
Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above example can be combined arbitrarily, to keep description succinct, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield is all considered to be the range of this specification record.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, under the premise of not departing from the application design, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the protection domain of the application patent should be determined by the appended claims.