Пример #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);
        }
Пример #2
0
        private void SelectFirstUnLockCertificateInList()
        {
            Thread.Sleep(3000);
            var listOfTableRow = SearchResultDiv.FindElements(By.CssSelector("tr[id]"));

            foreach (var tableRow in listOfTableRow)
            {
                //System.Threading.Thread.Sleep(4000);
                var td     = tableRow.FindElement(By.CssSelector("td[data-label='Details:'"));
                var img    = td.FindElement(By.TagName("img"));
                var imgSrc = img.GetAttribute("src");

                if (imgSrc.Contains("/images/in_progress_32.png"))
                {
                    var div                = td.FindElement(By.TagName("div"));
                    var anchor             = div.FindElement(By.TagName("a"));
                    IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
                    js.ExecuteScript("arguments[0].click()", anchor);
                    break;
                }
            }
        }