private void ChangeButton_Click(object sender, EventArgs e)
        {
            if ((username != "giaovu" && CurrPass.Text.Length < 8) || CurrPass.Text.Length > 16)
            {
                NotiLabel.Text = "Current password is not correct.";
            }
            else if (NewPass.Text.Length < 8)
            {
                NotiLabel.Text = "Password must contain at least 8 characters.";
            }
            else if (NewPass.Text.Length > 16)
            {
                NotiLabel.Text = "Password must contain at most 16 characters.";
            }
            else if (NewPass.Text != ConfirmPass.Text)
            {
                NotiLabel.Text = "Confirm new password does not match.";
            }
            else if (NewPass.Text == CurrPass.Text)
            {
                NotiLabel.Text = "New password must be different from the current one.";
            }
            else
            {
                StudentServices services = new StudentServices();
                NotiLabel.Text = services.ChangePassword(username, CurrPass.Text, NewPass.Text);
            }

            CurrPass.Clear();
            NewPass.Clear();
            ConfirmPass.Clear();
        }
Esempio n. 2
0
        public void Create_AccountPage()
        {
            Fname.SendKeys("Testing");
            Lname.SendKeys("Guru");
            Email.SendKeys("*****@*****.**");
            TelePhone.SendKeys("07777777");
            Fax.SendKeys("012345");
            Company.SendKeys("IT_Tech");
            Address1.SendKeys("BFD");
            Address2.SendKeys("city road");
            City.SendKeys("Leeds");



            //DropDown list for Country
            SelectElement DropDown2 = new SelectElement(Country_UK);

            DropDown2.SelectByText("United Kingdom");
            BasePage.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            //DropDown list for State/Region
            SelectElement DropDown1 = new SelectElement(RegionState);

            DropDown1.SelectByText("West Yorkshire");
            BasePage.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            ZipCode.SendKeys("12345");



            CountryDropDownClick.Click();
            //Country_UK.Click();

            LoginName.SendKeys("tguru2713");
            Password.SendKeys("123qwe");
            ConfirmPass.SendKeys("123qwe");
            Suscribe.Click();
            TermsCondition.Click();
            ContinueBtn1.Click();
            ContinueBtn2.Click();
            //Assert.IsTrue
        }