/// <summary> /// Clicks the start appliction button. /// </summary> public void ClickStartApplictionBtn() { _act.waitForVisibilityOfElement(_homeDetailsLoc.btnstartApplication, 30); _act.JSClick(_homeDetailsLoc.btnstartApplication, "btnstartApplication"); Thread.Sleep(2000); //_act.click(_homeDetailsLoc.btnstartApplication, "btnstartApplication"); }
/// <summary> /// Clicks the no short term loan status button. /// </summary> public void ClickNoShortTermLoanStatusBtn() { Thread.Sleep(2000); _act.waitForVisibilityOfElement(_personaldetailsLoc.ShortTermLoanStatusNo, 20); _act.JSClick(_personaldetailsLoc.ShortTermLoanStatusNo, "ShortTermLoanStatusNo"); }
public void SelectPOLandAmount(int requestedAmount, string loanpurpose) { // Wait for First POL _act.waitForVisibilityOfElement(By.XPath("(//span[text()='- select purpose -'])[last()-2]"), 60); // click on first POL dropdown _act.click(By.XPath("(//span[text()='- select purpose -'])[last()-2]"), "first purpose"); // select first POL from popup if (loanpurpose.Contains(",")) { var purpose = loanpurpose.Split(','); foreach (var loan in purpose) { IWebElement selectedPOL = _driver.FindElement(By.XPath("//*[@id='POLOptions']//div/label[starts-with(text(),'" + loan + "')]/preceding-sibling::div")); string classtextwhenchecked = selectedPOL.GetAttribute("class"); // if (!classtextwhenchecked.Contains("checked")) // { var polpurpose = By.XPath("//*[@id='POLOptions']//div/label[starts-with(text(),'" + loan + "')]/preceding-sibling::div"); // Thread.Sleep(3000); _act.JSClick(polpurpose, "selectpurpose"); // Thread.Sleep(3000); // } } if (loanpurpose == "Other,Anything else") { _act.EnterText(By.XPath("//*[@class='polMoreDetails']"), "Secret it is"); } _act.JSClick(By.XPath(".//*[@id='purpose-done-btn2']"), "BtnPurposeLoan"); } else { IWebElement selectedPol = _driver.FindElement(By.XPath("//*[@id='POLOptions']//div/label[starts-with(text(),'" + loanpurpose + "')]/preceding-sibling::div")); string classtextwhenchecked = selectedPol.GetAttribute("class"); // if (!classtextwhenchecked.Contains("checked")) // { var polpurpose = By.XPath("//*[@id='POLOptions']//div/label[starts-with(text(),'" + loanpurpose + "')]/preceding-sibling::div"); // Thread.Sleep(3000); _act.JSClick(polpurpose, "selectpurpose"); // Thread.Sleep(3000); // } // Thread.Sleep(3000); if (loanpurpose == "Other,Anything else") { _act.EnterText(By.XPath("//*[@class='polMoreDetails']"), "Secret it is"); } _act.JSClick(By.XPath(".//*[@id='purpose-done-btn2']"), "BtnPurposeLoan"); } // enter first POL loan amount _act.EnterText(By.XPath("(.//*[@type='number'])[last()-2]"), requestedAmount.ToString()); //click on continue button _act.JSClick(By.XPath(".//*[@id='btnPOLsCompleted']"), "continue"); if ((loanpurpose.Contains("Utility bills") || loanpurpose.Contains("Basic living/work expenses,Emergency Repairs")) && _act.isElementPresent(By.XPath("//span[text()='More information']"))) { _act.waitForVisibilityOfElement(By.XPath("//span[text()='More information']"), 60); _act.EnterText(By.XPath("//*[@name='poloverallmoreinfo']"), "hi hello"); // click on MoreInfo continue Button _act.click(By.XPath("//*[@class='button-continue button sml button']"), "MoreInfoContinue"); } }