public void verifyBalance(string testname) { reports.verifyElement(EnvtestOR.ManageMyAccount); reports.Screenshot(driver, "Account Overview", testname); Core.Click(EnvtestOR.ManageMyAccount); Thread.Sleep(10000); wait.Until(x => ((IJavaScriptExecutor)x).ExecuteScript("return document.readyState").Equals("complete")); try { Thread.Sleep(3000); //Core.MoveToElement(EnvtestOR.Airtime); reports.verifyElement(EnvtestOR.Airtime); reports.Screenshot(driver, "Verify Airtime", testname); } catch { Thread.Sleep(15000); Core.MoveToElement(EnvtestOR.Billsofar); wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(EnvtestOR.Billsofar))); reports.verifyElement(EnvtestOR.Billsofar); reports.Screenshot(driver, "Verify Bill so far", testname); } }
public static void PerformloginOtp(string userName, string passwrd, string testname, ReportsManager reports) { Thread.Sleep(5000); StartUp(); Click(EnvtestOR.Login); reports.verifyElement(EnvtestOR.UsernameInput); reports.verifyElement(EnvtestOR.LoginButton); reports.Screenshot(webDriver, "LogIn page", testname); EnterValue(EnvtestOR.UsernameInput, userName); webDriver.FindElement(By.XPath("//a[contains(.,'Use OTP')]")).Click(); Thread.Sleep(3000); reports.Screenshot(webDriver, "Requesting OTP", testname); var value = Core.ReadMessege(reports, testname); Thread.Sleep(3000); //Move to OTPLogin button MoveToElement("//a[@class='btn btnPurple login-otp']"); webDriver.FindElement(By.XPath("//input[@name='otp']")).SendKeys(value); reports.Screenshot(webDriver, "OTP Entered", testname); //loginOTP button Click("//a[@class='btn btnPurple login-otp']"); Thread.Sleep(5000); reports.Screenshot(webDriver, "Succesfully logged-in", testname); }
public static void Logout(ReportsManager reports, string testname) { MoveToElement(EnvtestOR.Logout); reports.verifyElement(EnvtestOR.Logout); Click(EnvtestOR.Logout); reports.verifyElement(EnvtestOR.Login); reports.verifyElement(Message.LogoutMsg); // reports.Screenshot("Logout Successful", testname); }
public static void Performlogin(string userName, string passwrd, string testname, ReportsManager reports) { Thread.Sleep(5000); Click(EnvtestOR.Login); reports.verifyElement(EnvtestOR.UsernameInput); reports.verifyElement(EnvtestOR.PasswordInput); reports.verifyElement(EnvtestOR.LoginButton); reports.Screenshot(webDriver, "Verified Log In", testname); EnterValue(EnvtestOR.UsernameInput, userName); EnterValue(EnvtestOR.PasswordInput, passwrd); Click(EnvtestOR.LoginButton); Thread.Sleep(5000); reports.verifyElement(EnvtestOR.Logout); }