In this
Blog, we are going to learn how we can execute Selenium Automation Test
in Incognito (Private) Mode for FireFoxDriver.
Before Going
Further, let's Understand what is Incognito (Private) Mode.
Incognito
mode is a setting in our web browser that prevents Internet browsing history, cookies and site data, or information entered
in forms from being stored. Incognito mode deletes this data as soon
as we close the web browser.
There are two main ways to execute our selenium Test in Incognito Mode for FireFox
Driver.
First Method
- Right Click on Firefox Driver and Select Properties.
Now, Our incognito browser is ready for execution. Now
whenever we execute our automation Scripts it will automatically execute in
incognito mode for FireFox Driver.
Second Method
Using FireFox
to addArguments –private in the code.
Please refer
below code snippet for Complete Details.
After executing the Code, Result will be like:
Happy Learning.