public Login FillCredentialsWithoutRequiredFieldAndClick(Credentials credentials) { FillCredentials(credentials); LoginBtn.Click(); return(new Login(Driver)); }
public PersonalPageClass CreateNewAccount(string username = null, string password = null) { LogoutFromApplication(); CreatAccLink.Click(); if (username == null) { UserName.SendKeys(ObjectRepository.Config.GetUsername()); } else { UserName.SendKeys(username); } if (password == null) { Password.SendKeys(ObjectRepository.Config.GetPassword()); ConfirmPassword.SendKeys(ObjectRepository.Config.GetPassword()); } else { Password.SendKeys(password); ConfirmPassword.SendKeys(password); } LoginBtn.Click(); return(new PersonalPageClass(Driver)); }
public void Login(string email, string password) { EmailTxtBox.SendKeys(email); PasswordTxtBox.SendKeys(password); LoginBtn.Click(); }
public Profile FillValidCredentialsAndClick(Credentials credentials) { FillCredentials(credentials); LoginBtn.Click(); return(new Profile(Driver)); }
public void LoginToWebApp(string user, string pass) { Selenium.WaitUntilElementIsClickable(SignInLnk); SignInLnk.Click(); EmailTxt.Clear(); EmailTxt.SendKeys(user); PasswordTxt.Clear(); PasswordTxt.SendKeys(pass); LoginBtn.Click(); }
public void Login() { User defaultUser = User.GetDefaultCredentials(); UsernameField.SetValue(defaultUser.Username); PasswordField.SetValue(defaultUser.Password); Thread.Sleep(500); LoginBtn.Focus(); LoginBtn.Click(); //WaitUntilNotVisible(LoginBtn); }
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(); }
/// <summary> /// Clicks the user-specified element and then waits for a window to close or open, or a page to load, /// depending on the element that was clicked /// </summary> /// <param name="buttonOrLinkElem">The element to click on</param> public void ClickToAdvance(IWebElement buttonOrLinkElem) { if (Browser.Exists(Bys.LoginPage.LoginBtn)) { if (buttonOrLinkElem.GetAttribute("id") == LoginBtn.GetAttribute("id")) { LoginBtn.Click(); //new WebDriverWait(Browser, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.UrlContains("Default2")); return; } } else { throw new Exception("No button or link was found with your passed parameter. You either need to add this button to a new If statement, or if the button is already added, then the page you were on did not contain the button."); } }
public void LoginSteps() { Global.GlobalDefinitions.driver.Navigate().GoToUrl(ExcelLibHelp.ReadData(2, "Url")); //Click the sign-In tab SignIntab.Click(); //sending values to email id Email.SendKeys(ExcelLibHelp.ReadData(2, "Username")); //sending velues of password Password.SendKeys(ExcelLibHelp.ReadData(2, "Password")); //Click login Button LoginBtn.Click(); Global.GlobalDefinitions.wait(5); }
/// <summary> /// Clicks the user-specified element and then waits for a window to close or open, or a page to load, /// depending on the element that was clicked /// </summary> /// <param name="buttonOrLinkElem">The element to click on</param> public HomePage ClickToAdvance(IWebElement buttonOrLinkElem) { if (Browser.Exists(Bys.LoginPage.LoginBtn)) { if (buttonOrLinkElem.GetAttribute("id") == LoginBtn.GetAttribute("id")) { LoginBtn.Click(); HomePage HP = new HomePage(Browser); return(HP); } } else { throw new Exception("No button or link was found with your passed parameter. You either need to add this button to a new If statement, or if the button is already added, then the page you were on did not contain the button."); } return(null); }
/// <summary> /// Clicks the user-specified element and then waits for a window to close or open, or a page to load, /// depending on the element that was clicked /// </summary> /// <param name="buttonOrLinkElem">The button element</param> public HomePage ClickAndWait(IWebElement buttonOrLinkElem) { if (Browser.Exists(Bys.LoginPage.LoginBtn)) { if (buttonOrLinkElem.GetAttribute("id") == LoginBtn.GetAttribute("id")) { LoginBtn.Click(); //new WebDriverWait(Browser, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.UrlContains("Default2")); HomePage HP = new HomePage(Browser); return(HP); } } else { throw new Exception("No button or link was found with your passed parameter"); } return(null); }
internal void LoginSteps() { //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPathShareSkill, "SignIn"); //Navigate to URL GlobalDefinitions.NavigateUrl(); //Click on Sign In button SignIntab.Click(); //Enter UserName Email.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Username")); //Enter Password Password.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password")); //Click Login Button LoginBtn.Click(); }
/// <summary> /// TDD implementaion through Excel. /// </summary> public string LoginToApplication(string[] data) { //var item = ExcelHelper.ReadDataFromKey("default"); string email = string.Empty; //if (item.ToLower().Contains("default")) //{ //email = UserName.EnterText(ExcelHelper.ReadData(2, "UserName")); //Password.EnterText(ExcelHelper.ReadData(2, "Password")); email = UserName.EnterText(data[0]); Password.EnterText(data[1]); LoginBtn.Click(); Console.WriteLine("Login To Application Passed"); //} //else //{ // Console.WriteLine("Login To Application failed. please seleect the default credential from Excel"); //} return(email); }
/// <summary> /// Clicks the user-specified button or link and then waits for a window to close or open, or a page to load, /// depending on the button that was clicked /// </summary> /// <param name="buttonOrLinkElem">The element to click on</param> public dynamic ClickToAdvance(IWebElement buttonOrLinkElem) { if (Browser.Exists(Bys.LoginPage.LoginBtn)) { if (buttonOrLinkElem.GetAttribute("outerHTML") == LoginBtn.GetAttribute("outerHTML")) { LoginBtn.Click(); // Browser.WaitForElement(Bys.EducationCenterPage.MyCoursesTtl, TimeSpan.FromSeconds(60), ElementCriteria.IsVisible, ElementCriteria.IsEnabled); //Browser.WaitForElement(Bys.EducationCenterPage.GcepLnk, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled); new WebDriverWait(Browser, TimeSpan.FromSeconds(90)).Until(ExpectedConditions.UrlContains("Courses.aspx")); return(new EducationCenterPage(Browser)); } else { throw new Exception("No button or link was found with your passed parameter. You either need to add this button to a new If statement, or if the button is already added, then the page you were on did not contain the button."); } } return(null); }
internal void LoginSteps() { //extent Reports Base.test = Base.extent.StartTest("Login Test"); //Populate the Excel sheet GlobalDefinitions.ExcelLib.PopulateInCollections(Global.Base.ExcelPath, "SignIn"); //Navigate to the Url GlobalDefinitions.driver.Navigate().GoToUrl(GlobalDefinitions.ExcelLib.ReadData(2, "Url")); //Click on Sign In tab SignIntab.Click(); GlobalDefinitions.wait(10); //Enter the data in Username textbox Email.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Username")); GlobalDefinitions.wait(10); //Enter the password Password.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password")); //Click on Login button LoginBtn.Click(); GlobalDefinitions.wait(20); string text = GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='account-profile-section']/div/div[1]/a")).Text; if (text == "MarsLogo") { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Login Successful"); } else { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Login Unsuccessful"); } }
/// <summary> /// Clicks the user-specified button or link and then waits for a window to close or open, or a page to load, /// depending on the button that was clicked /// </summary> /// <param name="buttonOrLinkElem">The element to click on</param> public bool ClickToAdvance(IWebElement buttonOrLinkElem) { bool buttonClicked = false; if (Browser.Exists(Bys.LoginPage.LoginBtn)) { if (buttonOrLinkElem.GetAttribute("id") == LoginBtn.GetAttribute("id")) { LoginBtn.Click(); //new WebDriverWait(Browser, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.UrlContains("Default2")); buttonClicked = true; return(buttonClicked); } } else { throw new Exception("No button or link was found with your passed parameter"); } return(buttonClicked); }
internal void SignInStep(IWebDriver driver) { // populate Excel //Populate the excel data GlobalDefinitions.ExcelLib.PopulateInCollection(MarsResources.ExcelPath, "SignIn"); SignIntab.Click(); Email.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Username")); password.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password")); LoginBtn.Click(); Thread.Sleep(2000); if (driver.WaitForElementDisplayed(By.XPath("//a[contains(text(),'Mars Logo')]"), 60)) { test = extent.CreateTest("Login Test"); SaveScreenShotClass.SaveScreenshot(driver, "Login"); test.Log(Status.Pass, "Login Successful"); } else { SaveScreenShotClass.SaveScreenshot(driver, "LoginFailed"); test.Log(Status.Fail, "Login failed"); } }
//Validate the password is changed internal void ValidateChangedPassword() { try { SignIn loginobj = new SignIn(); loginobj.SignOutSteps(); //Click on Sign In button SignIntab.Click(); //Enter UserName Email.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Username")); //Enter the changed Password Password.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "New Password")); //Click Login Button LoginBtn.Click(); Thread.Sleep(5000); GlobalDefinitions.ValidateBoolean(ChangePasswordDropDownLink.Displayed, "Password Changed"); } catch (Exception e) { Base.test.Log(LogStatus.Fail, "Caught Exception For Change Password", e.Message); } //Resetting the password ChangePasswordDropDownLink.Click(); Extension.WaitForElementDisplayed(GlobalDefinitions.Driver, By.XPath("//a[text()='Change Password']"), 5); ChangePasswordLink.Click(); CurrentPassword.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "New Password")); NewPassword.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password")); ConfirmPassword.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password")); SaveChangedPassword.Click(); }
public MyApplicationPageClass LoginInApplication(string username = null, string password = null) { LogoutFromApplication(); if (username == null) { UserName.SendKeys(ObjectRepository.Config.GetUsername()); } else { UserName.SendKeys(username); } if (password == null) { Password.SendKeys(ObjectRepository.Config.GetPassword()); } else { Password.SendKeys(password); } LoginBtn.Click(); return(new MyApplicationPageClass(Driver)); }
public void Login(string username, string password) { SureType(this.Username, username); SureType(this.Password, password); LoginBtn.Click(); }
private void Login(string username, string password) { UsernameTxtBox.SendKeys(username); PasswordTxtBox.SendKeys(password); LoginBtn.Click(); }
//---------------------------------------------------------------------------- //This is to click on Login button on header public void clickLoginBtn() { LoginBtn.Click(); }
public void Login(string email, string password) { EmailAddress.SendKeys(email); Password.SendKeys(password); LoginBtn.Click(); }
public void Login(string login, string password) { Username.SendKeys(login); Password.SendKeys(password); LoginBtn.Click(); }
public void LoginAs(String user, String passwd) { LoginUsername.SendKeys(user); LoginPassword.SendKeys(passwd); LoginBtn.Click(); }
internal void LoginSteps() { //Start the Login Global.Base.test = Global.Base.extent.StartTest("Property Owner Login"); //Populate in collection Global.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "LoginPage"); //Navigate to Url Global.GlobalDefinition.driver.Navigate().GoToUrl(Global.ExcelLib.ReadData(2, "Url")); Global.GlobalDefinition.wait(500); //Enter Username Username.SendKeys(Global.ExcelLib.ReadData(2, "UserName")); //Enter Password Password.SendKeys(Global.ExcelLib.ReadData(2, "Password")); Thread.Sleep(500); //Checking login button is displayed with assert try { Assert.IsTrue(LoginBtn.Displayed); } catch (Exception e) { Console.Write(e); } //Click on login Button LoginBtn.Click(); Thread.Sleep(1000); // Checking Page Title with assert try { string pageTitle = Global.GlobalDefinition.driver.Title; Assert.AreEqual("Properties | Property Community", "Properties | Property Community", pageTitle); //Assert.That(pageTitle,Does.Match("Dashboard")); } catch (Exception e) { Console.Write(e); } /* * //Verification * string message = Global.GlobalDefinition.driver.FindElement(By.XPath("//*[@id='main-content']/section/div[1]/h2")).Text; * string ActualMessage = Global.ExcelLib.ReadData(2, "LoginVerification"); * //Explicit Wait * Thread.Sleep(2000); * if (message == ActualMessage) * { * Global.Base.test.Log(LogStatus.Pass, "Property Owner Login Successfull"); * Global.SaveScreenShotClass.SaveScreenshot(Global.GlobalDefinition.driver, "Dashboard"); * } * else * { * Global.Base.test.Log(LogStatus.Fail, "Property Owner Login Unsuccessfull"); * } */ Global.GlobalDefinition.driver.Manage().Window.Maximize(); //Explicit Wait Thread.Sleep(1000); skipbtn.Click(); }
public void ClickLoginButton() { LoginBtn.Click(); }
//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(); }