I wrote a simple try/catch to validate the title of the login page. At the moment the Title is wrong, so it should go to catch it, but it doesn't. Am I missing something? The page title should be AppGo
.
Here is the code:
string getTitle = driver.Title;
try
{
if (getTitle == "AmazingApp")
{
Console.WriteLine("The application " + getTitle + " has logged in successfully!");
}
}
catch(Exception ex)
{
Assert.Fail(ex.Message);
Console.WriteLine("The user failed to log in successfully!");
}