private string GotoValidDomainAndClearCookies()
{
Regex hostNameRegex = new Regex("\\w+\\.\\w+.*");
string name = null;
string hostName = EnvironmentManager.Instance.UrlBuilder.HostName;
if (hostNameRegex.IsMatch(hostName))
{
name = hostName;
driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("simpleTest.html");
}
hostName = EnvironmentManager.Instance.UrlBuilder.AlternateHostName;
if (name != null && hostNameRegex.IsMatch(hostName))
{
name = hostName;
driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereElseIs("simpleTest.html");
}
driver.Manage().DeleteAllCookies();
return name;
}