CN104915288A - Testing method and device - Google Patents

Testing method and device Download PDF

Info

Publication number
CN104915288A
CN104915288A CN201410092181.5A CN201410092181A CN104915288A CN 104915288 A CN104915288 A CN 104915288A CN 201410092181 A CN201410092181 A CN 201410092181A CN 104915288 A CN104915288 A CN 104915288A
Authority
CN
China
Prior art keywords
test
execution machine
test block
test case
hosts 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.)
Pending
Application number
CN201410092181.5A
Other languages
Chinese (zh)
Inventor
孙阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410092181.5A priority Critical patent/CN104915288A/en
Publication of CN104915288A publication Critical patent/CN104915288A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a testing method and device. According to the embodiment of the invention, after execution machine resource requests of at least two testing cases are received, available execution machines are allocated for the testing cases according to the occupation situation of execution machine resources, and further the testing cases and Hosts files of test pieces the testing cases belong to are sent to the available execution machines allocated for the testing cases, so that the execution machines utilize the Hosts files to operate the testing cases. Due to the fact that the testing cases included by multiple test pieces are concurrently operated, the execution time of testing operation can be greatly shortened, and the efficiency of testing operation can be improved.

Description

Method of testing and device
[technical field]
The application relates to measuring technology, particularly relates to a kind of method of testing and device.
[background technology]
At software test procedure such as, in user interface (User interface, UI) test, in order to avoid the risk of program, need the test case utilizing design, testing results task.A test assignment and test block, can comprise at least one test case.In prior art, can all test cases of a test block be distributed in an execution machine, then, this execution machine be run these test cases.Run complete after, more all test cases of another test block to be distributed in this execution machine, then to continue to run these test cases.
But, along with the increase of test case quantity, the working time of each test block will become very long, and, a test block runs complete another test block that can bring into operation afterwards, therefore, complete the operation of multiple test block, the longer test duration can be taken, thus result in the reduction of the efficiency of test operation.
[summary of the invention]
The many aspects of the application provide a kind of method of testing and device, in order to improve the efficiency of test operation.
The one side of the application, provides a kind of method of testing, is applied in the operational process of at least two test blocks, and each test block comprises at least one test case, and described method comprises:
Receive the execution machine resource request of at least two test cases;
Situation is taken, for each test case distributes available execution machine according to execution machine resource;
By each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, to make described available execution machine utilize described Hosts file, runs this test case.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, before the execution machine resource request of described reception at least two test cases, also comprises:
By the detecting information in described at least two test blocks corresponding to each test block, download at least two respectively from equipment; Wherein, the detecting information corresponding to described each test block comprises the Hosts file of this test block and this test block;
Utilize multithread mode, described at least two each from equipment from equipment, run described each test block.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described by the detecting information in described at least two test blocks corresponding to each test block, downloads at least two respectively from equipment, comprising:
By described each test block, described in downloading to respectively at least two from equipment;
By the Hosts file of described each test block, under writing the root directory of described each test block.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, and the execution machine resource request of described reception at least two test cases, comprising:
Utilize multithread mode, receive the execution machine resource request of at least two test cases that at least two threads send respectively.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described method also comprises:
In each available execution machine, run autoexec, so that the Hosts file of the test block belonging to described each test case is override original Hosts file.
The one side of the application, provides a kind of proving installation, is applied in the operational process of at least two test blocks, and each test block comprises at least one test case, and described device comprises:
Receiving element, for receiving the execution machine resource request of at least two test cases;
Allocation units, for taking situation, for each test case distributes available execution machine according to execution machine resource;
Transmitting element, for by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, to make described available execution machine utilize described Hosts file, runs this test case.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described device also comprises:
Download unit, for by the detecting information in described at least two test blocks corresponding to each test block, downloads at least two respectively from equipment; Wherein, the detecting information corresponding to described each test block comprises the Hosts file of this test block and this test block;
Running unit, for utilizing multithread mode, described at least two each from equipment from equipment, run described each test block.
Aspect as above and arbitrary possible implementation, provide a kind of implementation, described download unit further, specifically for
By described each test block, described in downloading to respectively at least two from equipment; And
By the Hosts file of described each test block, under writing the root directory of described each test block.
Aspect as above and arbitrary possible implementation, provide a kind of implementation, described receiving element further, specifically for
Utilize multithread mode, receive the execution machine resource request of at least two test cases that at least two threads send respectively.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, described device also comprises replacement unit, for
In each available execution machine, run autoexec, so that the Hosts file of the test block belonging to described each test case is override original Hosts file.
As shown from the above technical solution, the embodiment of the present application is after the execution machine resource request receiving at least two test cases, by taking situation according to execution machine resource, for each test case distributes available execution machine, and then can by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, described Hosts file is utilized to make described available execution machine, run this test case, due to the test case included by the multiple test block of concurrent running, therefore, the execution time of test operation can be greatly reduced, thus improve the efficiency of test operation.
In addition, adopt the technical scheme that the application provides, without the need to the increase along with test case quantity, split test block, the problem of the increase of fractionation cost and the maintenance cost caused because fractionation test block runs the test block after splitting by multiple execution machine in prior art can be avoided, thus effectively can reduce the running cost of test block.
In addition, adopt the technical scheme that the application provides, without the need to waiting for that a test block runs complete another test block that just brings into operation afterwards, but the test case included by the multiple test block of concurrent running, thus improve the dirigibility of test operation.
[accompanying drawing explanation]
In order to be illustrated more clearly in the technical scheme in the embodiment of the present application, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the application, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The schematic flow sheet of the method for testing that Fig. 1 provides for the application one embodiment;
The structural representation of the proving installation that Fig. 2 provides for another embodiment of the application;
The structural representation of the proving installation that Fig. 3 provides for another embodiment of the application;
The structural representation of the proving installation that Fig. 4 provides for another embodiment of the application.
[embodiment]
For making the object of the embodiment of the present application, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present application, technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment is some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making other embodiments whole obtained under creative work prerequisite, all belong to the scope of the application's protection.
It should be noted that; test case described in the embodiment of the present application can include but not limited to the program that the program of C language code compilation, the program of C Plus Plus code compilation or java language codes compile; other any program languages realizing compiling are all within the application's protection domain, and the application is not particularly limited to this.
In addition, term "and/or" herein, being only a kind of incidence relation describing affiliated partner, can there are three kinds of relations in expression, and such as, A and/or B, can represent: individualism A, exists A and B simultaneously, these three kinds of situations of individualism B.In addition, character "/" herein, general expression forward-backward correlation is to the relation liking a kind of "or".
The schematic flow sheet of the method for testing that Fig. 1 provides for the application one embodiment, be applied in the operational process of at least two test blocks, each test block comprises at least one test case, as shown in Figure 1.
101, the execution machine resource request of at least two test cases is received.
Alternatively, in one of the present embodiment possible implementation, before 101, further by the detecting information in described at least two test blocks corresponding to each test block, at least two can also be downloaded to respectively from equipment; Wherein, the detecting information corresponding to described each test block comprises the Hosts file of this test block and this test block.Hosts file, it is a system file not having extension name, IP address corresponding with it for network address domain name is set up one and is associated " database " by its effect exactly, when user inputs the network address of a needs login in a browser, browser first automatically can find corresponding IP address from Hosts file, once find, browser can open corresponding webpage immediately, if do not found, then network address can submit to name server (Domain Name Server, DNS) to carry out the parsing of IP address by browser again.Therefore, when testing results use-case performs, need amendment Hosts file, by tested network address domain name such as, www.alibaba.com etc., point to the IP address of the testing server disposed.
Particularly, specifically can by described each test block, described in downloading to respectively at least two from equipment, and by the Hosts file of described each test block, under writing the root directory of described each test block.
Then, utilize multithread mode, described at least two each from equipment from equipment, run described each test block, to send the execution machine resource request of each test case.
Correspondingly, in 101, specifically can utilize multithread mode, receive the execution machine resource request of at least two test cases that at least two threads send respectively.
For example, in concrete application scenarios, a continuous integrating instrument Hudson can be affixed one's name to apply leading (Master) its upper side, and by multiple from (Slave) facility registration to Hudson application.In addition, also need will have during the Function Extension of writing Hosts file applies to this Hudson further, such as, one is had the feature card writing Hosts file and be loaded into during this Hudson applies.When test assignment starts, Hudson application can, by each test block, download to multiple from equipment respectively, and by the Hosts file of described each test block, under writing the root directory of described each test block, namely records the test environment of this testing results part.Hudson application and then then can utilize the multithread mode of TestNG, at the respective test block that brings into operation from equipment, each independently thread sends this execution machine resource request from the test case included by the test block equipment respectively.Wherein, TestNG is a test frame, and its derives from from JUnit and NUnit, except inheriting both advantages, has additionally again developed some new functions, has made it more powerful and easy-to-use.
102, situation is taken, for each test case distributes available execution machine according to execution machine resource.
In the application, in order to improve the efficiency of test operation, need to dispose multiple execution machine, simultaneously the multiple test case of concurrence performance.Be understandable that, the concrete quantity of execution machine can according to actual conditions, and increase or reduce, the present embodiment is not particularly limited this.
Alternatively, in one of the present embodiment possible implementation, in 102, specifically can take situation according to execution machine resource, obtain idle execution machine resource, using as available execution machine to be allocated.Then, according to received execution machine resource request, for each test case distributes available execution machine.There is no idle execution machine resource if current, then received execution machine resource request can be hung up, till waiting for available free execution machine resource.
In the application, not distribute available execution machine based on test block, but based on test case, for each test case distributes available execution machine, therefore, make the concurrent running of test case dimension become possibility.
103, by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, to make described available execution machine utilize described Hosts file, runs this test case.
Alternatively, in one of the present embodiment possible implementation, in 103, specifically in each available execution machine, autoexec can be run, so that the Hosts file of the test block belonging to described each test case is override original Hosts file.
For example, in concrete application scenarios, on arbitrary device, such as, main equipment, arbitrary from equipment or other equipment, deploy selenium-grid application, and multiple execution machine is registered in selenium-grid application, using the equipment as carrying out practically test case.In addition, also need will have the Function Extension of amendment Hosts file in this selenium-grid application further, such as, expansion selenium-grid applies primary jar bag, increases this function.
Such as,
Selenium-grid application specifically can receive the execution machine resource request of each test case that each independently thread sends respectively, what obtain execution machine resource takies situation, take situation according to execution machine resource, obtain idle execution machine resource, using as available execution machine to be allocated.
Then, selenium-grid applies according to received execution machine resource request, for each test case distributes available execution machine.If do not have idle execution machine resource current, received execution machine resource request then can be hung up, till waiting for available free execution machine resource by selenium-grid application.
Then, after distributing available execution machine for each test case, selenium-grid application is from the root directory of the test block distributed belonging to the complete each test case of available execution machine, obtain the Hosts file of this test block, and then by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case.
Like this, described available execution machine then can utilize described Hosts file, runs this test case.Be understandable that, available execution machine is run a complete test case and is namely released, and to become idle execution machine resource, for selenium-grid application, this available execution machine is distributed to other test cases.
The method provided for making the embodiment of the present application clearly, below will with three test blocks as an example.Test block A, comprises test case A1, test case A2, test case A3, test case A4, test case A5, test case A6, test case A7 and test case A8; Test block B, comprises test case B1, test case B2, test case B3, test case B4, test case B5, test case B6, test case B7 and test case B8; Test piece C, comprises test case C1, test case C2, test case C3, test case C4, test case C5, test case C6, test case C7 and test case C8.For three test blocks and test block A, test block B and test piece C, application scenarios is specifically as follows is leading (Master) its upper side and is affixing one's name to the Hudson application of an expansion, and by three from equipment namely from device A, from equipment B be registered to Hudson application from equipment C; And on arbitrary device, such as, main equipment, arbitrary selenium-grid application of affixing one's name to an expansion from equipment or other its upper side, and six execution machine and execution machine 1, execution machine 2, execution machine 3, execution machine 4, execution machine 5 and execution machine 6 are registered in selenium-grid application, using the equipment as carrying out practically test case.
When test assignment starts, Hudson application by test block A, can download to from device A, and by the Hosts file A of test block A, under the root directory of write test block A; Hudson application by test block B, can download to from equipment B, and by the Hosts file B of test block B, under the root directory of write test block B; Hudson application by test piece C, can download to from equipment C, and by the Hosts file C of test piece C, under the root directory of write test piece C.
Utilize the multithread mode of TestNG, such as, open two thread modes, at the respective test block that brings into operation from equipment, each independently thread sends this execution machine resource request from the test case included by the test block equipment respectively, that is:
Apply from the thread 1 of device A to selenium-grid, send the execution machine resource request of test case A1, apply from the thread 2 of device A to selenium-grid meanwhile, send the execution machine resource request of test case A2.After the execution machine resource request of use-case A1 or test case A2 to be tested is disposed, the execution machine resource request of other test cases is sent again to selenium-grid application, until the execution machine resource request of whole test cases that this test block comprises all is sent from the thread 1 of device A or thread 2.
Similarly, apply from the thread 1 of equipment B to selenium-grid, send the execution machine resource request of test case B1, apply from the thread 2 of equipment B to selenium-grid meanwhile, send the execution machine resource request of test case B2.After the execution machine resource request of use-case B1 or test case B2 to be tested is disposed, the execution machine resource request of other test cases is sent again to selenium-grid application, until the execution machine resource request of whole test cases that this test block comprises all is sent from the thread 1 of equipment B or thread 2.
Apply from the thread 1 of equipment C to selenium-grid, send the execution machine resource request of test case C1, apply from the thread 2 of equipment C to selenium-grid meanwhile, send the execution machine resource request of test case C2.After the execution machine resource request of use-case C1 or test case C2 to be tested is disposed, the execution machine resource request of other test cases is sent again to selenium-grid application, until the execution machine resource request of whole test cases that this test block comprises all is sent from the thread 1 of equipment C or thread 2.
Selenium-grid application receive three from equipment namely from device A, from equipment B with from after the test case execution machine resource request that the thread of equipment C sends, what obtain current disposed execution machine resource takies situation, situation is taken according to execution machine resource, obtain idle execution machine resource, using as available execution machine to be allocated.Selenium-grid applies according to received execution machine resource request, for each test case distributes available execution machine, that is:
Selenium-grid is applied as test case A1 and distributes execution machine 1, for test case A2 distributes execution machine 2, for test case B1 distributes execution machine 3, for test case B2 distributes execution machine 4, for test case C1 distributes execution machine 5, and it is test case C2 distribution execution machine 6.Other received execution machine resource request then can be hung up, till waiting for available free execution machine resource by selenium-grid application.
Then, selenium-grid application is then from the root directory of the test block distributed belonging to the complete each test case of available execution machine, obtain the Hosts file of this test block, and then by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, that is:
Selenium-grid application, from the root directory of the test block A belonging to test case A1, obtains the Hosts file A of this test block A, and then by test case A1, and Hosts file A sends to execution machine 1.
Similarly, selenium-grid application, from the root directory of the test block A belonging to test case A2, obtains the Hosts file A of this test block A, and then by test case A2, and Hosts file A sends to execution machine 2.
Selenium-grid application, from the root directory of the test block B belonging to test case B1, obtains the Hosts file B of this test block B, and then by test case B1, and Hosts file B sends to execution machine 3.
Selenium-grid application, from the root directory of the test block B belonging to test case B2, obtains the Hosts file B of this test block B, and then by test case B2, and Hosts file B sends to execution machine 4.
Selenium-grid application, from the root directory of the test piece C belonging to test case C1, obtains the Hosts file C of this test piece C, and then by test case C1, and Hosts file C sends to execution machine 5.
Selenium-grid application, from the root directory of the test piece C belonging to test case C2, obtains the Hosts file C of this test piece C, and then by test case C2, and Hosts file C sends to execution machine 6.
The available execution machine of disposing and execution machine 1, execution machine 2, execution machine 3, execution machine 4, execution machine 5 and execution machine 6 can run autoexec, override original Hosts file with the Hosts file it received.Like this, these execution machine then can utilize its Hosts file received, and run this test case.Be understandable that, available execution machine is run a complete test case and is namely released, and to become idle execution machine resource, for selenium-grid application, this available execution machine is distributed to other test cases.
Like this, the test case included by multiple test block, can in multiple execution machine concurrent running, just do not run successively in an execution machine, the execution time of test operation can be greatly reduced, thus improve the efficiency of test operation.
In addition, the test case in multiple test block included by each test block, can in execution machine crossing operation, whether complete the operation no longer relying on test block is, thus can improve the dirigibility of test operation further.
In the present embodiment, after the execution machine resource request receiving at least two test cases, by taking situation according to execution machine resource, for each test case distributes available execution machine, and then can by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, described Hosts file is utilized to make described available execution machine, run this test case, due to the test case included by the multiple test block of concurrent running, therefore, the execution time of test operation can be greatly reduced, thus improve the efficiency of test operation.
In addition, adopt the technical scheme that the application provides, without the need to the increase along with test case quantity, split test block, the problem of the increase of fractionation cost and the maintenance cost caused because fractionation test block runs the test block after splitting by multiple execution machine in prior art can be avoided, thus effectively can reduce the running cost of test block.
In addition, adopt the technical scheme that the application provides, without the need to waiting for that a test block runs complete another test block that just brings into operation afterwards, but the test case included by the multiple test block of concurrent running, thus improve the dirigibility of test operation.
It should be noted that, for aforesaid each embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the application is not by the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action and module might not be that the application is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
The structural representation of the proving installation that Fig. 2 provides for another embodiment of the application, be applied in the operational process of at least two test blocks, each test block comprises at least one test case, as shown in Figure 2.The proving installation of the present embodiment can comprise receiving element 21, allocation units 22 and transmitting element 23.Wherein,
Described receiving element 21, for receiving the execution machine resource request of at least two test cases.
Alternatively, in one of the present embodiment possible implementation, as shown in Figure 3, the proving installation that the present embodiment provides can further include download unit 31 and running unit 32.Wherein,
Download unit 31, for by the detecting information in described at least two test blocks corresponding to each test block, downloads at least two respectively from equipment; Wherein, the detecting information corresponding to described each test block comprises the Hosts file of this test block and this test block.Hosts file, it is a system file not having extension name, IP address corresponding with it for network address domain name is set up one and is associated " database " by its effect exactly, when user inputs the network address of a needs login in a browser, browser first automatically can find corresponding IP address from Hosts file, once find, browser can open corresponding webpage immediately, if do not found, then network address can submit to name server (Domain Name Server, DNS) to carry out the parsing of IP address by browser again.Therefore, when testing results use-case performs, need amendment Hosts file, by tested network address domain name such as, www.alibaba.com etc., point to the IP address of the testing server disposed.
Particularly, described download unit 31, specifically may be used for described each test block, described in downloading to respectively at least two from equipment; And by the Hosts file of described each test block, under writing the root directory of described each test block.
Running unit 32, for utilizing multithread mode, described at least two each from equipment from equipment, run described each test block, to send the execution machine resource request of each test case.
Correspondingly, described receiving element 21, specifically may be used for
Utilize multithread mode, receive the execution machine resource request of at least two test cases that at least two threads send respectively.
For example, in concrete application scenarios, a Hudson application can be affixed one's name to leading (Master) its upper side, and by multiple from (Slave) facility registration to Hudson application.In addition, also need will have during the Function Extension of writing Hosts file applies to this Hudson further, such as, one is had the feature card writing Hosts file and be loaded into during this Hudson applies.When test assignment starts, download unit 31 can, by each test block, download to multiple from equipment respectively, and by the Hosts file of described each test block, under writing the root directory of described each test block, namely records the test environment of this testing results part.Running unit 32 and then then can utilize the multithread mode of TestNG, at the respective test block that brings into operation from equipment, each independently thread sends this execution machine resource request from the test case included by the test block equipment respectively.
Described allocation units 22, for taking situation, for each test case distributes available execution machine according to execution machine resource.
In the application, in order to improve the efficiency of test operation, need to dispose multiple execution machine, simultaneously the multiple test case of concurrence performance.Be understandable that, the concrete quantity of execution machine can according to actual conditions, and increase or reduce, the present embodiment is not particularly limited this.
Alternatively, in one of the present embodiment possible implementation, described allocation units 22, specifically can take situation according to execution machine resource, obtain idle execution machine resource, using as available execution machine to be allocated; And then again according to received execution machine resource request, for each test case distributes available execution machine.If do not have idle execution machine resource current, received execution machine resource request can be hung up, till waiting for available free execution machine resource by described allocation units 22.
In the application, not distribute available execution machine based on test block, but based on test case, for each test case distributes available execution machine, therefore, make the concurrent running of test case dimension become possibility.
Described transmitting element 23, for by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, to make described available execution machine utilize described Hosts file, runs this test case.
Alternatively, in one of the present embodiment possible implementation, as shown in Figure 4, the proving installation that the present embodiment provides can further include replacement unit 41, for in each available execution machine, run autoexec, so that the Hosts file of the test block belonging to described each test case is override original Hosts file.
For example, in concrete application scenarios, on arbitrary device, such as, main equipment, arbitrary from equipment or other equipment, deploy selenium-grid application, and multiple execution machine is registered in selenium-grid application, using the equipment as carrying out practically test case.In addition, also need will have the Function Extension of amendment Hosts file in this selenium-grid application further, such as, expansion selenium-grid applies primary jar bag, increases this function.
Such as,
Receiving element 21 specifically can receive the execution machine resource request of each test case that each independently thread sends respectively, what obtain execution machine resource by allocation units 22 takies situation, situation is taken according to execution machine resource, obtain idle execution machine resource, using as available execution machine to be allocated.
Then, allocation units 22 according to received execution machine resource request, for each test case distributes available execution machine.If do not have idle execution machine resource current, received execution machine resource request can be hung up, till waiting for available free execution machine resource by allocation units 22.
Then, after allocation units 22 distribute available execution machine for each test case, transmitting element 23 is from the root directory of the test block distributed belonging to the complete each test case of available execution machine, obtain the Hosts file of this test block, and then by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case.
Like this, described available execution machine then can utilize described Hosts file, runs this test case.Be understandable that, available execution machine is run a complete test case and is namely released, and to become idle execution machine resource, for selenium-grid application, this available execution machine is distributed to other test cases.
The method provided for making the embodiment of the present application clearly, see the citing about three test blocks and test block A, test block B and test piece C in embodiment corresponding to Fig. 1, can repeat no more herein.
In the present embodiment, after receiving element receives the execution machine resource request of at least two test cases, situation is taken according to execution machine resource by allocation units, for each test case distributes available execution machine, and then transmitting element can by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, described Hosts file is utilized to make described available execution machine, run this test case, due to the test case included by the multiple test block of concurrent running, therefore, the execution time of test operation can be greatly reduced, thus improve the efficiency of test operation.
In addition, adopt the technical scheme that the application provides, without the need to the increase along with test case quantity, split test block, the problem of the increase of fractionation cost and the maintenance cost caused because fractionation test block runs the test block after splitting by multiple execution machine in prior art can be avoided, thus effectively can reduce the running cost of test block.
In addition, adopt the technical scheme that the application provides, without the need to waiting for that a test block runs complete another test block that just brings into operation afterwards, but the test case included by the multiple test block of concurrent running, thus improve the dirigibility of test operation.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that, disclosed system, apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or page assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that hardware also can be adopted to add SFU software functional unit realizes.
The above-mentioned integrated unit realized with the form of SFU software functional unit, can be stored in a computer read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) perform the part steps of method described in each embodiment of the application.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above embodiment is only in order to illustrate the technical scheme of the application, be not intended to limit; Although with reference to previous embodiment to present application has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of each embodiment technical scheme of the application.

Claims (10)

1. a method of testing, is applied in the operational process of at least two test blocks, and each test block comprises at least one test case, it is characterized in that, described method comprises:
Receive the execution machine resource request of at least two test cases;
Situation is taken, for each test case distributes available execution machine according to execution machine resource;
By each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, to make described available execution machine utilize described Hosts file, runs this test case.
2. method according to claim 1, is characterized in that, before the execution machine resource request of described reception at least two test cases, also comprises:
By the detecting information in described at least two test blocks corresponding to each test block, download at least two respectively from equipment; Wherein, the detecting information corresponding to described each test block comprises the Hosts file of this test block and this test block;
Utilize multithread mode, described at least two each from equipment from equipment, run described each test block.
3. method according to claim 2, is characterized in that, described by the detecting information in described at least two test blocks corresponding to each test block, downloads at least two respectively from equipment, comprising:
By described each test block, described in downloading to respectively at least two from equipment;
By the Hosts file of described each test block, under writing the root directory of described each test block.
4. method according to claim 2, is characterized in that, the execution machine resource request of described reception at least two test cases, comprising:
Utilize multithread mode, receive the execution machine resource request of at least two test cases that at least two threads send respectively.
5. the method according to the arbitrary claim of Claims 1 to 4, is characterized in that, described method also comprises:
In each available execution machine, run autoexec, so that the Hosts file of the test block belonging to described each test case is override original Hosts file.
6. a proving installation, is applied in the operational process of at least two test blocks, and each test block comprises at least one test case, it is characterized in that, described device comprises:
Receiving element, for receiving the execution machine resource request of at least two test cases;
Allocation units, for taking situation, for each test case distributes available execution machine according to execution machine resource;
Transmitting element, for by each test case, and the Hosts file of test block belonging to this test case sends to the available execution machine of distributing for this test case, to make described available execution machine utilize described Hosts file, runs this test case.
7. device according to claim 6, is characterized in that, described device also comprises:
Download unit, for by the detecting information in described at least two test blocks corresponding to each test block, downloads at least two respectively from equipment; Wherein, the detecting information corresponding to described each test block comprises the Hosts file of this test block and this test block;
Running unit, for utilizing multithread mode, described at least two each from equipment from equipment, run described each test block.
8. device according to claim 7, is characterized in that, described download unit, specifically for
By described each test block, described in downloading to respectively at least two from equipment; And
By the Hosts file of described each test block, under writing the root directory of described each test block.
9. device according to claim 7, is characterized in that, described receiving element, specifically for
Utilize multithread mode, receive the execution machine resource request of at least two test cases that at least two threads send respectively.
10. the device according to the arbitrary claim of claim 6 ~ 9, is characterized in that, described device also comprises replacement unit, for
In each available execution machine, run autoexec, so that the Hosts file of the test block belonging to described each test case is override original Hosts file.
CN201410092181.5A 2014-03-13 2014-03-13 Testing method and device Pending CN104915288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410092181.5A CN104915288A (en) 2014-03-13 2014-03-13 Testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410092181.5A CN104915288A (en) 2014-03-13 2014-03-13 Testing method and device

Publications (1)

Publication Number Publication Date
CN104915288A true CN104915288A (en) 2015-09-16

Family

ID=54084366

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410092181.5A Pending CN104915288A (en) 2014-03-13 2014-03-13 Testing method and device

Country Status (1)

Country Link
CN (1) CN104915288A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224464A (en) * 2015-11-10 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of parallel automated testing method
CN108574604A (en) * 2017-03-07 2018-09-25 北京京东尚科信息技术有限公司 test method and device
CN110795332A (en) * 2018-08-03 2020-02-14 北京京东尚科信息技术有限公司 Automatic testing method and device
CN111090574A (en) * 2018-10-23 2020-05-01 深圳云天励飞技术有限公司 Regression testing method and device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1969262A (en) * 2004-06-14 2007-05-23 皇家飞利浦电子股份有限公司 Interface device for debugging and/or tracing a computer system comprising one or multiple masters and one or multiple slaves working together
CN1967500A (en) * 2006-04-19 2007-05-23 华为技术有限公司 Resource using method in automatic testing process
CN101421726A (en) * 2004-05-20 2009-04-29 Bea***公司 Occasionally-connected application server
CN101645036A (en) * 2009-09-11 2010-02-10 兰雨晴 Method for automatically distributing test tasks based on capability level of test executor
CN102012845A (en) * 2010-12-16 2011-04-13 迈普通信技术股份有限公司 Method for improving utilization rate of automatic testing resources
CN102609352A (en) * 2011-01-19 2012-07-25 阿里巴巴集团控股有限公司 Parallel testing method and parallel testing server
US20130159772A1 (en) * 2011-12-15 2013-06-20 International Business Machines Corporation Verifying Speculative Multithreading In An Application

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101421726A (en) * 2004-05-20 2009-04-29 Bea***公司 Occasionally-connected application server
CN1969262A (en) * 2004-06-14 2007-05-23 皇家飞利浦电子股份有限公司 Interface device for debugging and/or tracing a computer system comprising one or multiple masters and one or multiple slaves working together
CN1967500A (en) * 2006-04-19 2007-05-23 华为技术有限公司 Resource using method in automatic testing process
CN101645036A (en) * 2009-09-11 2010-02-10 兰雨晴 Method for automatically distributing test tasks based on capability level of test executor
CN102012845A (en) * 2010-12-16 2011-04-13 迈普通信技术股份有限公司 Method for improving utilization rate of automatic testing resources
CN102609352A (en) * 2011-01-19 2012-07-25 阿里巴巴集团控股有限公司 Parallel testing method and parallel testing server
US20130159772A1 (en) * 2011-12-15 2013-06-20 International Business Machines Corporation Verifying Speculative Multithreading In An Application

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
全国高等教育自学考试命题研究组: "《计算机原理应试指导及模拟试题》", 31 March 2002, 中国大地出版社 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224464A (en) * 2015-11-10 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of parallel automated testing method
CN108574604A (en) * 2017-03-07 2018-09-25 北京京东尚科信息技术有限公司 test method and device
CN110795332A (en) * 2018-08-03 2020-02-14 北京京东尚科信息技术有限公司 Automatic testing method and device
CN111090574A (en) * 2018-10-23 2020-05-01 深圳云天励飞技术有限公司 Regression testing method and device and storage medium
CN111090574B (en) * 2018-10-23 2024-02-27 深圳云天励飞技术有限公司 Regression testing method, device and storage medium

Similar Documents

Publication Publication Date Title
JP6294886B2 (en) Generate native code from intermediate language code for applications
CN107534571B (en) Method, system and computer readable medium for managing virtual network functions
US10353728B2 (en) Method, system and device for managing virtual machine software in cloud environment
EP3333704A1 (en) Method and apparatus for repairing kernel vulnerability
US7971047B1 (en) Operating system environment and installation
EP3035191B1 (en) Identifying source code used to build executable files
CN104156243A (en) Application distribution and rapid loading and running system and method
CN104539487A (en) Method for testing system based on cloud platform and evaluating reliability
CN103795759A (en) Method and system for scheduling virtual machine mirror image file
WO2014035309A1 (en) Re-configuration in cloud computing environments
JP2023139043A (en) Just-in-time container
CN107707687A (en) A kind of method and apparatus of virtual machine IP address configuration
CN106126303B (en) Installation method, the apparatus and system of (SuSE) Linux OS
CN106873970B (en) Installation method and device of operating system
CN104915288A (en) Testing method and device
CN108170588B (en) Test environment construction method and device
CN104580378A (en) Installation package processing method and device
CN111124420A (en) Compiling method, device, electronic equipment and readable storage medium
CN105183528A (en) Server bios upgrading method and system
US20180203726A1 (en) Virtual machine migration method and apparatus
CN113760306A (en) Method and device for installing software, electronic equipment and storage medium
CN106209445B (en) A kind of Visualized data centre disposed by network
CN116685946A (en) Reloading of updated shared libraries without stopping execution of an application
Bhardwaj et al. Serving mobile apps: A slice at a time
CN112491940B (en) Request forwarding method and device of proxy server, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150916