CN104156461A - Method and device for testing pressure of gateway products - Google Patents
Method and device for testing pressure of gateway products Download PDFInfo
- Publication number
- CN104156461A CN104156461A CN201410414282.XA CN201410414282A CN104156461A CN 104156461 A CN104156461 A CN 104156461A CN 201410414282 A CN201410414282 A CN 201410414282A CN 104156461 A CN104156461 A CN 104156461A
- Authority
- CN
- China
- Prior art keywords
- network address
- webpage
- module
- browser
- gateway
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Abstract
The invention discloses a method and device for testing pressure of gateway products. According to the method, a testing terminal is used for having access to the Internet through a tested gateway, web pages are opened continuously on the testing terminal, the pressure testing indexes are obtained by detecting the correct opening rate of the web pages, a website file is set on the testing terminal, a website list and corresponding detecting elements are stored in the website file, the web pages are automatically opened through a browser, and the testing terminal has access to the Internet. The method comprises the steps that the web pages are automatically opened, web page loading is stopped, and whether the web pages are normally opened or not is detected. The method and device have the advantages that labor is saved, the dead time taken when an automatic tool cannot load the web pages completely is shortened, and the problem that a subsequent automation case cannot continue to run due to web page loading is avoided.
Description
Technical field
The present invention relates to gateway product pressure test field, be particularly related to and a kind ofly utilize tested gateway product to browse the webpage on INTERNET by test terminal, on test terminal, realize method and the proving installation of tested gateway product pressure test by automatic unlatching webpage.
Background technology
Pressure test, is a kind of method of testing of establishing system stability, and in the field such as soft project, financial risk management, application is commonplace.Conventionally outside system normal operation scope, carry out, to investigate its function limit and hidden danger.
Gateway (Gateway) claim again gateway, protocol converter.Gateway to realize network interconnection, is the most complicated network interconnection apparatus, network interconnection in transport layer, only for two network interconnections that upper-layer protocol is different.The structure of gateway is also similar with router, and different is interconnection layer.Gateway both can interconnect for wide area network, also can be for local area network interconnection.Gateway is a kind of computer system or equipment of changing important task of serving as.Using different communication protocol, data layout or language, even, between the diverse two kinds of systems of architecture, gateway is a translater.
Gateway is carried out to the important ring that pressure test is gateway product factory testing, and at present, gateway product carries out pressure stability test: under selected force value, continuous service carries out stability test for 24 hours above.Client is ceaselessly carried out various operations by testing tool Reality simulation user conventionally.The necessary performance index of monitor server and actual customer end.By the standard of pressure test make property indices in specified scope without memory overflow, without system crash, non-functional fault etc.
In the time that gateway product is carried out to pressure test, by utilizing tested gateway product browsing page by a test terminal, constantly open webpage, and by checking that webpage unlatching rate obtains the pressure test situation of tested gateway product.But at present there is such problem in testing tool: open webpage run into network condition when unstable webpage load imperfect instrument and will stop at for a long time and wait for that the process that webpage loads can not continue operation, needs manual intervention.
Summary of the invention
The method of pressure test is provided providing a kind of test terminal to utilize tested gateway product browsing page object of the present invention, and the method is automatically opened webpage without manual intervention on test terminal.
The present invention is achieved through the following technical solutions: a kind of gateway product method for testing pressure, the method is by utilizing test terminal through tested gateway access internet, on test terminal, continuously open webpage, obtain pressure test index by the correct unlatching rate that detects webpage, network address file is set on test terminal, in network address file, preserve list of websites and corresponding detection elements, utilize browser automatically to open webpage, comprise the following steps:
Step 1, test terminal are connected in INTERNET by tested gateway;
The browser of step 2, startup test terminal is selected a network address from network address file, loads this webpage;
Step 3, after the designated time, stop loading, retain the web page contents that loaded, by detecting the web page contents detection elements comparison corresponding with the network address of this webpage, judge whether this webpage is opened successfully;
Step 4, repeating step 2 and step 3 set point number;
The daily record of step 5, the each operation of record, opens successful sum by webpage and is scaled number percent, and shows.
The invention has the beneficial effects as follows, save manpower, save the dead time of automation tools cannot complete Web page loading time, avoid follow-up robotization use-case cannot continue the problem of operation because webpage is loaded as.
Preferred version of the present invention comprises: in network address file, only preserve the detection elements of at least preserving two network address and corresponding network address in the detection elements of a network address and this network address or network address file.
In step 2, be a network address obtaining at random network address file, and Web page loading step 4 set point number it is 200 times.
Gateway product can be wired, can be also wireless gateway.
The present invention also provides a kind of device of gateway product pressure test, comprises test terminal, and described test terminal, by tested gateway product connecting Internet, comprises in described test terminal:
Browser, stores the network address file of list of websites and corresponding detection elements, reads the network address in described network address file and this network address is loaded into the webpage load-on module of described browser, timing module, exits Web page module, preserves module, judge module, counting module.
Described timing module is opened timing when webpage and is started network address being loaded into browser, triggers to exit Web page module and stop loading described webpage when timing finishes; Described preservation module is preserved the web page contents having loaded; Judge module detects in web page contents whether have the detection elements in described network address file, if had, judge that webpage loads normal, otherwise it is undesired to judge that webpage loads.Counting module judges that to described judge module webpage loads normal or undesired counting, and calculates webpage and open successful number percent.
The present invention realize automatic unlatching webpage and stay for some time after (residence time length can be set as required) judge that more whether webpage successfully open, the method stops webpage and loads after can automatically waiting for time of setting, whether the unit having loaded by judgement usually detects webpage and successfully opens, effect is very obvious, has saved the time that a large amount of automatic operatings wait for that webpage loads.Used tool of the present invention is developed based on open source software robot framework 2.8.1.
Brief description of the drawings
Fig. 1 is that in the present invention, tested gateway connecting Internet networking diagram is passed through in test terminal.
Fig. 2 is process flow diagram of the present invention.
Embodiment
Below in conjunction with embodiment, the present invention is described in further detail, but embodiments of the present invention are not limited to this.
In Fig. 1, as test terminal is a computing machine, this computing machine is provided with network interface card and browser, can be pulled into internet by tested gateway DUT, tested gateway product can be that wired gateway product can be also radio network gateway product, if radio network gateway product adds wireless network card in computing machine, computing machine is by wireless network card and gateway product access internet.
In computing machine machine, there is network address file (weburltable.xls), preserved network address and detection elements corresponding thereto, in the time opening webpage, if receive these detection elements, can judge that webpage unlatching is normal.In network address file, can only preserve a conventional network address and detection elements corresponding to this network address, like this in following testing process, the same webpage of the each unlatching of computing machine, at several seconds with backed off after random, content and the detection elements that can receive this webpage by detection compare, if there are these elements, can think that this unlatching of this webpage completes, otherwise can think that unlatching is unsuccessful.
Certainly in network address file, also can there be other network address and the corresponding detection elements of a lot of collections, in the time opening webpage, can select at random these network address, certainly, also can open webpage according to these network address of the select progressively of arranging.
In Fig. 2, concrete implementing procedure is as follows:
s101:move on computers master routine, offer two kinds of connection modes of user and select.Pattern 1, wired network adapter mode connects (wired network adapter configuration DHCP mode is obtained to address); Pattern 2, wireless network card mode connects (being connected to tested gateway product by SSID);
s102:master routine reads the network address file (weburltable.xls) of depositing on computing machine and obtains list of websites and corresponding detection elements.Detection elements is generally the Xpath of webpage LOGO in webpage, judge by Selenium storehouse in robot framework 2.8.1 whether (element of appointment comes from the corresponding inspection element of network address that S102 obtains) element exists, and return to judged result.
Concrete access method is: the worksheet that master routine is found corresponding file and need to be read by correct path, is identified and obtained work at present table specify columns data by row.
Specific code is as follows:
{ EXECDIR} # prints robotization use-case catalogue to Log $
File Should Exist $ EXECDIR} $ URL_TABLE} # confirm test case exist.
${excel_file_path} Set Variable ${EXECDIR}\\${URL_TABLE}
# initialization Excel
Init Excel excel_custom_alias ${excel_file_path}
Excel Load Book
Excel Switch Sheet argument table
${data1} Excel Get Sheet Row Values 1
Comment Log ${data1}
# gets " network address "
$ { lst1_index} Get Index From List $ { data1} network address
${col_no} Evaluate ${lst1_index}+1
${URL_values} Excel Get Sheet Col Values ${col_no}
Log ${URL_values}
# gets " element inspection "
{ { data1} element checks lst2_index} Get Index From List $ $
${col2_no} Evaluate ${lst2_index}+1
${Element_values} Excel Get Sheet Col Values ${col2_no}
$ { col_index} Evaluate $ { lst2_index}+2 # result
$ { col_mark_index} Evaluate $ { col_index}+1 # remarks
Set Global Variable ${col_index}
Set Global Variable ${col_mark_index}
Log ${Element_values}
s103:use FOR round-robin algorithm, using user require test open webpage test as circulation maximum times as 200 times, reach user and require number of times to jump out circulation.
s104:on computing machine, need to pre-install IE browser or red fox browser, can select as required to want the browser of use.Testing tool support is at present preferably IE browser and red fox browser.Testing tool is automatically controlled PC and is opened webpage (passing the random network address in the network address obtained of S102 here), after several seconds, stopping loading the method that stops loading after the several seconds is, the time delay of employing VB script simulation several seconds again simulating keyboard is pressed " ESC ", button
Run asyncrun.vbs "${CURDIR}\\${vbactivesendkey} ${active_window_name} ${inputstr_or_delaytime_or_inputkey}"
Theactivewindow, and button (being with self-defined time delay) [optional] is formulated in input
When inputstr_or_delaytime_or_inputkey is not while being empty, key word itself have one 100(time) * 1000(millisecond) and trial, wait for the forms appearance that active_window_name is specified.
After appearance, just can carry out the action of input key.
Active_window_name: the title of the window that is activated, if red fox browser, { EMPTY}, IE must fill out as correct IP address can to insert $
Inputstr_or_delaytime_or_inputkey: in the time that this value is empty or does not fill out, the forms that key word itself only just activates a formulation are to front end.Such as the self-defined delay of insert when this value ~ 1000 expression 1 second.Insert that { ENTER} represents to press ENTER
Be used in combination: ~ 500 { ESC} ~ 1000
Represent: 500 milliseconds of first time delays, then press esc key, then time delay 1 second
The literary style of asyncrun.vbs
dim CommandStr
Set oArgs = WScript.Arguments
For Each s In oArgs
CommandStr = CommandStr & s
Next
Set oArgs = Nothing
Set objShell = CreateObject("Wscript.Shell")
objShell.Run CommandStr
Set objShell = Nothing
s105:judge whether webpage is opened successfully, by checking in webpage whether have designed element, be generally the Xpath of webpage LOGO in webpage, judge by Selenium storehouse in robot framework 2.8.1 whether (element of appointment comes from the corresponding inspection element of network address that S102 obtains) element exists, and return to judged result.After 5 seconds, close Firefox, and remove the DNS buffer memory of PC.
s106:opens successfully if survey webpage, add add up the parameter of successfully opening webpage+1, the number of times of test, with circulation increasing certainly, has just calculated the parameter of the successful unlatching webpage finally drawing divided by total degree the number percent of webpage unlatching success ratio after having circulated;
s107:test finishes, printing test report.
Claims (8)
1. a gateway product method for testing pressure, the method is by utilizing test terminal through tested gateway access internet, on test terminal, continuously open webpage, obtain pressure test index by the correct unlatching rate that detects webpage, it is characterized in that: network address file is set on test terminal, in network address file, preserve list of websites and corresponding detection elements, utilize browser automatically to open webpage, comprise the following steps:
Step 1, test terminal are connected in INTERNET by tested gateway;
The browser of step 2, startup test terminal is selected a network address from network address file, loads this webpage;
Step 3, after the designated time, stop loading, retain the web page contents that loaded, by detecting the web page contents detection elements comparison corresponding with the network address of this webpage, judge whether this webpage is opened successfully;
Step 4, repeating step 2 and step 3 set point number;
The daily record of step 5, the each operation of record, opens successful sum by webpage and is scaled number percent, and shows.
2. gateway product method for testing pressure according to claim 1, is characterized in that: the detection elements of only preserving a network address and this network address in described network address file.
3. gateway product method for testing pressure according to claim 1, is characterized in that: the detection elements of at least preserving two network address and corresponding network address in described network address file.
4. gateway product method for testing pressure according to claim 3, is characterized in that: in described step 2, be a network address obtaining at random network address file, and Web page loading.
5. according to arbitrary described gateway product method for testing pressure in claim 1 to 4, it is characterized in that: described step 4 set point number is 200 times.
6. a device for gateway product pressure test, comprises test terminal, and described test terminal, by tested gateway product connecting Internet, is characterized in that: comprise in described test terminal:
Browser, stores the network address file of list of websites and corresponding detection elements, reads the network address in described network address file and this network address is loaded into the webpage load-on module of described browser, and timing module, exits Web page module, preserves module, judge module;
Described timing module is opened timing when webpage and is started network address being loaded into browser, triggers to exit Web page module and stop loading described webpage when timing finishes; Described preservation module is preserved the web page contents having loaded; Judge module detects in web page contents whether have the detection elements in described network address file, if had, judge that webpage loads normal, otherwise it is undesired to judge that webpage loads.
7. the device of gateway product pressure test according to claim 6, is characterized in that: also comprise counting module, described judge module is judged to webpage loads normal or undesired counting, and calculate webpage and open successful number percent.
8. the device of gateway product pressure test according to claim 6, is characterized in that: described browser is: IE browser or red fox browser.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410414282.XA CN104156461B (en) | 2014-08-20 | 2014-08-20 | A kind of gateway product method for testing pressure and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410414282.XA CN104156461B (en) | 2014-08-20 | 2014-08-20 | A kind of gateway product method for testing pressure and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104156461A true CN104156461A (en) | 2014-11-19 |
CN104156461B CN104156461B (en) | 2017-12-19 |
Family
ID=51881959
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410414282.XA Expired - Fee Related CN104156461B (en) | 2014-08-20 | 2014-08-20 | A kind of gateway product method for testing pressure and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104156461B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103916291A (en) * | 2014-04-14 | 2014-07-09 | 中国联合网络通信集团有限公司 | Testing method and device for internet log retaining system |
CN108738059A (en) * | 2017-04-14 | 2018-11-02 | 美的智慧家居科技有限公司 | WIFI module test method and device |
CN111783002A (en) * | 2020-06-30 | 2020-10-16 | 北京达佳互联信息技术有限公司 | Webpage data loading method and device, electronic equipment and storage medium |
CN114257529A (en) * | 2021-12-24 | 2022-03-29 | 深圳市欣博跃电子有限公司 | Network equipment stability testing method, device, equipment, system and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20000033277A (en) * | 1998-11-21 | 2000-06-15 | 이계철 | Apparatus for testing web based protocol remotely and method thereof |
CN101572608A (en) * | 2009-06-17 | 2009-11-04 | 杭州华三通信技术有限公司 | Method and device for acquiring once-login parameters |
CN102413489A (en) * | 2011-12-12 | 2012-04-11 | 广东欧珀移动通信有限公司 | Automatic test method for WiFi (Wireless Fidelity) network connection of mobile phone |
CN202218407U (en) * | 2011-02-24 | 2012-05-09 | 工业和信息化部电信传输研究所 | Terminal browser service testing system |
CN103514090A (en) * | 2012-06-26 | 2014-01-15 | 腾讯科技(深圳)有限公司 | Method and device for testing browser |
-
2014
- 2014-08-20 CN CN201410414282.XA patent/CN104156461B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20000033277A (en) * | 1998-11-21 | 2000-06-15 | 이계철 | Apparatus for testing web based protocol remotely and method thereof |
CN101572608A (en) * | 2009-06-17 | 2009-11-04 | 杭州华三通信技术有限公司 | Method and device for acquiring once-login parameters |
CN202218407U (en) * | 2011-02-24 | 2012-05-09 | 工业和信息化部电信传输研究所 | Terminal browser service testing system |
CN102413489A (en) * | 2011-12-12 | 2012-04-11 | 广东欧珀移动通信有限公司 | Automatic test method for WiFi (Wireless Fidelity) network connection of mobile phone |
CN103514090A (en) * | 2012-06-26 | 2014-01-15 | 腾讯科技(深圳)有限公司 | Method and device for testing browser |
Non-Patent Citations (2)
Title |
---|
RICKYQIU-邱鹏: "关于浏览器端的网页性能测试", 《HTTP://BLOG.CSDN.NET/SUPERQA/ARTICLE/DETAILS/6402239》 * |
暖色调1215: "利用Selenium自动化web测试", 《HTTP://WENKU.BAIDU.COM/VIEW/1621C9EC81C758F5F61F67FE.HTML?FROM=SEARCH》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103916291A (en) * | 2014-04-14 | 2014-07-09 | 中国联合网络通信集团有限公司 | Testing method and device for internet log retaining system |
CN108738059A (en) * | 2017-04-14 | 2018-11-02 | 美的智慧家居科技有限公司 | WIFI module test method and device |
CN108738059B (en) * | 2017-04-14 | 2022-02-18 | 美的智慧家居科技有限公司 | WIFI module testing method and device |
CN111783002A (en) * | 2020-06-30 | 2020-10-16 | 北京达佳互联信息技术有限公司 | Webpage data loading method and device, electronic equipment and storage medium |
CN114257529A (en) * | 2021-12-24 | 2022-03-29 | 深圳市欣博跃电子有限公司 | Network equipment stability testing method, device, equipment, system and medium |
Also Published As
Publication number | Publication date |
---|---|
CN104156461B (en) | 2017-12-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9842093B2 (en) | Method and apparatus for intelligent capture of document object model events | |
US7770068B2 (en) | Systems and methods for website monitoring and load testing via simulation | |
CN105045887B (en) | The system and method for mixed mode cross-domain data interaction | |
CN104156461A (en) | Method and device for testing pressure of gateway products | |
CN109446075B (en) | Interface testing method and device | |
US20210303368A1 (en) | Operator management apparatus, operator management method, and operator management computer program | |
CN102591874A (en) | Prompt method, terminal and server | |
CN105100263A (en) | Reverse proxy method and apparatus | |
CN102662837A (en) | Testing method and system of browser | |
CN112199300A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN114064208A (en) | Method and device for detecting application service state, electronic equipment and storage medium | |
US11797271B2 (en) | Dynamic web-based integrated development environment | |
CN108200132A (en) | Resource acquiring method, device, equipment and computer readable storage medium | |
CN113297086A (en) | Test case generation method and device, electronic equipment and storage medium | |
CN102662838B (en) | The adjustment method of Flash and system in a kind of browser | |
CN111431767A (en) | Multi-browser resource synchronization method and device, computer equipment and storage medium | |
CN109862074B (en) | Data acquisition method and device, readable medium and electronic equipment | |
WO2008113917A3 (en) | Method for simulating the operation of a device with predetermined architecture and processor using another device connected to a computer network | |
CN201726425U (en) | Embedded network server | |
CN107305528B (en) | Application testing method and device | |
US10095791B2 (en) | Information search method and apparatus | |
CN116346660A (en) | Data processing method, device, equipment and medium based on dependent replacement service | |
CN110633432A (en) | Method, device, terminal equipment and medium for acquiring data | |
EP3660678A1 (en) | Canary release for static content | |
US11829434B2 (en) | Method, apparatus and computer program for collecting URL in web page |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171219 |
|
CF01 | Termination of patent right due to non-payment of annual fee |