0

So I am trying to use a selenium web driver extension on chrome to record a web application test on a chrome browser that is in an incognito mode. How do you run a test on a web application in an incognito mode of google chrome browser?

0

you can't record the browser actions with selenium webdriver. This is possible only with Selenium IDE.

So to answer to you question:

You can't make Selenium IDE to open chrome in incognito mode. If you want to achieve a similar functionality in non incognito mode in chrome using Selenoium IDE you can execute javascript to clear the local storage and cookies.

0

While working in a software testing services company, I have experienced such requirement i.e. verifying certain scenarios in chrome incognito mode using Selenium Webdriver.
Please find below code snippet working at my end -

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class IncognitoTestCase {
public static void main(String[] args){
System.setProperty("webdriver.chrome.driver","D:\your_chrome_directory\chromedriver.exe");
ChromeOptions options = new ChromeOptions(); options.addArguments("start-maximized");
options.addArguments("--incognito");
WebDriver driver = new ChromeDriver(options); driver.get("https://accounts.google.com/signin");
}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.