internal void LoginSteps() { // Populate the Excel Data Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "SignIn"); Thread.Sleep(500); // Click the Sign In link SignInLink.Click(); // Input the Email address field with valid characters Email.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Emailaddress")); // Input the Password field with valid characters Password.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Password")); // Tick the the Remember me? checkbox Checkbox.Click(); // Click the Login button Login.Click(); Thread.Sleep(1000); // Verify if sign in successfully IWebElement ProfilePage = GlobalDefinitions.driver.FindElement(By.XPath("//button[contains(@class,'button')][contains(text(),'Sign Out')]")); Assert.That(ProfilePage.Text, Is.EqualTo("Sign Out")); }
public void LoginAsAdmin(string baseUrl) { _driver.Navigate().GoToUrl(baseUrl); SignInLink.Click(); UserIdField.Clear(); // sending a single quote is not possible with the Chrome Driver, it sends two single quotes! UserIdField.SendKeys("admin'--"); PasswordField.Clear(); PasswordField.SendKeys("blah"); LoginButton.Click(); }
//This is a Login method to validate use logins By Nasamani public void LoginAsNobody(string baseUrl) { _driver.Navigate().GoToUrl(baseUrl); SignInLink.Click(); UserIdField.Clear(); UserIdField.SendKeys("nobody"); PasswordField.Clear(); PasswordField.SendKeys("blah"); LoginButton.Click(); }
internal void LoginSteps() { GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "SignIn"); String BaseUrl = GlobalDefinitions.ExcelLib.ReadData(3, "Url"); String Username = GlobalDefinitions.ExcelLib.ReadData(3, "Username"); String Pwd = GlobalDefinitions.ExcelLib.ReadData(3, "Password"); GlobalDefinitions.driver.Navigate().GoToUrl(BaseUrl); SignInLink.Click(); Email.SendKeys(Username); Password.SendKeys(Pwd); LoginBtn.Click(); }
public void ClickSignInLink() { SignInLink.Click(); }
public void OpenSignInPage() { SignInLink.Click(); }
public void NavigateToRegistartionPage() { SignInLink.Click(); CreateEmailInput.SendKeys("*****@*****.**"); CreateAccountButton.Click(); }
public MainPage SignIn() { SignInLink.Click(); return(this); }
//Validate password has been changed public void ValidateChangedPassword() { try { GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "SignIn"); GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//button[text()='Sign Out']", 6); //Click on the signout button SignOutBtn.Click(); GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//a[contains(text(),'Sign')]", 6); //Clicking on SignIn link SignInLink.Click(); GenericWait.ElementIsVisible(GlobalDefinitions.driver, "Name", "email", 6); //Enter the username Email.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Username")); GenericWait.ElementIsVisible(GlobalDefinitions.driver, "Name", "password", 6); //Enter the new password Password.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "New Password")); GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//button[contains(text(),'Login')]", 6); //Click on the Login button LoginBtn.Click(); //Validating user succesfully login after with the changed password GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//div[@class ='ui compact menu']//span[@class = 'item ui dropdown link '][contains(text(),'Hi')]", 6); if (UserWelcomeLink.Displayed) { Assert.IsTrue(true); Base.test.Log(LogStatus.Pass, "User new password has been changed successfully"); } else { Assert.IsTrue(false, "User new password has failed to update"); Base.test.Log(LogStatus.Fail, "User new password has failed to update"); } } catch (Exception e) { Base.test.Log(LogStatus.Fail, "Exception found For Change Password", e.Message); } /*Resetting the password*/ //Retreiving passwords values from the excel GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ChangePassword"); String CurrentPasswordValue = GlobalDefinitions.ExcelLib.ReadData(2, "NewPassword"); String NewPasswordValue = GlobalDefinitions.ExcelLib.ReadData(2, "Password"); String ConfirmPasswordValue = GlobalDefinitions.ExcelLib.ReadData(2, "Password"); //Clicking on User welcome name link UserWelcomeLink.Click(); GenericWait.ElementIsVisible(GlobalDefinitions.driver, "LinkText", "Change Password", 5); //Clicking on change password link ChangePasswordLink.Click(); //Entering the current password CurrentPasswordTextbox.SendKeys(CurrentPasswordValue); //Entering the new password password NewPasswordTextbox.SendKeys(NewPasswordValue); //Entering the confirm password ConfirmPasswordTextbox.SendKeys(ConfirmPasswordValue); //Clicking on the save button SaveButton.Click(); }
public LoginPage GoToSignInPage() { SignInLink.Click(); return(Navigate(this).PostBack <LoginPage>(WebDriver)); }