I am encountering a problem trying to use WebDriverExceptionEventArgs.ThrownException:
firingWebDriver.ExceptionThrown += new EventHandler<WebElementEventArgs>(_ExceptionThrown);
static void _ExceptionThrown(object sender, WebElementEventArgs e)
{
//System.Diagnostics.Trace.WriteLine(e.ThrownException.Message);
//Console.WriteLine(e.ThrownException.Message);
}
However VS2015 displays the following error:
Cannot implicitly convert type 'System.EventHandler<OpenQA.Selenium.Support.Events.WebElementArgs> to 'System.EventHandler<OpenaQA.Selenium.Support.Events.WebDriverExceptionEventArgs>
I am not sure where the mistake lies, any help?
WebDriverExceptionEventArgs
notWebElementEventArgs