public void Email_LinkActivation(IWebDriver driver) { try { Thread.Sleep(2000); if (pobalOption_Select.Displayed || pobalOption_Select.Enabled) { pobalOption_Select.Click(); } userName.SendKeys(Credentials_Data.UserName); password.SendKeys(Credentials_Data.Password); signIN.Click(); //webDriver.Navigate().GoToUrl(URLConfig.CRM_SPP_Frame); AJAXCall.WaitForReady(driver); Thread.Sleep(1000); CRM_TabOptions.Click(); Thread.Sleep(1000); Email_Link.Click(); AJAXCall.WaitForReady(driver); Thread.Sleep(2000); webDriver.SwitchTo().Frame(0); var Email_Sequence = "//table[@id='gridBodyTable']/tbody/tr/td"; Thread.Sleep(2000); for (int i = 1; i < 100; i++) { var mesg = Email_Sequence + "[" + i + "]/nobr/a"; IWebElement wb = webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")); var EmailText = wb.Text; AJAXCall.WaitForAjax(); Thread.Sleep(2000); if (EmailText.Contains("Complete your Registration in the Early Years Hive")) { webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")).Click(); break; } else if (EmailText.Contains("Hive")) { Console.WriteLine(EmailText); } } Thread.Sleep(2000); AJAXCall.WaitForAjax(); webDriver.SwitchTo().DefaultContent(); IList <IWebElement> frames; frames = webDriver.FindElements(By.TagName("iframe")); int totalFrames = frames.Count; Dictionary <int, string> frameNamesIDs = new Dictionary <int, string>(); for (int i = 0; i < frames.Count; i++) { frameNamesIDs.Add(i, frames[i].GetAttribute("id").ToString()); } webDriver.SwitchTo().Frame("contentIFrame1"); Thread.Sleep(1000); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); webDriver.SwitchTo().Frame("descriptionEditIFrame"); Thread.Sleep(1000); IWebElement message = webDriver.FindElement(By.XPath("//html/body/p")); //var text_link = message.GetAttribute("textContent"); var email_activationLink = message.GetAttribute("innerHTML"); getEmailFromString(email_activationLink); ReportsGeneration._test.Log(Status.Pass, " " + email_activationLink + " " + "PASSED"); Thread.Sleep(1000); webDriver.Navigate().GoToUrl(Constant_functions.emailActivateURL); Thread.Sleep(1000); InvitationCode_Textfield.SendKeys(Constant_functions.redeemCodeText); submit_RedeemActivateButtn.Click(); Newuser_Password.SendKeys("Test@123"); Thread.Sleep(500); ConfirmNewuser_Password.SendKeys("Test@123"); Register_New_user.Click(); Thread.Sleep(500); js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); accept_rule.Click(); Update_Submitbtn.Click(); } catch (Exception e) { Console.WriteLine(e.Message); Assert.Fail("Failed"); } }
public void TuslaCRM_Approval() { webDriver.Navigate().GoToUrl(URLConfig.CRM_SPP_Frame); Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.CssSelector(".idp:nth-child(4) .largeTextNoWrap"))) { pobalOption_Select.Click(); } userName.SendKeys(Credentials_Data.UserName); password.SendKeys(Credentials_Data.Password); signIN.Click(); AJAXCall.WaitForReady(webDriver); Thread.Sleep(1000); CRM_TabOptions.Click(); Thread.Sleep(1500); tuslaTab.Click(); Thread.Sleep(500); webDriver.SwitchTo().DefaultContent(); Thread.Sleep(2000); //webDriver.SwitchTo().Frame("contentIFrame1"); webDriver.SwitchTo().Frame(0); Thread.Sleep(500); ViewSelectorContainer.Click(); webDriver.FindElement(By.Id("crmGrid_findCriteria")).Click(); Thread.Sleep(500); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("crmGrid_findCriteria")) || crmGrid_FindCriteria.Displayed) { //crmSearchGrid.Click(); IWebElement clickwebforms = webDriver.FindElement(By.Id("crmGrid_findCriteria")); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); IWebElement wb = webDriver.FindElement(By.Id("crmGrid_findHintText")); var value = wb.GetAttribute("style"); AJAXCall.WaitForAjax(); if (value.Contains("display: none;")) { AJAXCall.WaitForAjax(); clickwebforms.Click(); if (value.Contains("display: none;")) { Thread.Sleep(1000); clickwebforms.Click(); Thread.Sleep(900); clickwebforms.SendKeys(Constant_functions.tuslaNumber); AJAXCall.WaitForAjax(); clickwebforms.SendKeys(Keys.Enter); Thread.Sleep(1000); } } else { Thread.Sleep(1000); clickwebforms.Click(); if (value.Contains("display: inline;")) { Thread.Sleep(1000); clickwebforms.Click(); Thread.Sleep(900); clickwebforms.SendKeys(Constant_functions.tuslaNumber); AJAXCall.WaitForAjax(); Thread.Sleep(1000); clickwebforms.SendKeys(Keys.Enter); Thread.Sleep(1000); } } } Thread.Sleep(1000); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); CRM_UAT_ServiceProviderPortal_Page tuslaCRMPage = new CRM_UAT_ServiceProviderPortal_Page(webDriver); tuslaCRMPage.OnBoardingAdmin(); webDriver.SwitchTo().DefaultContent(); Thread.Sleep(2000); webDriver.SwitchTo().Frame(0); webDriver.SwitchTo().ParentFrame(); Thread.Sleep(2000); webDriver.SwitchTo().Frame(1); Thread.Sleep(2000); Thread.Sleep(2000); if (AJAXCall.IsElementPresent(By.XPath("//*[@id='FormSecNavigationControl - Icon']"))) { NavigationFlyOut_Button.Click(); Review_Click.Click(); } else { Actions action = new Actions(webDriver); action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform(); } IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0,250)", ""); Thread.Sleep(1000); IWebElement chkBox_td = webDriver.FindElement(By.Id("eyp_markasapproved_d")); var td = chkBox_td.GetAttribute("class"); Thread.Sleep(2000); approve_chkBox.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); webDriver.SwitchTo().DefaultContent(); AJAXCall.WaitForAjax(); Thread.Sleep(800); SaveAndClose.Click(); webDriver.SwitchTo().Frame(1); Thread.Sleep(1000); // webDriver.SwitchTo().DefaultContent(); AJAXCall.WaitForAjax(); }
public void Bank_CodeActivation(IWebDriver driver) { try { Thread.Sleep(4000); pobalOption_Select.Click(); userName.SendKeys("*****@*****.**"); userName.Clear(); userName.SendKeys("*****@*****.**"); password.SendKeys(Credentials_Data.Password); signIN.Click(); webDriver.Navigate().GoToUrl(URLConfig.CRM_SPP_Frame); Thread.Sleep(800); CRM_TabOptions.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(900); Email_Link.Click(); AJAXCall.WaitForReady(driver); Thread.Sleep(1000); webDriver.SwitchTo().Frame(0); var Email_Sequence = "//table[@id='gridBodyTable']/tbody/tr/td"; Thread.Sleep(2000); for (int i = 1; i < 100; i++) { var mesg = Email_Sequence + "[" + i + "]/nobr/a"; IWebElement wb = webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")); var EmailText = wb.Text; AJAXCall.WaitForAjax(); Thread.Sleep(1000); if (EmailText.Contains("Bank Account Validation Code")) { //webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")).Click(); webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr/td[2]/nobr/a")).Click(); break; } else if (EmailText.Contains("Bank")) { Console.WriteLine(EmailText); } } Thread.Sleep(1000); webDriver.SwitchTo().DefaultContent(); IList <IWebElement> frames; frames = webDriver.FindElements(By.TagName("iframe")); int totalFrames = frames.Count; Dictionary <int, string> frameNamesIDs = new Dictionary <int, string>(); for (int i = 0; i < frames.Count; i++) { frameNamesIDs.Add(i, frames[i].GetAttribute("id").ToString()); } webDriver.SwitchTo().Frame("contentIFrame1"); Thread.Sleep(1000); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); webDriver.SwitchTo().Frame("descriptionEditIFrame"); Thread.Sleep(1000); IWebElement message = webDriver.FindElement(By.XPath("/html/body/div/p/span[2]")); //var text_link = message.GetAttribute("textContent"); var bankCode = message.GetAttribute("innerHTML"); getBankCodeString(bankCode); ReportsGeneration._test.Log(Status.Pass, " " + bankCode + " " + "PASSED"); Thread.Sleep(1000); var newVal = Constant_functions.bankCode; Excel_Suite Ex = new Excel_Suite(@"C:\Pobal_AutomationProject\Pobal_Test_Project\Automation_Suite\TestData_Repository\BankCode.xlsx"); Ex.SetBankCellData("Bank_Sheet", "BankActivationCode", newVal); // Adds resources to the resource writer. Thread.Sleep(500); js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); } catch (Exception e) { Console.WriteLine(e.Message); Assert.Fail("Failed"); } }