This is a migrated thread and some comments may be shown as answers.

Is there any way to enable "Always Refresh from Server" option in Internet Explorer developer tools?

3 Answers 682 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 02 Mar 2014, 08:44 PM
I am having severe problems with IE caching my tests. I can confirm with fiddler that if I run a certain test and return to the same url it does not hit the server but instead returns data from cache in all versions of IE that I have tested (IE 9, 10, 11). These same tests work as expected in firefox and chrome. This is not a problem with the Telerik Testing Framework but a problem with Internet Explorer. I have found two solutions to this problem:
  1. Enable "Always Refresh from Server" in the IE developer tools menu. This works well and is most likely how I would like to solve this issue but the problem is that this setting does not stick and I have to manually enable it every time a new instance of IE is loaded.
  2. Write random query string values onto the end of all urls to ensure that the url is unique and therefore will not pull from cache. This works well but I consider it to be a hack and therefore I am looking for a more graceful solution if it exists.

So is there any way that I can use the Telerik Testing Framework to enable the "Always Refresh from Server" option in IE? Or maybe there is a way to always enable this option or make it persist across all IE sessions? Any help would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 03 Mar 2014, 11:30 PM
Hi James,

What is wrong with letting the browser do its normal cache operations? How does this break your automated tests? Browsers normally behave this way and no other customer of ours has run into a problem with browser caching.

There is a way to force clear the cache in code:
ActiveBrowser.ClearCache(BrowserCacheType.TempFilesCache);


Regards,
Cody
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
James
Top achievements
Rank 1
answered on 05 Mar 2014, 06:13 PM
Hi Cody,

I did some more digging and found that my problem is related to redirects being cached in Internet Explorer: http://blog.maskalik.com/asp-net/ie9-redirect-caching-nightmare/ . I can confirm this behavior in IE 9, 10 and 11. The simple solution is to change your redirects from permanent to temporary or to tell IE not to cache the redirect with special headers in your code. This is fine but I do not consider this a solution because there are instances where one would want to grab data from another website that they do not control. This is common in the case where particular websites do not support RSS feeds and programmers must aggregate data using other methods.

Again, to be clear, this is a problem with IE and has nothing to do with Telerik. I am only seeking a nicer method to resolve this situation, should it arise again. If it is not possible to always enable the "Always Refresh from Server" option in IE then I suppose I will have to be more careful with how I choose to test websites in the future using the Internet Explorer browser as this has caused me hours and hours of hair-pulling frustration for something that works as desired in other browsers.
0
Cody
Telerik team
answered on 07 Mar 2014, 08:26 PM
Hi James,

There is no way to persist (or programmatically set) the IE Developer tools option: "Always Refresh from Server." Turning that option attempts to force IE to avoid the cache for all requests that it makes, and that would have unusual side-effects and not reflect how any user experiences the site.

Are you possibly changing your web site while the test is running, while the recorder is attached, or even between test runs? It is standard procedure that anytime you make a change to your website that you manually clear the browser’s cache before hitting the changed pages. Clearing the browser cache after any modification to the site is a practice that web developers normally follow, as doing so ensures that only the latest version of the site is tested, and it is tested as end-users will actually experience the site.

Regards,
Cody
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Answers by
Cody
Telerik team
James
Top achievements
Rank 1
Share this question
or