The solution I'm testing saves the login so when I open a new browser the login is already done and my tests fail. browser.Dispose() doesn't work in this case. It would be better to test in incognito mode and I noticed that changing the driver's configuration is the easiest way to do it but I'm not sure how I can change it since I'm also using coypu.
This is how I create a new browser, I'm not sure how I can change this to include the running in incognito mode.
public static BrowserSession BrowserBackEnd;
public static BrowserSession Instance
{
get
{
if (BrowserBackEnd == null)
{
CreateNewBrowserSession();
}
return BrowserBackEnd;
}
private set { }
}
private static void CreateNewBrowserSession()
{
var sessionConfigurationChrome = new SessionConfiguration
{
Browser = Coypu.Drivers.Browser.Chrome,
AppHost = "sitehere.com",
Timeout = TimeSpan.FromSeconds(20),
RetryInterval = TimeSpan.FromSeconds(0.1)
};
BrowserBackEnd = new BrowserSession(sessionConfigurationChrome);
}