Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How to clear Browser cache on an Android device?

How to clear Browser cache on an Android device?

If you attempt to select the ClearCache() method when recording against a browser application running on a mobile Android device; the following error will be reported, as ClearCache() is currently not supported for mobile browsers:

This may present a problem if a web application under test caches user data, which must be removed before further tests will playback successfully.

Currently the only option to remove the cached data is to automate the actions required to manually clear the browser cache; it is recommended that these steps are encapsulated in a function that can be called either before or after of test, to prepare the browser for further testing.

SilkTest Workbench:

In the Workbench we recommend keeping the function in a separate script; where it can be called from any script that contains a reference to the script where it resides:

Silk4J:

In this client we recommend that the ClearBrowserCache() is called from within the method declared with the @After JUnit annotation; as such methods are guaranteed to run even if the @Before or @Test method were to throw an exception:

ClearBrowserCacheSilk4J.txt

Silk4Net:

In Silk4Net the recommended approach is to call the ClearCache() method from within a function defined with the <TestCleanup>; as it guarantees that cache cleanup take place whether an exception is thrown or not.

ClearCacheSilk4Net.txt

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2016-11-16 16:19
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.