CN102014023B - VB Script based automatic testing method of network equipment products - Google Patents

VB Script based automatic testing method of network equipment products Download PDF

Info

Publication number
CN102014023B
CN102014023B CN201010572288A CN201010572288A CN102014023B CN 102014023 B CN102014023 B CN 102014023B CN 201010572288 A CN201010572288 A CN 201010572288A CN 201010572288 A CN201010572288 A CN 201010572288A CN 102014023 B CN102014023 B CN 102014023B
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.)
Expired - Fee Related
Application number
CN201010572288A
Other languages
Chinese (zh)
Other versions
CN102014023A (en
Inventor
姚翠松
殷建儒
时培昕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Opzoon Technology Co Ltd
Original Assignee
Opzoon Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Opzoon Technology Co Ltd filed Critical Opzoon Technology Co Ltd
Priority to CN201010572288A priority Critical patent/CN102014023B/en
Publication of CN102014023A publication Critical patent/CN102014023A/en
Application granted granted Critical
Publication of CN102014023B publication Critical patent/CN102014023B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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

Network equipment product automation method of testing based on VB Script
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 according to test item one by one, after test is accomplished, test result carried out hand-kept and arrangement gathers.For manual test, because all tests all need manual the completion, 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 line tester test can't be strict unified.
2, semi-automatic test: partial test script or test command are provided, carry out automatic test, but most work still needs manual operations to accomplish, test result hand-kept and arrangement in certain stage of test.Semi-automatic test is with respect to manual test, and efficient improves, but artificial composition of participating 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 when man-machine interaction, to do a spot of operation, and test generates test file after accomplishing automatically.For the full-automation test, scripts such as many at present employing Tcl, Python design, though solved problem 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) complicacy 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
The technical problem that (one) will solve
The technical problem that the present invention will solve 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; Test sign puts 0, and 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 of extracting and input compared judges whether that through this test if do not pass through, then said test sign is added 1, test is accomplished 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 said 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 the position of said text;
The sequence number of the sequence number that extracts and user's input is compared, choose the equipment matched sequence number, extract the network interface mac address information of this Equipment Serial Number corresponding row simultaneously.
Wherein, also comprise between said step S1 and the S2:
Said test command collection is done to postpone to handle, to guarantee that each order is by correct execution.
Wherein, the rule that character string is extracted among the said step S2:
It is B that desire is extracted character string; Between character string A, C, constructed fuction 1 locking character string A utilizes 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, confirms its end position through 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, confirms its original position through searching character string C in output content, and and function 1 does iterative processing, thereby obtains the character string B of desire extraction.
Wherein, the mode that among the said step S3 test variable of character string of extracting and input is compared is:
If test variable is a character string, directly character string that extracts and said test variable are compared, identical then through test; If test variable is numerical value, need the character string that extract be carried out the integer conversion, the conversion back compares with said test variable, and is identical or be in the predetermined number range then through test.
Wherein, writing processing among the said step S4 specifically comprises:
Convert said test result file to Excel or XML file format, if convert the Excel file format into, the different information of each row of test result file call format are cut apart with tab key; If convert the XML file format into, the test result file call format meets the XML form.
Wherein, also comprise step before the said step S1: when the test beginning, autotest program carries out internal memory and interface loopback test to test products.
Wherein, said 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 based on the autotest program of VB Script through operation, has improved on the production line complexity that the 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 accompanying drawing and embodiment, specific embodiments of the invention describes in further detail.Following examples are used to explain the present invention, but are not used for limiting scope of the present 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, and 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 through scanner; Text to configuration travels through, and extracts the sequence number information of every row, and every row of text comprises: sequence number information and network interface mac address information; Cut apart through tab key between them, specify in autotest program said text position.
The sequence number of the sequence number that extracts and user's input is compared, choose the equipment matched sequence number, 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 each order, also comprise between each order to the test command collection and do to postpone to handle by correct execution.
Step S102, autotest program is tested each test item, and the operation result of autotest program is carried out the character string extraction.Through WaitForString (A) and ReadForString (C) function confirm the character string B that will extract, this character string B is between character string A and character string C, wherein, A and C have been the character string of sign effect, are 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, confirms its end position through 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; Confirm its original position through 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 through 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 through testing.
If test variable is a numerical value; Need the character string that extract be carried out the integer conversion; Compare with test variable after doing the proper functions computing, if conversion back is identical with test variable or be in the predetermined number range, then through testing; Test variable value as setting is 3, and calculate through test in number range 2.7~3.3 the test back so.
If do not pass through, then will test sign and add 1, after accomplishing, each item test is masked as 0, then through test as if test.
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 convert the Excel file format into, the different information of each row of test result file call format are cut apart with tab key; If convert the XML file format into, the test result file call format meets the XML form.
Above execution mode only is used to explain 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 be made 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; Test sign puts 0, and 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 of extracting and input compared judges whether that through this test if do not pass through, then said test sign is added 1, test is accomplished 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 said 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 the position of said text;
The sequence number of the sequence number that extracts and user's input is compared, choose the equipment matched sequence number, 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 is characterized in that, also comprises between said step S1 and the S2:
Said test command collection is done to postpone to handle, to guarantee that each order is by correct execution.
4. the network equipment product automation method of testing based on VB Script as claimed in claim 1 is characterized in that, the rule that character string is extracted among the said step S2:
It is B that desire is extracted character string; Between character string A, C, constructed fuction 1 locking character string A utilizes 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, confirms its end position through 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, confirms its original position through 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, the mode that among the said step S3 test variable of character string of extracting and input is compared is:
If test variable is a character string, directly character string that extracts and said test variable are compared, identical then through test; If test variable is numerical value, need the character string that extract be carried out the integer conversion, the conversion back compares with said test variable, and is identical or be in the predetermined number range then through 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 said step S4 and specifically comprises:
Convert said test result file to Excel or XML file format, if convert the Excel file format into, the different information of each row of test result file call format are cut apart with tab key; If convert the XML file format into, 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 said step S1: when the test beginning, autotest program carries out internal memory and interface loopback test to test products.
8. like each described network equipment product automation method of testing in the claim 1~7 based on VB Script; It is characterized in that said test item comprises: processor, internal memory, network interface MAC Address, interrupting information, rotation speed of the fan, magnitude of voltage and lamp state.
CN201010572288A 2010-12-03 2010-12-03 VB Script based automatic testing method of network equipment products Expired - Fee Related CN102014023B (en)

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 CN102014023A (en) 2011-04-13
CN102014023B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102854875B (en) * 2012-07-13 2015-06-24 惠州市德赛西威汽车电子有限公司 Automobile air conditioner controller testing method and system
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
CN106789260B (en) * 2016-12-26 2020-11-20 中国银联股份有限公司 System and method for high availability drilling of network devices
CN112235157B (en) * 2020-09-30 2022-05-17 广州鲁邦通物联网科技股份有限公司 Router equipment testing method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1952818B (en) * 2005-10-22 2010-12-15 康佳集团股份有限公司 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
CN101158708B (en) * 2007-10-23 2011-05-04 无锡汉柏信息技术有限公司 Multiple chips automatic test method based on programmable logic device

Also Published As

Publication number Publication date
CN102014023A (en) 2011-04-13

Similar Documents

Publication Publication Date Title
CN102014023B (en) VB Script based automatic testing method of network equipment products
CN102508654B (en) Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)
CN102147726B (en) Script-based method for implementing service configuration
CN101174237B (en) Automatic test method, system and test device
CN110765639A (en) Electrical simulation modeling method and device and readable storage medium
CN103077192B (en) A kind of data processing method and system thereof
CN106919612A (en) A kind of processing method and processing device of SQL script of reaching the standard grade
CN104714842A (en) Method for repairing time sequence violation through adjusting clock path delay
CN102902526B (en) A kind of automation method to set up that realizes BMC and IP information by time delay
WO2015188586A1 (en) Data transmission method, electronic equipment, usb equipment and storage medium
CN102486748A (en) Method and device for performance test
CN111381142A (en) Semiconductor automatic test equipment and test method for improving test flow efficiency
CN110489297A (en) A kind of FPGA debugging signal setting method based on graphical interfaces
CN106980518B (en) Method for batch inspection of process design files
CN111898351B (en) Automatic Excel data importing method and device based on Aviator, terminal equipment and storage medium
CN103856365A (en) Automatic testing method and system of client terminal access equipment
CN110377566A (en) Arrange the method and system of the S parameter test file of PCB
CN105468521A (en) Pointer related semantic error location method based on subgraph search
CN106354966B (en) The method of the conversion of chip id E project file and rapid configuration artificial debugging environment
CN108228314A (en) A kind of Virtual prototype error-detecting method based on equipment stipulations
CN106599499A (en) Method for automatically generating XilinxFPGA constraint file
CN102843269A (en) Method and system of analog microcode business processing flow
CN112463596A (en) Test case data processing method, device and equipment and processing equipment
CN103440214B (en) Method and device for rapidly identifying plugged USB (Universal Serial Bus) equipment
CN105700899A (en) Update method and device of man-machine command script

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