public void WhenUserClicksOnAnyOfTheAccountListed()
        {
            try
            {
                List <IWebElement> rows = new List <IWebElement>(AccountsPage.TableElement(SelectBrowser.driver).FindElements(By.TagName("tr")));
                rowscount = rows.Count;

                List <IWebElement> columns = new List <IWebElement>(SelectBrowser.driver.FindElements(By.XPath("//table[@id='accounts-jeopardy']//tbody//tr[1]/td")));
                colcount = columns.Count;

                for (int rownum = 1; rownum <= rowscount - 2; rownum++)
                {
                    List <IWebElement> rowCells = new List <IWebElement>(SelectBrowser.driver.FindElements(By.XPath("//table[@id='accounts-jeopardy']//tbody//tr[" + rownum + "]/td")));
                    for (int CellNumber = 0; CellNumber < rowCells.Count; CellNumber++)
                    {
                        string      text        = rowCells.ElementAt(CellNumber).Text;
                        IWebElement element     = rowCells.ElementAt(CellNumber).FindElement(By.TagName("a"));
                        string      textpresent = element.Text;
                        if (textpresent.Contains(ExcelRead.GetCellData(xlpath1, @"AccountsSheet", 1, 0)))
                        {
                            Synchronization.VisibleElement(SelectBrowser.driver, By.TagName("a"));
                            element.Click();
                            test.Log(Status.Pass, "Clicked on the Account==>" + ExcelRead.GetCellData(xlpath1, @"AccountsSheet", 1, 0));
                            break;
                        }
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception==>" + ex);
                ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
            }
        }
 public void WhenUserClicksOnTheJeoPardyAccountsLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//a[@id='sales-stats-jeopardy']"));
         string text = LoginPage.JeoPardyAccountsLink(SelectBrowser.driver).Text;
         if (text.Equals("0 Jeopardy Accounts") == true)
         {
             Console.WriteLine("No Accounts Listed");
             ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
             SelectBrowser.driver.Close();
             test.Info("Browser Closes");
         }
         else
         {
             LoginPage.JeoPardyAccountsLink(SelectBrowser.driver).Click();
             test.Log(Status.Pass, "Click on the JeoPardy Accounts Link");
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
        public void ThenUserVerifiesTheData()
        {
            try
            {
                SelectBrowser.driver.SwitchTo().Window(SelectBrowser.driver.WindowHandles.Last());
                using (var session = Sikuli.CreateSession())
                {
                    var down_text   = Patterns.FromFile(@"C:\Users\ankit.kansal\Desktop\Downloadbutton.PNG", 0.9f);
                    var save_button = Patterns.FromFile(@"C:\Users\ankit.kansal\Desktop\SaveButton.PNG", 0.9f);
                    session.Wait(down_text, 500);
                    session.Click(down_text);
                    test.Log(Status.Pass, "User Clicks on the Download Button");
                    session.Wait(save_button, 500);
                    session.Click(save_button);
                    test.Log(Status.Pass, "User Clicks on the Save Button");
                }

                Assert.IsTrue(PDFReaderP.ExtractPDF(@"C:\Users\ankit.kansal\Downloads\ReconReport_V9.pdf").Contains("Account"));
            }
            catch (AssertFailedException ex)
            {
                Console.WriteLine("Exception==>" + ex);
                ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
            }
        }
Exemplo n.º 4
0
        public void ThenUserShouldClickOnDownloadLinkForDownloadingPdfFile()
        {
            try
            {
                SelectBrowser.driver.SwitchTo().Window(SelectBrowser.driver.WindowHandles.Last());
                //Assert.IsTrue(SelectBrowser.driver.Url.Contains("w9form"));
                using (var session = Sikuli.CreateSession())
                {
                    var down_text   = Patterns.FromFile(@"C:\Users\Anuruddha.Tiwari\source\repos\ThomasNetProject\ThomasNetProject\Images\DownloadButton.PNG", 0.9f);
                    var save_button = Patterns.FromFile(@"C:\Users\Anuruddha.Tiwari\source\repos\ThomasNetProject\ThomasNetProject\Images\SaveButton.PNG", 0.9f);
                    session.Wait(down_text, 500);
                    session.Click(down_text);
                    test.Log(Status.Pass, "User Clicks on the Download Button");
                    session.Wait(save_button, 500);
                    session.Click(save_button);
                    test.Log(Status.Pass, "User Clicks on the Save Button");
                }

                //Assert.IsTrue(PDFReaderP.ExtractPDF(@"C:\Users\ankit.kansal\Downloads\ReconReport_V9.pdf").Contains("Account"));
            }
            catch (AssertFailedException ex)
            {
                Console.WriteLine("Exception==>" + ex);
                ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
            }
        }
Exemplo n.º 5
0
 public void WhenUserClicksOnTheReportsLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'Reports')]"));
         ReportsPage.ReportsText(SelectBrowser.driver).Click();
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 6
0
 public void ThenUserShouldBeLandedSuccessfullyForReportsPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//h3[contains(text(),'Reports')]"));
         Assert.IsTrue(ReportsPage.ReportsText(SelectBrowser.driver).Text.Contains("Reports"));
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void GivenUserShouldBeLandedSucessfullyOnTheHomePageAsWithTheProvidedUrl()
 {
     try
     {
         Assert.IsTrue(InitialPage.SignInText(SelectBrowser.driver).Text.Equals("Sign In"));
         test.Info("Browser and URL launched Successfully");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenClickOnTheLoginButton()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//input[@id='Login']"));
         LoginPage.LoginButton(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "Click on the Login to the SandBox");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldNavigateToTheCredentialsPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//input[@id='Login']"));
         Assert.IsTrue(LoginPage.LoginButton(SelectBrowser.driver).GetAttribute("name").Contains("Login"));
         test.Log(Status.Pass, "User Navigayed to the Credentials Page");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenUserClicksOnTheLoginWithSalesForceLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.LinkText("Login with Salesforce"));
         InitialPage.LoginButton(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "Click on the Login Button");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldSuccessfullyLandedToTheMainPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//div[@class='pull-right refresh_info']"));
         Assert.IsTrue(LoginPage.VerificationText(SelectBrowser.driver).Text.Contains("Information was refreshed"));
         test.Info("User Successfully Landed to the Main Page");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 12
0
 public void ThenUserShouldBeLandedSuccessfullyForSalesActivityPage()
 {
     try
     {
         SelectBrowser.driver.SwitchTo().Window(SelectBrowser.driver.WindowHandles.Last());
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//button[@type='button']"));
         Assert.IsTrue(ReportsPage.ViewReports(SelectBrowser.driver).Text.Contains("View Report"));
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenNowUserClicksOnTheReconLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//col-md-[contains(text(),'Recon')]"));
         SpecificAccountInfo.ReconLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the Recon Link");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenUserClicksOnTheInvoicesPaymentsLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//a[@ui-sref='Invoice/Payments']/col-md-"));
         SpecificAccountInfo.Invoiceslink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the Invoices and Payments Link");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldBeVerifyThatPDFDataIsValidated()
 {
     //string path=
     try
     {
         Assert.IsTrue(PDFReaderP.ExtractPDF(@"C:\Users\ankit.kansal\Downloads\60149025.pdf").Contains("ThomasNet"));
         test.Info("User is verified succesfully");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void WhenEnterUsernameAndPassword()
 {
     try
     {
         LoginPage.UsernameText(SelectBrowser.driver).SendKeys(ExcelRead.GetCellData(xlpath1, @"UserCredentials", 1, 0));
         LoginPage.PasswordText(SelectBrowser.driver).SendKeys(ExcelRead.GetCellData(xlpath1, @"UserCredentials", 1, 1));
         test.Log(Status.Pass, "Enter Username and Password");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldBeNavigatesToTheCorrectPage()
 {
     try
     {
         string texttitle = SelectBrowser.driver.Url;
         Assert.IsTrue(texttitle.Contains(ExcelRead.GetCellData(xlpath1, @"AccountsSheet", 1, 0)));
         test.Log(Status.Pass, "User Navigated to the Specfic Account Page");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
 public void ThenUserShouldBeLandedSuccessfullyForJeopardyAccountsPage()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//h3[contains(text(),'Jeopardy Accounts')]"));
         Assert.IsTrue(AccountsPage.AccountsText(SelectBrowser.driver).Text.Contains("Jeopardy Accounts"));
         test.Log(Status.Info, "User Landed Successfully to the Jeopardy Account");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 19
0
 public void ThenUserShouldClickOnLinkWFormUnderRatesPolicies()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//a[contains(text(),'W9 Form')]"));
         RatesPoliciesPage.WForm(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the W9Form under Rates & Policies");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 20
0
 public void WhenUserClickOnAnyAvailableLinkUnderMediaSalesAsPerSelectedDrillDown()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'Month Start')]"));
         ActivityHomePage.MediaDisplayLink(SelectBrowser.driver).Click();
         Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 21
0
 public void ThenUserClicksOnTheCustomSPECLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'# Account')]//following::div[14]//following::div[1]"));
         ActivityHomePage.CustomSpeckLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the Custom SPEC link");
         //Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 22
0
 public void WhenUserClickOnCloseButton()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//button[@class='btn btn-default pull-right']"));
         ActivityHomePage.CloseButton(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the close button");
         // Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 23
0
 public void WhenUserClickOnAnyAvailableLinkUnderPendingRenewals()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'(GMI) GLUECKLER METAL INC.')]//preceding::i[1]"));
         ActivityHomePage.GlueLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the download link for Pending Renewals");
         //Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 24
0
 public void ThenCheckWeatherDownloadedFileIsXlsxOrNotForSPECImplementation()
 {
     try
     {
         string path = @"C:\Users\Anuruddha.Tiwari\Downloads\Custom SPEC Implementation.xlsx";
         Assert.IsTrue(path.Contains(".xlsx"));
         test.Info("Assert pass successfully for downloaded file is xlsx or not for Custom SPEC Implementation");
         // Console.WriteLine("file extenssion is .xlsx");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 25
0
 public void WhenClickOnDownloadLinkForSPECImplementation()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//a[@class='excel-link pull-left']"));
         ActivityHomePage.DownloadCustomSpeckImplementationLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the download link for Custom SPEC Implementation");
         //Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 26
0
 public void ThenUserClickOnTheDownloadLinkForPendingRenewals()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//div[@class='span12 pending-renewal-gap']//div[@class='widget-header-highlite']/a"));
         ActivityHomePage.DownloadPendingRenewalsLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the download link for Pending Renewals");
         //Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 27
0
 public void WhenUserClickOnTheDownloadLinkForMediaSales()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'Month Start')]"));
         ActivityHomePage.MediaDisplayDownloadLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the download link for Media Sales");
         //Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 28
0
 public void WhenClickOnTheContentMaintenanceLink()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//div[contains(text(),'Content Maintenance')]"));
         ActivityHomePage.ContentMainLink(SelectBrowser.driver).Click();
         test.Log(Status.Pass, "User Clicks on the Content Maintenance link");
         // Thread.Sleep(10000);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 29
0
 public void ThenCheckAmountIsMatchingWithTheTotalOfNewPopupWindowOrNot()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//h4[@class='ng-binding']"));
         string s1 = ActivityHomePage.TextAmtCustomSpeck(SelectBrowser.driver).Text;
         string s2 = ActivityHomePage.TexttotamtCustomSpeck(SelectBrowser.driver).Text;
         Assert.AreEqual(s1, s2);
         test.Info("Assert pass successfully for Custom SPEC amount with respect to total amount");
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }
Exemplo n.º 30
0
 public void ThenUserShouldCheckByDefaultDrillDownInternet_TSpec_TNNIsDisplayingOrNot()
 {
     try
     {
         Synchronization.VisibleElement(SelectBrowser.driver, By.XPath("//span[contains(text(),'Month Start')]"));
         bool b = ActivityHomePage.DrillDownDisplay(SelectBrowser.driver).Displayed;
         test.Info("Internet_TSpec_TNN is displaying on the page.");
         //Thread.Sleep(10000);
         //Console.WriteLine(b);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Exception==>" + ex);
         ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
     }
 }