public void LocalAppLoginValidation() { BrowserWindow browser = BrowserWindow.Launch("http://10.23.66.126:84/Login.aspx"); HtmlEdit uname = new HtmlEdit(browser); HtmlEdit pass = new HtmlEdit(browser); HtmlButton loginbtn = new HtmlButton(browser); uname.SearchProperties.Add("Id", "TextBox1"); pass.SearchProperties.Add("Id", "TextBox2"); loginbtn.SearchProperties.Add("Id", "Button1"); loginbtn.SearchProperties.Add("TagName", "INPUT"); //Keyboard.SendKeys(uname, "testname"); //Keyboard.SendKeys(pass, "testpass"); Mouse.Click(loginbtn); Playback.Wait(5000); if (uname.WaitForControlExist()) { Console.WriteLine("Missing username and Password"); } else { Console.WriteLine("User logged in even with Missing username and Password"); Assert.Fail("Test failed"); } }
public static void EnterTextInSingleline(string fieldName, string text) { HtmlEdit Edit = new HtmlEdit(browserWindow); //Edit.SearchProperties.Add(HtmlEdit.PropertyNames.Type, "SINGLELINE", PropertyExpressionOperator.EqualTo); Edit.SearchProperties.Add(HtmlEdit.PropertyNames.Name, fieldName, PropertyExpressionOperator.EqualTo); Edit.FilterProperties.Add(HtmlEdit.PropertyNames.Id, fieldName, PropertyExpressionOperator.Contains); Edit.FilterProperties.Add(HtmlEdit.PropertyNames.ControlDefinition, fieldName, PropertyExpressionOperator.Contains); //Edit.WaitForControlExist(Parameters.WAIT_FOR_CONTROL); Edit.WaitForControlExist(); Edit.Text = text; }
/// <summary> /// EmailTextBox - Use 'EmailTextBoxExpectedValues' to pass parameters into this method. /// </summary> public void EmailTextBox() { #region Variable Declarations HtmlEdit uIExistingEmailEdit = this.UIInstallationWizardWindow.UIItemClient.UISignupWizardEngineDocument.UIExistingEmailEdit; #endregion uIExistingEmailEdit.WaitForControlExist(); uIExistingEmailEdit.Text = "*****@*****.**"; // Verify that 'Existing Email' text box's property 'Id' equals 'SignInName' // Assert.AreEqual(this.EmailTextBoxExpectedValues.UIExistingEmailEditId, uIExistingEmailEdit.Id); }
public FederatedLogInPage LoginWithSendKeys(string userName) { HtmlEdit txtUserName = new HtmlEdit(_bw); txtUserName.SearchProperties.Add(HtmlEdit.PropertyNames.Id, "EmailAddress"); txtUserName.WaitForControlExist(); Keyboard.SendKeys(txtUserName, userName); var btn = GetLoginButton(); Mouse.Click(btn); return(new FederatedLogInPage(_bw)); }