I have been working on a project and noticed the watin library freezing the application. Here is the code:
using(var browser = new IE(url))
{
if(!string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(password))
{
browser.Link(Find.ById("overridelink")).Click();
}
}
The code above works fine if the ID “overidelink” attribute is found. If its not found the whole application freezes up. How can I prevent this?
First check if it’s exists and then excecute the click