使用QTP進行WEB頁面效能測試
QTP是功能測試工具,但是也可以用於WEB頁面的效能測試,下面指令碼利用了IE的COM介面和DOM獲取ReadyState的方式來測試WEB頁面載入的效能:
SiteURL = "http://blog.csdn.net/testing_is_believing" 'Set the URL to visit
result = timeCount (SITEURL) 'returns running results
MsgBox result 'output to run As a result, the line can be commented out loadrunner
Public Function timeCount (url)
Set dom = CreateObject ( "InternetExplorer.Application") 'Create an IE object
dom.Navigate (url) 'open the specified URL
time_start = Now () 'to obtain statistics at the beginning of time
timer_start = timer () 'Get the current time in milliseconds
'a = dom.ReadyState' Get the current state of the value of IE will be used to determine the value of the state of the current state of the IE
dom.visible = True 'Set IE can be seen
While dom.busy or (dom.readyState <> 4) 'When the IE is in BUSY status or load does not complete (readystate is not equal to 4), depending on the state of IE statistical time, once every millisecond Statistics
'WScript.Sleep 1 'time interval 1 ms, if the relatively long time interval, then is likely to take less than a state value
Wait 0, 1
Select Case dom.readystate 'to determine the value of dom.readystate
Case 0 'IE is not initialized, in fact, the method, readystate = 0 meaningless, because the cycle is at least a start.
time0 = Now ()
timer0 = timer ()
Case 1 ' "is sending request"
time1 = Now ()
timer1 = timer ()
Case 2 ' "request has been sent to complete"
time2 = Now ()
timer2 = timer ()
Case 3 ' "can receive the part of the response data,"
time3 = Now ()
timer3 = timer ()
Case 4 ' "Page is loaded"
time4 = Now ()
timer4 = timer ()
End select
wend
time_end = Now () 'Statistical End Time
'MsgBox "Start time is:" & time1 & "; the end of time is" & time2
timeCount = "Statistics Start Time:" & start_time & vbcrlf & "time0:" & time0 & vbcrlf & "time1:" & time1 & vbcrlf & "time2: "_
& time2 & vbcrlf &" time3: "& time3 & vbcrlf &" time4: "& time4 & vbcrlf &" to complete the initialization of IE and send request: "_
& (timer1-timer_start) &" seconds "& vbcrlf &" to send the completion and acceptance of server-side part of the response data: "_
& (timer3-timer1) &" seconds "& vbcrlf &" 100% to receive and complete the HTML content parsing: "_
& (timer4-timer3) &" seconds "& vbcrlf &" Total spent: "& (timer4-timer_start) &" seconds "
End Function
參考:
http://www.qtp10.com/2009/12/web-application-performance-testing.html
相關文章
- web頁面測試Web
- 使用Loadrunner進行效能測試
- 使用 Sysbench 進行 Linux 效能測試Linux
- 使用python對oracle進行簡單效能測試PythonOracle
- 自動化測試工具QTPQT
- YLazy Web Page Test , 網頁效能測試平臺Web網頁
- 【TEST】Oracle19c使用benchmarksql進行效能測試OracleSQL
- 使用 jMeter 對 SAP Spartacus 進行併發效能測試JMeter
- 效能測試進階實踐篇:10分鐘教你使用JMeter進行websocket測試!JMeterWeb
- 哪些功能需要進行效能測試?
- 如何使用Web3.js API 在頁面中進行轉賬WebJSAPI
- 效能測試面試題面試題
- 如何用手機測試自己寫的web頁面Web
- 搭建自動化 Web 頁面效能檢測系統 —— 部署篇Web
- 面經-效能測試
- 使用PostMan進行API測試PostmanAPI
- 使用 HTTPie 進行 API 測試HTTPAPI
- 【面試】Web 頁面請求歷程面試Web
- 什麼情況下進行效能測試
- 使用 OSProfiler 對 OpenStack 進行效能測量
- 前端面試7:頁面效能前端面試
- 面試題——Mybatis是如何進行分頁的面試題MyBatis
- HTML5 Web儲存 頁面間進行傳值HTMLWeb
- flutter 使用Bloc和refresh 進行搭建頁面FlutterBloC
- 使用 React.js 的漸進式 Web 應用程式:第 2 部分 – 頁面載入效能ReactJSWeb
- web自動化測試(2):選擇selenium優勢?與PhantomJS/QTP/Monkey對比WebJSQT
- web伺服器效能測試Web伺服器
- 移動app效能測試有哪些需要進行?效能測試報告如何收費?APP測試報告
- Web效能測試種類與全面測試模型Web模型
- 登陸頁面測試
- 使用JUnit進行單元測試
- 使用jest進行單元測試
- 使用 MeterSphere 進行 Dubbo 介面測試
- 使用JMeter進行壓力測試JMeter
- 使用Wiremock進行整合測試 - kubilayREMMock
- 用PerformanceTiming來檢測頁面效能ORM
- 使用Web元件載入頁面Web元件
- 提升現代web app中的頁面效能WebAPP
- ui自動化測試,頁面方法的使用UI