public void TestRegPagewithInvalidValues() { string firstName = "J"; string lastName = "K"; string department = "Engineering"; string userName = "******"; string password = "******"; string eMail = "johncom"; string contact = "98675647a"; IWebElement FName, LName, UName, Pwd, confirmPwd, Email, Phone, Submit; SelectElement Department; regPage.elements(Browser, out FName, out LName, out UName, out Pwd, out confirmPwd, out Email, out Phone, out Department, out Submit); FName.SendKeys(firstName); //var isValidIcon = FName.FindElement(By.ClassName("glyphicon-ok")); Assert.IsTrue((isInvalidDataIcon(FName)), "Invalid data icon is not displayed on entering the incorrect data on First Name" + FName.Text); LName.SendKeys(lastName); Assert.IsTrue((isInvalidDataIcon(LName)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + LName.Text); Department.SelectByText(department); UName.SendKeys(userName); Assert.IsTrue((isInvalidDataIcon(UName)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + UName.Text); Pwd.SendKeys(password); Assert.IsTrue((isInvalidDataIcon(Pwd)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + Pwd.Text); confirmPwd.SendKeys(password); Assert.IsTrue((isInvalidDataIcon(confirmPwd)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + confirmPwd.Text); Phone.SendKeys(contact); Assert.IsTrue((isInvalidDataIcon(Phone)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + Phone.Text); Email.SendKeys(eMail); Assert.IsTrue((isInvalidDataIcon(Email)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + Email.Text); Assert.IsFalse((Submit.Enabled), "The form has incorrect data but Submit is enabled"); }
public void TestRegPageWithValidValues() { string firstName = "John"; string lastName = "Kerry"; string department = "Engineering"; string userName = "******"; string password = "******"; string eMail = "*****@*****.**"; string contact = "9867564789"; IWebElement FName, LName, UName, Pwd, confirmPwd, Email, Phone, Submit; SelectElement Department; regPage.elements(Browser, out FName, out LName, out UName, out Pwd, out confirmPwd, out Email, out Phone, out Department, out Submit); FName.SendKeys(firstName); //var isValidIcon = FName.FindElement(By.ClassName("glyphicon-ok")); Assert.IsTrue((isValidDataIcon(FName)), "valid data icon is not displayed on entering the correct data on First Name" + FName.Text); LName.SendKeys(lastName); Assert.IsTrue((isValidDataIcon(LName)), "valid data icon is not displayed on entering the correct data on Last Name" + LName.Text); Department.SelectByText(department); UName.SendKeys(userName); Assert.IsTrue((isValidDataIcon(UName)), "valid data icon is not displayed on entering the correct data on Last Name" + UName.Text); Pwd.SendKeys(password); Assert.IsTrue((isValidDataIcon(Pwd)), "valid data icon is not displayed on entering the correct data on Last Name" + Pwd.Text); confirmPwd.SendKeys(password); Assert.IsTrue((isValidDataIcon(confirmPwd)), "valid data icon is not displayed on entering the correct data on Last Name" + confirmPwd.Text); Phone.SendKeys(contact); Assert.IsTrue((isValidDataIcon(Phone)), "valid data icon is not displayed on entering the correct data on Last Name" + Phone.Text); Email.SendKeys(eMail); Assert.IsTrue((isValidDataIcon(Email)), "valid data icon is not displayed on entering the correct data on Last Name" + Email.Text); Submit.Click(); var success = Browser.FindElement(By.Id("contact_form")); Assert.True((success.Text == "Thanks"), "Registration was unsuccessful"); }
public void TestRegPagewithBlankFieldsonCompulsaryDataFields() { string firstName = ""; string lastName = ""; string department = "Engineering"; string userName = ""; string password = ""; string eMail = ""; string contact = "9867564790"; IWebElement FName, LName, UName, Pwd, confirmPwd, Email, Phone, Submit; SelectElement Department; regPage.elements(Browser, out FName, out LName, out UName, out Pwd, out confirmPwd, out Email, out Phone, out Department, out Submit); FName.SendKeys(firstName); LName.SendKeys(lastName); Department.SelectByText(department); UName.SendKeys(userName); Pwd.SendKeys(password); confirmPwd.SendKeys(password); Phone.SendKeys(contact); Email.SendKeys(eMail); if (Submit.Displayed && Submit.Enabled) { Submit.Click(); } Assert.IsTrue((isInvalidDataIcon(FName)), "Invalid data icon is not displayed on entering the incorrect data on First Name" + FName.Text); Assert.IsTrue((isInvalidDataIcon(LName)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + LName.Text); Assert.IsTrue((isInvalidDataIcon(UName)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + UName.Text); Assert.IsTrue((isInvalidDataIcon(Pwd)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + Pwd.Text); Assert.IsTrue((isInvalidDataIcon(confirmPwd)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + confirmPwd.Text); Assert.IsTrue((isInvalidDataIcon(Email)), "Invalid data icon is not displayed on entering the incorrect data on Last Name" + Email.Text); Assert.IsFalse((Submit.Enabled), "The form has blank data in required fields but Submit is enabled"); }
protected override void Deserialize() { base.Deserialize(); NativeTypeName = _Buffer.ReadNameReference(); }
public override byte[] ToBytes() => ByteHelpers.Combine(new byte[] { Ver.ToByte(), ULen.ToByte() }, UName.ToBytes(), new byte[] { PLen.ToByte() }, Passwd.ToBytes());
public void Deserialize( IUnrealStream stream ) { TagName = stream.ReadNameReference(); TagValue = stream.ReadText(); }
private void Button3_Click_1(System.Object sender, System.EventArgs e) { try { if (string.IsNullOrEmpty(UName.Text.Trim())) { MessageBox.Show("Plz.. Enter UserName.."); } else if (string.IsNullOrEmpty(OPassword.Text.Trim())) { MessageBox.Show("Plz.. Enter Old Password.."); } else if (string.IsNullOrEmpty(NPassword.Text.Trim()) | string.IsNullOrEmpty(OPassword.Text.Trim())) { MessageBox.Show("Plz.. Enter New Password and Confirm it.."); } else if (NPassword.Text != CPassword.Text) { MessageBox.Show("Plz.. Password You Typed Did Not Match .. Plz Enter New Password Both Boxes.."); } else if (string.IsNullOrEmpty(AK.Text.Trim())) { MessageBox.Show("Plz.. Enter Access Key.."); } else { con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Bus_System;Integrated Security=True"); con.Open(); cmd = new SqlCommand("select username,password from Newuser where username='******' and password='******'", con); dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { dr.Close(); cmd = new SqlCommand("select * from AKPrivate where KeyIMP='" + AK.Text + "'", con); dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { dr.Close(); cmd = new SqlCommand("Update Newuser Set password='******' Where username='******'", con); cmd.ExecuteNonQuery(); MessageBox.Show("Password Changed Successfully..!"); AK.Clear(); NPassword.Clear(); CPassword.Clear(); OPassword.Clear(); UName.Clear(); } else { MessageBox.Show("Wrong Access Key..!"); } } else { MessageBox.Show("Wrong Username and Password..!"); } dr.Close(); con.Close(); } } catch (Exception ex) { MessageBox.Show("Sorry.. Something Went Wrong..! Or " + ex.Message); } }
public void Deserialize(IUnrealStream stream) { TagName = stream.ReadNameReference(); TagValue = stream.ReadText(); }