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

Automate Browser Refresh Using Simulate User/Typing?

4 Answers 200 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 06 Mar 2012, 04:39 PM
I'd like to insert a step into my tests to refresh the browser before navigating to the target web page.  I thought I could easily do this by using the Simulate User or Simulate Typing functions, but I'm having difficulty doing so.  Anyone have any direction for me?

4 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 06 Mar 2012, 06:33 PM
Hello Richard,

There are two ways to do a browser refresh and not rely on keystrokes:

1. During recording, if you click on the Refresh button, Test Studio will record a Browser Refresh test step. 

2. If you prefer to implement a coded step, this line will do the same thing:

ActiveBrowser.Refresh();

 
Greetings, Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Richard
Top achievements
Rank 1
answered on 09 Mar 2012, 05:16 PM
Anthony, 

Thanks for the info.  I'm going to reward you with another question ;-)... how about refreshing the browser cache (where I would typically use Ctrl + F5)? 
0
Accepted
Anthony
Telerik team
answered on 09 Mar 2012, 06:05 PM
Hello Richard,

See below for the three cache types you can clear. You can also Clear Cookies in a non-coded step.

ActiveBrowser.ClearCache(ArtOfTest.WebAii.Core.BrowserCacheType.Cookies);
ActiveBrowser.ClearCache(ArtOfTest.WebAii.Core.BrowserCacheType.History);
ActiveBrowser.ClearCache(ArtOfTest.WebAii.Core.BrowserCacheType.TempFilesCache);


Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Richard
Top achievements
Rank 1
answered on 15 Mar 2012, 04:25 PM
Thanks, Anthony!  The Browser Refresh and Clear Cache steps in code work great!   
Tags
General Discussions
Asked by
Richard
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Richard
Top achievements
Rank 1
Share this question
or