How can I verify text in ControlType.Text using C# + TestStack.White? I am just trying to verify that error message is correct and contains correct phrase.
I have tried different solutions:
-
TextBox errorTextBox = MainWindow.Get("txbError"); Assert.AreEqual("User name or password is invalid", errorTextBox.Text);
-
TextBox errorTextBox = MainWindow.Get(SearchCriteria.ByText("User name or password is invalid")); Assert.AreEqual(errorTextBox.Text, "User name or password is invalid");
And others...
Always appears an error in VS:
TestStack.White.AutomationException: Failed to get ControlType=edit,Name=User name or password is invalid
Aucun commentaire:
Enregistrer un commentaire