示例#1
0
        public string DownloadProcessLog(string downloadPath)
        {
            LogHelpers.Write(string.Format("Click \"Download log\" button."));
            DownloadLog.ClickJS();
            Waits.WaitDownloadDocument();
            //check if there is some window or something
            var directory = new DirectoryInfo(downloadPath);
            var myFile    = directory.GetFiles().Where(f => !f.Attributes.HasFlag(FileAttributes.Hidden)).OrderByDescending(f => f.LastWriteTime).First();

            return(myFile.FullName);
        }
        public string DownloadReport()
        {
            WaitForReportGeneration();
            LogHelpers.Write(string.Format("Click \"Download Report\" button."));
            DownloadReportButton.ClickJS();
            Waits.WaitDownloadDocument();
            LogHelpers.Write(string.Format("Click \"Close Queue\" button."));
            Waits.WaitUntilElementPresent(drv => CloseQueueButton).ClickAndWaitForAjax();
            var directory = new DirectoryInfo(Settings.DownloadPath);
            var myFile    = directory.GetFiles().Where(f => !f.Attributes.HasFlag(FileAttributes.Hidden)).OrderByDescending(f => f.LastWriteTime).First();

            return(myFile.FullName);
        }