Selenium 2 OnException method in c#

237 Views Asked by At

Am porting by Java codes to c#. I wanted to re-write the following Java code in c#. Thanks in advance :)

// Called whenever an exception would be thrown.
    public void onException(java.lang.Throwable throwable, WebDriver driver){
        System.out.println("onException' Called whenever an exception would be thrown ...");
    }
1

There are 1 best solutions below

1
On BEST ANSWER

A like to like translation is as follow:

public void OnException(System.Exception exception, IWebDriver driver)
{
    Console.WriteLine("OnException' Called whenever an exception would be thrown ...");
}