Ask a Question

How to start chrome in incognito from keyword test

eflyerman
Occasional Contributor

How to start chrome in incognito from keyword test

Chrome keeps pre-filling input fields and image upload elements.  I tried to clear cache but fields are still pre-populated.

 

How can I start chrome in incognito mode to avoid pre-filling the fields?

 

Thanks

9 REPLIES 9
tristaanogre
Esteemed Contributor

You don't need incognito mode I don't think.   Check out the following:

Additional Recommended Settings

We also recommend that you configure certain Google Chrome settings as described below. While these settings are not necessarily required for automated testing, using them will prevent unexpected browser behavior and improve Chrome’s performance during test recording and test runs.

  • From Chrome’s main menu, select Settings.

    – or –

    Navigate to the chrome://settings page.

  • On the Basics page:

    • Set On startup to Open the home page.

    • In Home page, select Open this page: and enter about:blank.

    Using a blank home page will prevent capturing of superfluous web pages during test recording and improves the browser startup performance.

  • On the Personal Stuff page:

    • Set the Passwords option to Never save passwords.

    • Uncheck Enable Autofill to fill out web forms in a single click.

    This will prevent unexpected behavior when filling forms during test recording and test runs.

This is part of a larger article.

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/chrome.ht...


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
eflyerman
Occasional Contributor

So you can't open incognito from keyword test?  

 

I have tried your suggestion.  Doesn't work.  Tried it before posting the question here.  The test runs fine in incognito mode.  In fact, incognito mode is the only thing that reliably works consistently.

 

I don't have a dedicated testing machine.  Changing useful functionality for %99.98 of my browsing to accomplish %0.02 percent of my testing needs doesn't sound like a useful solution anyway.

 

Very frustrated with keyword testing at this point.  It has extremely limited functionality.  The recording feature is mostly useless because every step and almost every object has to be edited manually afterwards.  I can start the browser in incognito from a script but if I have to write scripts to use important functionality, I may as well use scripts for everything and use selenium for free.   

Or you could try working with everyone here on the forum to better understand the TestComplete software.  We're happy to help if you keep giving us specific examples.

 

Keyword testing is actually quite useful.  We have huge test suites written that way.

 

Recording can do a lot for you too.  You may find that you have to adjust a few things in order to have a flexible test but it will give you a quick framework.  

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tristaanogre
Esteemed Contributor

Not saying you can't use incognito mode... saying that there is a recommended way of running automation against Chrome that makes incognito mode unnecessary.

 

As for not having a dedicated testing environment... How can you guarantee that, when you execute your tests, some plug-in, background software, system configuration option, etc., isn't interfering with your tests?  My first QA job was not in software but in manufacturing electronic components.  You don't test mil spec 0.02 % tolerance resistors that are going up in the space shuttle in your Honda accord.  You have set environments to make sure that you control all the conditions in which the components are being tested so that, if something does go wrong, you know it's not due to some unknown factor.  Even manually testing software has, as a best practice, some sort of VDI or VM or some sort of lab for executing the tests to make sure that it is functioning well.  Automation needs it even more so.

 

As for starting the browser in incognito in script... if it can be done in script, it can be done in a keyword test.  That's what "Code Snippets" are for. Or, for that matter, simply create the script function to run the browser and call it from the keyword test.  Use the keyword test for everything else, but fire up the browser via script.  Nothing wrong with mixing the two.

 

As for TC versus Selenium... your choice. I've used Selenium... and honestly, I find TC to be a lot more intuitive.  To get the true power of Selenium you need to be a pretty decent developer of Java software... and I'm not that.  I know enough to do what I need to do in TC (learning more every day, though) and the rest of the TC tool kind of helps me along.  If I had my druthers, I'd write most of the stuff in script because that's what I learned on "back in the day", but keyword tests are a good way to get started in the TC tool.

 

As @Marsha_R said, though... if you have specific problems, we're happy to help.  Just fire off the questions and we'll give you a hand.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
vvg
Occasional Contributor

Where is the answer that tells us how to open chrome incognito modus from a keyword test? Or just always when testcomplete is executing its tests?

I am frustrated with chrome not having the ability to throw everything it knows away when you close it.

At this moment I have the feeling it is messing with me with a test, because it doesn't throw away everything. So I want to have a clean browser when starting my test. How do I do this?

Chrome is the only browser that is messed up at the moment. When I execute this test in non-incognito modus it fails, when I test it in incognito modus, it doesn't fail.

So please tell me how to start chrome incognito via testcomplete.

tristaanogre
Esteemed Contributor

As mentioned above to the other user, it might not be icognito mode that is causing the problem but the fact that the browser is auto-filling.  If you turn off auto fill, you can see if that works.

 

Otherwise, your best bet is to use TestedApps to run Chrome and, in the command line switches, add the incognito command line as per

 

http://www.tech-recipes.com/rx/3479/google-chrome-use-a-command-line-switch-to-open-in-incognito-mod...

 

Psst... by the way, I found that command line switch in like 2 seconds with a google query. Just saying... 😉


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
AlexKaras
Community Hero

Hi,

 

> When I execute this test in non-incognito modus it fails

To add to @tristaanogre:

While it is a matter of requirements to your tests and test code and the actual failure context, you may consider to improve your tests so that they do not fail. For example, for the classic unit test it may be required to have an empty input field on test start. And this is quite fine for the unit test. But for the end-to-end test that more or less emulates how the end-user works with your application: if the browser in standard configuration pre-fills input fields with previous data and this creates problems for the end-user (read this as 'breaks your test') then this may be the reason to reconsider how your application is implemented.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
vvg
Occasional Contributor

@AlexKarasThankyou for the addition, I think that is a quite valueble addition which I hadn't thought of yet.

The only problem here for me is, that the function @tristaanogre described indeed seemed to be enabled in chrome, but it didn't prefill any field with any value.

At least as far as I could see it were always just empty textfields and there was no possible value given.

 

That's why I asked how one could start the incognito modus, so that I at least know that I am not messing with an older build of the page or whatever. At this moment I don't care about the prefilling. It should not prefill and all I want to know at first is that the page is working normally when you get there for the first time.

AlexKaras
Community Hero

Hi,

 

Then, as it was mentioned by Robert, the simplest way to start Chrome in Incognito is to add it to Tested Applications and provide necessary start parameters.

Then, for example, you may change your test that it starts Chrome via TestedApps.Run() call, navigate to the required address, get opened page and continue as usual.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: