コード例 #1
0
 /// <summary>
 /// Starts the session by navigating to the given <param name="url"/>.
 /// </summary>
 /// <param name="url">Url of the page to navigate to</param>
 public void Start(string url)
 {
     if (!string.IsNullOrEmpty(url))
     {
         Driver.Navigate().GoToUrl(url);
         Logs.WriteInfoLogEntry(GetType().ToString(), "Started new driver session with url: {0}", url);
     }
     else
     {
         Logs.WriteErrorLogEntry(GetType().ToString(), "Attempt to start the driver session failed. The url cannot be null or empty string. Please specify a valid url.");
         throw new ArgumentException("The url cannot be null or empty string. Please specify a valid url.", nameof(url));
     }
 }
コード例 #2
0
 /// <summary>
 /// Deletes all cookies from the current session.
 /// </summary>
 public void DeleteAllCookies()
 {
     Driver.Manage().Cookies.DeleteAllCookies();
     Logs.WriteInfoLogEntry(GetType().ToString(), "Deleted all cookies from the current driver session.");
 }