CN102014023A - VB Script based automatic testing method of network equipment products - Google Patents
VB Script based automatic testing method of network equipment products Download PDFInfo
- Publication number
- CN102014023A CN102014023A CN 201010572288 CN201010572288A CN102014023A CN 102014023 A CN102014023 A CN 102014023A CN 201010572288 CN201010572288 CN 201010572288 CN 201010572288 A CN201010572288 A CN 201010572288A CN 102014023 A CN102014023 A CN 102014023A
- Authority
- CN
- China
- Prior art keywords
- test
- character string
- equipment
- script
- network equipment
- 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
Links
Images
Abstract
The invention discloses a VB Script based automatic testing method of network equipment products, comprising the following steps: S1. the automatic testing program reads the test variables, the serial number of the equipment and the network interface MAC address which are set by the user and issues the test command set, wherein each test variable initializes the assignment; the test mark is 0; the network interface MAC address is used for forwarding two layers of traffics; the test command set is issued mainly for configuring the device register; S2. when the equipment runs, the automatic testing program tests the test items of the equipment and extracts the character strings from the running result of the equipment; S3. the extracted character strings and the input test variables are compared to judge whether the test is successful, if no, 1 is added to the test mark, and if the test mark is 0 after testing, the test is successful; and S4. the test result files are automatically generated and written. The test improves the testing efficiency of the products on the production line.
Description
Technical field
The present invention relates to the product test technical field, particularly a kind of network equipment product automation method of testing based on VB Script.
Background technology
For production test, at present commonly used have a following several method:
1, manual test: production line the tester test one by one according to test item, the test finish after, to test result carry out hand-kept and the arrangement gather.For manual test, because all tests all need manual finishing, following situation appears inevitably:
A) can only be applicable to small lot batch manufacture, inefficiency;
B) mistake appears in production line tester easily;
C) standard of different production line tester tests can't be strict unified.
2, semi-automatic test: partial test script or test command are provided, carry out automatic test in certain stage of test, but most work need still manual operations to finish, test result hand-kept and arrangement.Semi-automatic test is with respect to manual test, and efficient improves, but the artificial composition that participates in is still more, and the problem that exists for manual test still can occur.
3, full-automatic test: utilize the script of having developed to carry out automatic test, the production line tester only needs to do a spot of operation when man-machine interaction, after test is finished, generates test file automatically.For the full-automation test, scripts such as many at present employing Tcl, Python design, though solved the problem of manual and semi-automatic test, this framework has following problem:
A) interactivity is bad, and the good man-machine interaction interface can't be provided;
B) complexity is built, disposed to test environment, and the testing standard disunity is unfavorable for revising and operation, and therefore, the testing efficiency to product on the production line is low.
Summary of the invention
(1) technical problem that will solve
The technical problem to be solved in the present invention is: how to improve on the production line testing efficiency to product.
(2) technical scheme
For solving the problems of the technologies described above, the invention provides a kind of network equipment product automation method of testing based on VB Script, may further comprise the steps:
S1: autotest program reads test variable, Equipment Serial Number, the network interface MAC Address that the user sets, and issue the test command collection, each test variable initialization assignment, the test sign puts 0, the network interface MAC Address is used for two laminar flow amounts to be transmitted, and the issuing to be mainly used in of test command collection is configured device register;
S2: during equipment operation, autotest program is tested each test item of equipment, and the operation result of equipment is carried out the character string extraction;
S3: the test variable of the character string extracted and input compared judges whether that by this test if do not pass through, then described test sign is added 1, test is finished the back if test is masked as 0, then passes through to test;
S4: generate test result file automatically and write processing.
Wherein, the process of read test variable, Equipment Serial Number, interface mac address is among the described step S1:
Autotest program receives the Equipment Serial Number of user's input, and the text that disposes is traveled through, and extracts the sequence number information of every row, and specify in autotest program described text position;
The sequence number of extraction and the sequence number of user's input are compared, choose the Equipment Serial Number of coupling, extract the network interface mac address information of this Equipment Serial Number corresponding row simultaneously.
Wherein, also comprise between described step S1 and the S2:
Described test command collection is done to postpone to handle, be executed correctly to guarantee each order.
Wherein, character string extracting rule among the described step S2:
It is B that desire is extracted character string, between character string A, C, constructed fuction 1 locking character string A, utilize function 2 to read character string C, then the return value of function 2 is the character string B that desire is extracted, function 1 deposits the content of equipment output in Buffer, and character string A imports function 1 into the form of parameter, determines its end position by searching character string A in output content; Function 2 deposits the content of equipment output in Buffer, and character string C imports function 2 into the form of parameter, determines its original position by searching character string C in output content, and and function 1 does iterative processing, thereby obtains the character string B of desire extraction.
Wherein, character string comparison method among the described step S3:
If test variable is a character string, can directly character string and the described test variable that extracts be compared, identical then by test; If test variable is numerical value, the character string that extracts need be carried out the integer conversion, the conversion back compares with described test variable, and is identical or be in the predetermined number range then by test.
Wherein, writing processing among the described step S4 specifically comprises:
Convert described test result file to Excel or XML file format, if be converted to the Excel file format, the different information of each row of test result file call format are cut apart with tab key; If be converted to the XML file format, the test result file call format meets the XML form.
Wherein, also comprise step before the described S1: when the test beginning, autotest program carries out internal memory and interface loopback test to test products.
Wherein, described test item comprises: processor, internal memory, network interface MAC Address, interrupting information, rotation speed of the fan, magnitude of voltage and lamp state.
(3) beneficial effect
The present invention carries out automatic test to network equipment product, and the good man-machine interaction interface is provided by the autotest program of operation based on VB Script, has improved the complexity that on the production line testing efficiency of product has been reduced simultaneously test.
Description of drawings
Fig. 1 is a kind of network equipment product automation method of testing flow chart based on VB Script of the embodiment of the invention.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used to illustrate the present invention, but are not used for limiting the scope of the invention.
As shown in Figure 1, the network equipment product automation method of testing flow chart based on VB Script of the embodiment of the invention comprises:
Step S101, autotest program reads test variable, Equipment Serial Number, the network interface MAC Address that the user sets, and issue the test command collection, each test variable initialization assignment, the test sign puts 0, the network interface MAC Address is used for two laminar flow amounts to be transmitted, and the issuing to be mainly used in of test command collection is configured device register.The process that specifically reads is:
Autotest program is with the substantive requirements of form input equipment sequence number information of dialog box, can sweep sequence number by scanner, text to configuration travels through, extract the sequence number information of every row, every row of text comprises: sequence number information and network interface mac address information, cut apart by tab key between them, specify in autotest program described text position.
The sequence number of extraction and the sequence number of user's input are compared, choose the Equipment Serial Number of coupling, extract the network interface mac address information of this Equipment Serial Number corresponding row simultaneously.
In the test beginning, autotest program can carry out internal memory and interface loopback test etc. to test products.
All the other test items comprise: processor, internal memory, network interface MAC Address, interrupting information, rotation speed of the fan, magnitude of voltage and lamp state etc.
In order to guarantee that each order is executed correctly, also comprise between each order to the test command collection and do to postpone to handle.
Step S102, autotest program is tested each test item, and the operation result of autotest program is carried out the character string extraction.Determine the character string B that will extract by WaitForString (A) and ReadForString (C) function, this character string B is between character string A and character string C, and wherein, A and C have been the character string of sign effect, is used to separate the character string that needs extract.WaitForString deposits the content of equipment output in Buffer, and character string A imports WaitForString into the form of parameter, determines its end position by searching character string A in output content; ReadForString deposits the content of equipment output in Buffer, character string C imports ReadForString into the form of parameter, determine its original position by searching character string C in output content, and do iterative processing, thereby obtain the character string B that desire is extracted with WaitForString.
Step S103 compares to judge whether to be character string by test as if test variable with the character string of extraction and the content of input, can directly the character string that extracts be compared with it, if the character string that extracts is identical with test variable, then by testing.
If test variable is a numerical value, the character string that extracts need be carried out the integer conversion, compare with test variable after doing suitable functional operation, as if changing afterwards identical or being in the predetermined number range with test variable, then by test, test variable value as setting is 3, and calculate by testing in number range 2.7~3.3 the test back so.
If do not pass through, then will test sign and add 1, after finishing, every test, then passes through test if test is masked as 0.
Step S104 generates test result file automatically and writes processing.Write when handling and convert test result file to Excel or XML file format, if be converted to the Excel file format, the different information of each row of test result file call format are cut apart with tab key; If be converted to the XML file format, the test result file call format meets the XML form.
Above execution mode only is used to illustrate the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; under the situation that does not break away from the spirit and scope of the present invention; can also make various variations and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.
Claims (8)
1. the network equipment product automation method of testing based on VB Script is characterized in that, may further comprise the steps:
S1: autotest program reads test variable, Equipment Serial Number, the network interface MAC Address that the user sets, and issue the test command collection, each test variable initialization assignment, the test sign puts 0, the network interface MAC Address is used for two laminar flow amounts to be transmitted, and the issuing to be mainly used in of test command collection is configured device register;
S2: during equipment operation, autotest program is tested each test item of equipment, and the operation result of equipment is carried out the character string extraction;
S3: the test variable of the character string extracted and input compared judges whether that by this test if do not pass through, then described test sign is added 1, test is finished the back if test is masked as 0, then passes through to test;
S4: generate test result file automatically and write processing.
2. the network equipment product automation method of testing based on VB Script as claimed in claim 1 is characterized in that the process of read test variable, Equipment Serial Number, interface mac address is among the described step S1:
Autotest program receives the Equipment Serial Number of user's input, and the text that disposes is traveled through, and extracts the sequence number information of every row, and specify in autotest program described text position;
The sequence number of extraction and the sequence number of user's input are compared, choose the Equipment Serial Number of coupling, extract the network interface mac address information of this Equipment Serial Number corresponding row simultaneously.
3. the network equipment product automation method of testing based on VB Script as claimed in claim 1 or 2 is characterized in that, also comprises between described step S1 and the S2:
Described test command collection is done to postpone to handle, be executed correctly to guarantee each order.
4. the network equipment product automation method of testing based on VB Script as claimed in claim 1 is characterized in that character string extracting rule among the described step S2:
It is B that desire is extracted character string, between character string A, C, constructed fuction 1 locking character string A, utilize function 2 to read character string C, then the return value of function 2 is the character string B that desire is extracted, function 1 deposits the content of equipment output in Buffer, and character string A imports function 1 into the form of parameter, determines its end position by searching character string A in output content; Function 2 deposits the content of equipment output in Buffer, and character string C imports function 2 into the form of parameter, determines its original position by searching character string C in output content, and and function 1 does iterative processing, thereby obtains the character string B of desire extraction.
5. the network equipment product automation method of testing based on VB Script as claimed in claim 1 is characterized in that character string comparison method among the described step S3:
If test variable is a character string, can directly character string and the described test variable that extracts be compared, identical then by test; If test variable is numerical value, the character string that extracts need be carried out the integer conversion, the conversion back compares with described test variable, and is identical or be in the predetermined number range then by test.
6. the network equipment product automation method of testing based on VB Script as claimed in claim 1 is characterized in that, writes processing among the described step S4 and specifically comprises:
Convert described test result file to Excel or XML file format, if be converted to the Excel file format, the different information of each row of test result file call format are cut apart with tab key; If be converted to the XML file format, the test result file call format meets the XML form.
7. the network equipment product automation method of testing based on VB Script as claimed in claim 1 is characterized in that, also comprises step before the described S1: when the test beginning, autotest program carries out internal memory and interface loopback test to test products.
8. as each described network equipment product automation method of testing in the claim 1~7 based on VB Script, it is characterized in that described test item comprises: processor, internal memory, network interface MAC Address, interrupting information, rotation speed of the fan, magnitude of voltage and lamp state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010572288A CN102014023B (en) | 2010-12-03 | 2010-12-03 | VB Script based automatic testing method of network equipment products |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010572288A CN102014023B (en) | 2010-12-03 | 2010-12-03 | VB Script based automatic testing method of network equipment products |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102014023A true CN102014023A (en) | 2011-04-13 |
CN102014023B CN102014023B (en) | 2012-08-29 |
Family
ID=43844049
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010572288A Expired - Fee Related CN102014023B (en) | 2010-12-03 | 2010-12-03 | VB Script based automatic testing method of network equipment products |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102014023B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102854875A (en) * | 2012-07-13 | 2013-01-02 | 惠州市德赛西威汽车电子有限公司 | Automobile air conditioner controller testing method and system |
CN103856365A (en) * | 2012-12-05 | 2014-06-11 | 深圳市共进电子股份有限公司 | Automatic testing method and system of client terminal access equipment |
CN106227670A (en) * | 2016-08-05 | 2016-12-14 | 成都广达新网科技股份有限公司 | A kind of EPON equipment order automatic testing method |
CN106789260A (en) * | 2016-12-26 | 2017-05-31 | 中国银联股份有限公司 | System and method for carrying out High Availabitity rehearsal to the network equipment |
CN112235157A (en) * | 2020-09-30 | 2021-01-15 | 广州鲁邦通物联网科技有限公司 | Router equipment testing method and system based on two-layer network |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1952818A (en) * | 2005-10-22 | 2007-04-25 | 康佳集团股份有限公司 | Testing method of program unit with capability of checking test result automatically |
CN101158708A (en) * | 2007-10-23 | 2008-04-09 | 无锡汉柏信息技术有限公司 | Multiple chips automatic test method based on programmable logic device |
CN101261579A (en) * | 2007-03-08 | 2008-09-10 | 青牛(北京)技术有限公司 | Method for accomplishing VBScript language trans-platform uses |
-
2010
- 2010-12-03 CN CN201010572288A patent/CN102014023B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1952818A (en) * | 2005-10-22 | 2007-04-25 | 康佳集团股份有限公司 | Testing method of program unit with capability of checking test result automatically |
CN101261579A (en) * | 2007-03-08 | 2008-09-10 | 青牛(北京)技术有限公司 | Method for accomplishing VBScript language trans-platform uses |
CN101158708A (en) * | 2007-10-23 | 2008-04-09 | 无锡汉柏信息技术有限公司 | Multiple chips automatic test method based on programmable logic device |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102854875A (en) * | 2012-07-13 | 2013-01-02 | 惠州市德赛西威汽车电子有限公司 | Automobile air conditioner controller testing method and system |
CN102854875B (en) * | 2012-07-13 | 2015-06-24 | 惠州市德赛西威汽车电子有限公司 | Automobile air conditioner controller testing method and system |
CN103856365A (en) * | 2012-12-05 | 2014-06-11 | 深圳市共进电子股份有限公司 | Automatic testing method and system of client terminal access equipment |
CN103856365B (en) * | 2012-12-05 | 2018-09-14 | 深圳市共进电子股份有限公司 | Client terminal access device automatic test approach and system |
CN106227670A (en) * | 2016-08-05 | 2016-12-14 | 成都广达新网科技股份有限公司 | A kind of EPON equipment order automatic testing method |
CN106789260A (en) * | 2016-12-26 | 2017-05-31 | 中国银联股份有限公司 | System and method for carrying out High Availabitity rehearsal to the network equipment |
CN112235157A (en) * | 2020-09-30 | 2021-01-15 | 广州鲁邦通物联网科技有限公司 | Router equipment testing method and system based on two-layer network |
CN112235157B (en) * | 2020-09-30 | 2022-05-17 | 广州鲁邦通物联网科技股份有限公司 | Router equipment testing method and system |
Also Published As
Publication number | Publication date |
---|---|
CN102014023B (en) | 2012-08-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102014023B (en) | VB Script based automatic testing method of network equipment products | |
CN101526919B (en) | Method for generating script files to test Web application software and device thereof | |
CN102508654B (en) | Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller) | |
CN105068929A (en) | Test script generation method, test script generation device, testing method, testing device and testing system | |
CN102147726B (en) | Script-based method for implementing service configuration | |
CN104714842A (en) | Method for repairing time sequence violation through adjusting clock path delay | |
CN104246521A (en) | Method and device for automatic test of relay protection function of intelligent susbstation | |
CN110765639A (en) | Electrical simulation modeling method and device and readable storage medium | |
CN101174237B (en) | Automatic test method, system and test device | |
CN103077192B (en) | A kind of data processing method and system thereof | |
CN109299530A (en) | A kind of emulation testing case generation method, system, storage medium and terminal | |
CN102902526B (en) | A kind of automation method to set up that realizes BMC and IP information by time delay | |
US7703058B2 (en) | Method and system for changing a description for a state transition function of a state machine engine | |
CN102486748A (en) | Method and device for performance test | |
CN1996265A (en) | Method and system for implementing automatic testing | |
CN103856365A (en) | Automatic testing method and system of client terminal access equipment | |
CN115543847A (en) | Method for automatically generating test case based on UI design draft | |
CN107300873A (en) | control device, control method and device | |
CN106599499A (en) | Method for automatically generating XilinxFPGA constraint file | |
CN112346921A (en) | Automatic function test system | |
CN105700899A (en) | Update method and device of man-machine command script | |
CN103440214B (en) | Method and device for rapidly identifying plugged USB (Universal Serial Bus) equipment | |
CN108322485A (en) | Free switching method and device based on NB-IoT networks | |
CN109408395A (en) | Parsing test macro based on txt file | |
CN109783417A (en) | A kind of serial communication device and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
PP01 | Preservation of patent right |
Effective date of registration: 20180823 Granted publication date: 20120829 |
|
PP01 | Preservation of patent right | ||
PD01 | Discharge of preservation of patent |
Date of cancellation: 20210823 Granted publication date: 20120829 |
|
PD01 | Discharge of preservation of patent | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120829 Termination date: 20181203 |
|
CF01 | Termination of patent right due to non-payment of annual fee |