Current time: 09-20-2019, 03:53 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Browser closing before the page is loaded completely
03-21-2014, 04:15 AM
Post: #1
Browser closing before the page is loaded completely
I need to get the performance results for various internal webpages from fast loading page to very slow loading pages. It works fine for the pages which load faster. But for the slow loading pages, the agent machine is closing the browser before the page is actually loaded and it shows the result for partially loaded page.

For example: one of my webpage I’m testing renders the outer page layout very fast and then it does some JavaScript processing. This JS processing sometimes takes more than 15 seconds (depending on the page) before everything in the page is rendered. In this case when the page is showing loading spinner, the agent just closes the browser and result page shows the result for partially loaded page. It could be due to the fact that there is no network activity when the JS is being processed and the agent thinks this page is fully loaded.

So my questions are:
1. Why would the agent close the browser even before the page is completely loaded?
2. Is there any settings I can change to prevent from this happening?

I have already tried increasing the “Time Limit” on wptdriver.ini to 1200 from 120 and “Timeout” in urlBlast.ini to “3000” from 300. But this didn’t help.

(I have attached the screenshot of the page with loading spinner.)

Thanks in advance.


Attached File(s) Image(s)
   
Find all posts by this user
Quote this message in a reply
03-28-2014, 12:31 AM
Post: #2
RE: Browser closing before the page is loaded completely
WebPagetest is mostly driven by network activity (and the onload event). It doesn't know anything about your javascript running.

There is a "setDomElement" script command that you can use to tell it to wait for a specific DOM element to show up (though not sure how well that works these days - been a while since I tested it).

You can also use the "Minimum Test Duration" (time) in the advanced settings to force it to wait for say 60 seconds to see if that gives you the data you need.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-24-2014, 07:16 AM
Post: #3
RE: Browser closing before the page is loaded completely
I am looking for creative ways to tell WPT that my page is done loading without a wholesale extension of the timeout value with setActivityTimeout.

First I tried using setDOMElement looking for a class, but the DOM has a list of classes and I only know of one for sure (tested it with the one I know about but it didn't seem to work).

Next I was hoping to combine setDOMElement with exec like this (spaces and indention added for readability):

Code:
setDOMElement id=wptDoneLoading
exec            var wptInterval = setInterval(function () {
                       console.log('setInterval');
                       var domElements = document.getElementsByClassName('x4-grid-tree-node-leaf');
                       console.log('domElements: '+domElements+ ', length: '+domElements.length);
                       if (domElements && domElements.length > 0) {
                           console.log('in the if');
                           var el = document.createElement("div");
                           el.id = 'wptDoneLoading';
                           document.body.appendChild(el);
                           clearInterval(wptInterval);
                       }
                   }, 250);

That didn't work, so I tried changing the ID of an existing DIV in the same manner but that also didnt work. My last attempt is only valid for IE (according to the docs) but it is also not working because window.webpagetest doesnt seem to exist:

Code:
waitForJSDone
exec            var wptInterval = setInterval(function () {
                       console.log('setInterval');
                       var domElements = document.getElementsByClassName('x4-grid-tree-node-leaf');
                       console.log('domElements: '+domElements+ ', length: '+domElements.length);
                       if (domElements && domElements.length > 0) {
                           if( window.webpagetest ) {
                               console.log('calling window.webpagetest.done');
                               window.webpagetest.done();
                           } else {
                               console.log('no webpagetest object to call done on!');
                           }
                           clearInterval(wptInterval);
                       }
                   }, 250);

I am using AMIs ami-04320e41 and ami-92320ed7. Any assistance would be appreciated, thanks!

Doc Reference:
https://sites.google.com/a/webpagetest.o...DOMElement
https://sites.google.com/a/webpagetest.o...tForJSDone
https://sites.google.com/a/webpagetest.o...g#TOC-exec
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)