Forum Discussion

Novari-QA's avatar
Novari-QA
Frequent Contributor
8 years ago

Detect if a page has been refreshed?

Is there a method or script out there that can detect if a page has been refreshed? On our website one of our pages auto refreshes every 30sec. Id like to detect if that feature still works? 

Thoughts?

  • I'm not sure there is a "standard" way of doing it since there are probably any number of ways of having a web page auto-refresh like that.  I'd see if there was some sort of property or object or something on the page that stores the state or something like "last refreshed" or something like that.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I'm not sure there is a "standard" way of doing it since there are probably any number of ways of having a web page auto-refresh like that.  I'd see if there was some sort of property or object or something on the page that stores the state or something like "last refreshed" or something like that.

  • You may need to work with your dev here to give you some client side indicator. Maybe a 'refreshing' icon or something.

     

    Assuming you're talking about a webpage here (I mostly automate C# apps so this isn't my forte). How the page is 'refreshed' is based on how your dev built the web-app. For example, maybe they're just polling for changes from the server every 30 seconds, while your client side DOM is un-changed. Even if the entire DOM is scrapped and re-built, it may be the exact same as the previous. And depending on the browser, the 'refreshed' page may have kept all its original properties.

     

    Developers build refresh mechanisms with minimalism and efficiency in mind. Its possible that any little trick you can think of will be obsoleted with efficiency improvements in their webapp or browser.

     

    So circling back to what I was suggesting originally - just work with your dev to give you an explicit indicator.