1xcalibur1 Posted June 28, 2012 Share Posted June 28, 2012 (edited) Hey, I have an Ajax webpage that I'd like to measure it's loading time. The thing is, if the webpage's title remains the same the entire process, how do I know when to stop the timer? I.E right now this page's title is "Posting New Topic - AutoIt Forums" and suppose I click on a link here that will use the same title. To put it in other words, how can I tell the webpage has indeed changed? Thanks! Edited June 28, 2012 by 1xcalibur1 Link to comment Share on other sites More sharing options...
JohnOne Posted June 28, 2012 Share Posted June 28, 2012 There are probably a number of ways. Thing is, it will be quite difficult for anyone to suggest them without some further details, not least of which might be In what browser? amongst others. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
1xcalibur1 Posted June 28, 2012 Author Share Posted June 28, 2012 There are probably a number of ways.Thing is, it will be quite difficult for anyone to suggest themwithout some further details, not least of which might beIn what browser? amongst others.Please, whatever's needed let me know as I must get this right!I have all browsers but I'm using FireFox for this test.What else? Link to comment Share on other sites More sharing options...
JohnOne Posted June 28, 2012 Share Posted June 28, 2012 Well Internet Explorer is pretty much covered by Dale's IE UDF which has a whole array of functions. For Example, if you start a timer and then use _IENavigate("URL"), and print the timer difference you have the time that url took to load, _IECreate() _IEAttach() _IENavigate() TimerInit() TimerDiff() are the functions you want to be looking at in the help file. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
1xcalibur1 Posted June 28, 2012 Author Share Posted June 28, 2012 Well Internet Explorer is pretty much covered by Dale's IE UDF which hasa whole array of functions.For Example, if you start a timer and then use _IENavigate("URL"), and print the timer differenceyou have the time that url took to load,_IECreate()_IEAttach()_IENavigate()TimerInit()TimerDiff()are the functions you want to be looking at in the help file.OK.But what if I dont have a URL? This is AJAX afterall...Is it possible to measure loading times between mouse clicks? Link to comment Share on other sites More sharing options...
JohnOne Posted June 28, 2012 Share Posted June 28, 2012 I don't know sorry, I thought ajax was a bleach like cleaning powder used in the kitchen. I only thought you were using a webpage which normally exist at some sort of url. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
1xcalibur1 Posted June 28, 2012 Author Share Posted June 28, 2012 AJAX - an acronym for Asynchronous Javascript and XMLAnyway,suppose I find the proper URL.Would starting the timer before the NAVIGATE command and stopping it right after do the trick for me?Thanks again! Link to comment Share on other sites More sharing options...
JohnOne Posted June 28, 2012 Share Posted June 28, 2012 Yes, _IENavigate() has a _LoadWait() function in it, so the page is loaded before the function returns. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
John Posted June 28, 2012 Share Posted June 28, 2012 Offhand it appears to me what you are wanting for ajax is the time between onreadystatechange, after readyState =="complete", and when when readyState =="complete". In AutoIt you can do this using an IE com object, but more generally you need a browser plugin, or userjs. A much better option than AutoIt in this particular case. Even using AutoIt outside of IE some js is likely needed to expose the information you need. Much more work than I want to embark on to answer a forum question. Your best option for Firefox is to try out the Firebug extension, which is well suited for debugging all sorts of ajax and other webpage related issues. If Firebug doesn't fit your needs and you are intent on using AutoIt you can download ngrep, which has a lot of GNU grep's common features built in, from sourceforge and redirect its output to your script. This will work regardless of which browser and/or application is connected to your website. If ngrep > AutoIt doesn't fit the bill nothing will. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now