コード例 #1
0
        private bool DownloadFirstCertificateInList(TestContext context)
        {
            bool isDownloaded = false;

            DeleteDownloadFolder(context);
            Thread.Sleep(2000);
            var listOfTableRow = SearchResultDiv.FindElements(By.CssSelector("tr[id]"));

            foreach (var tableRow in listOfTableRow)
            {
                var td           = tableRow.FindElement(By.CssSelector("td[data-label='Actions:'"));
                var pdfAnchor    = td.FindElement(By.CssSelector("a[class='create-pdf-item']"));
                var downloadLink = pdfAnchor.GetAttribute("href");
                driver.Navigate().GoToUrl(downloadLink);
                isDownloaded = DownloadHelper.CheckDownLoadComplete(context);
                break;
            }
            return(isDownloaded);
        }