Working with application cache - Selenium

Application cache is one of the new technologies that is coming from the HTML 5 specification. It allows web applications to specify files that are downloaded when the browser accesses the page. The browser will look at the files in the application cache before opening any network connections to the server. This means if the computer or mobile device goes offline, then those files are still available and loaded straight away.

To know if your application has an application cache file, you will need to have a look at the source of the HTML document. It should have a manifest attribute in the html tag as follows:

<html manifest="example.appcache">
</html>

When items are downloaded, we can then make calls to the application cache object that is attached to the window object in the browser.

Selenium WebDriver has an AppCacheStatusenum that represents the current status of the application cache. The current statuses are:

  • 0: UNCACHED

  • 1: IDLE

  • 2: CHECKING

  • 3: DOWNLOADING

  • 4: UPDATEREADY

  • 5: OBSOLETE

Let's try using this.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics