Automate Browser Refresh Using Simulate User/Typing?

5 posts, 1 answers
  1. Richard
    Richard avatar
    13 posts
    Member since:
    Feb 2012

    Posted 06 Mar 2012 Link to this post

    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?
  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 06 Mar 2012 Link to this post

    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
  3. Richard
    Richard avatar
    13 posts
    Member since:
    Feb 2012

    Posted 09 Mar 2012 Link to this post

    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)? 
  4. Answer
    Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 09 Mar 2012 Link to this post

    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
  5. Richard
    Richard avatar
    13 posts
    Member since:
    Feb 2012

    Posted 15 Mar 2012 Link to this post

    Thanks, Anthony!  The Browser Refresh and Clear Cache steps in code work great!   
Back to Top