public static void takeScreenshoot(IWebDriver driver) { string screenshotPath = ApplicationSetUp.getCurrentApplicatonPath() + "Screenshots/"; ITakesScreenshot screenshotDriver = driver as ITakesScreenshot; Screenshot screenshot = screenshotDriver.GetScreenshot(); string fp = screenshotPath + DateTime.Now.ToString("dd_MM_yyyy_hh_mm_ss") + ".png"; screenshot.SaveAsFile(fp, ScreenshotImageFormat.Png); }
public static List <string> GetChromeOption() { List <string> arguments = new List <string>(); string profileFile = ApplicationSetUp.getCurrentApplicatonPath() + "profile/chromeprofile.txt"; var lines = File.ReadAllLines(profileFile); for (var i = 0; i < lines.Length; i++) { if (!lines.ToString().StartsWith("#")) { arguments.Add(lines[i]); } } return(arguments); }
public static Dictionary <string, string> getFireFoxProfile() { List <string> arguments = new List <string>(); string profileFile = ApplicationSetUp.getCurrentApplicatonPath() + "profile/firefoxprofile.txt"; Dictionary <string, string> dictProfile = new Dictionary <string, string>(); var lines = File.ReadAllLines(profileFile); for (var i = 0; i < lines.Length; i++) { if (!Regex.IsMatch(lines[i], "^(#)")) { string key = lines[i].Substring(0, lines[i].IndexOf("=")); string value = lines[i].Substring(lines[i].IndexOf("=") + 1); dictProfile.Add(key, value); } } return(dictProfile); }