| || |
Simple Code for getting page response time?
I'm new to Test Complete. I'm starting off easy - can someone show me sample code I can use to accomplish the task below?
I want to be able to go to a web page (any site will do) and then measure the time it takes to completely load the page.
Can someone provide som sample code or point me in the right direction?
Re: Simple Code for getting page response time?
You can do this using the GetTickCount API function which returns the number of milliseconds passed since the system was started. Here is an example demonstrating how you can navigate to a web page and measure the time needed to load it:
<font class="small">Code:</font><hr /><pre>//JScript
var page = Sys.Process("IEXPLORE").Window("IEFrame").Window(" Shell DocObject View").Window("Internet Explorer_Server").Page("*");
var time = GetTickCount();
time = GetTickCount() - time;
Log.Message("The page was loaded in " + time + " ms.");