Page load time

Ask general questions here.
skhanpara
Posts: 94
Joined: Wed Apr 23, 2014 3:55 pm

Page load time

Post by skhanpara » Fri Aug 21, 2015 2:19 pm

Hello,

We are doing some performance testing using Neoload. During that test we are planning to run a Ranorex script which will help use determine PageLoadTime. Is it possible to do so?

If Yes, can you suggest a proper way.

Thank you
Skhanpara

skhanpara
Posts: 94
Joined: Wed Apr 23, 2014 3:55 pm

Re: Page load time

Post by skhanpara » Fri Aug 21, 2015 2:43 pm

I got the following code online and it works.
If you think there is a better way. Do let me know

Thank you

***************************************************************************************************************


WebClient client = new WebClient ();

// Add a user agent header in case the
// requested URI contains a query.

client.Headers.Add ("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");

Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();

Stream data = client.OpenRead (@"your-url-here");
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd();

stopwatch.Stop();
Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);

data.Close();
reader.Close();