public void ChangePwdSteps() { //initialize excel data reader GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ChangePassword"); UserNameTab.Click(); GlobalDefinitions.wait(10); ChangPwdTab.Click(); //check if its an alert CurrentPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Current Password")); NewPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "New Password")); ConfirmPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Confirm Password")); SavePwd.Click(); GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//div[contains(@class,'ns-box ns-growl ns-effect-jelly ns-type-success ns-show')]"), 10); }
internal void ChangePassword() { //Change Password Thread.Sleep(2000); //Move on "Hi Harris" Text idDropdown.Click(); Thread.Sleep(1000); //Click change password on the dropdown changePwd.Click(); Thread.Sleep(1000); //Enter Current Password currentPwd.SendKeys("Test@123"); //Enter New Password NewPwd.SendKeys("Test@1234"); //Enter Confirm Password ConfirmPwd.SendKeys("Test@1234"); //Click on Save Button saveBtn.Click(); Thread.Sleep(1000); //Verify successfull message Assert.AreEqual(GlobalDefinitions.driver.FindElement(By.XPath("//div[contains(@class,'ns-box ns-growl')]//div[1]")).Text, "Password Changed Successfully"); }