Ask a Question

Browser Loop - incognito mode

0 Kudos

Browser Loop - incognito mode

I can create a browser loop in a Keyword test.

Some Webinars suggest running tests in private or incognito mode as you would more accurately simulate the first use and discard any cache issues


I would be handly to add this feature to the Loop condition

Currently, the only way on doing this is by using TestApps or call a CLI script - either way, it is harder testing these within a loop

1 Comment
Community Hero



my tests all now start a 2-step open process


1, testedApp calling batch file for flush cache
         file code:
                    ipconfig /flushdns


2, function script with incognito mode
         - make sure testcomplete extension is enabled for incognito mode !!



 navigate browser as normal

ALL tests now run incognito and a free of any cache issues
- this can be hooked up to any start event or login process as the tests require


Here is my code for step 2 in case it helps anyone (Javascript)




function open_secret_browser(browserName = "chrome"){

switch (browserName) {
case "edge":
browserName = "edge";
browserType = btEdge;
case "firefox":
browserName = "firefox";
browserType = btFirefox;
case "chrome":
browserName = "chrome";
browserType = btChrome;

browserName = aqString.ToLower(browserName);


if (Sys.WaitBrowser(browserName).Exists){
var browser = Sys.Browser(browserName);
Log.Enabled = false // To disable the warning that might occur during closing of the browser
Log.Enabled = true // enabling the logs back

switch (browserName) {
case "edge":
Browsers.Item(btEdge).RunOptions = "-inprivate";
case "firefox":
Browsers.Item(btFirefox).RunOptions = "-private-window";
case "chrome":
Browsers.Item(btChrome).RunOptions = "-incognito";




Welcome to the TestComplete Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Welcome to the Community
Sign Up Here