Hi Ayesha,
I think you try out with EventFiringWebDriver and WebDriverEventListener to
wrap your webdriver instance. This will capture screenshot for exceptions
thrown by webdriver.
EventFiringWebDriver driver = new EventFiringWebDriver(new
InternetExplorerDriver());
WebDriverEventListener errorListener = new AbstractWebDriverEventListener()
{
@Override
public void onException(Throwable throwable, WebDriver driver) {
takeScreenCapture("screen-name"); //you need to implement this
method.
}
};
driver.register(errorListener);
Thanks,
Krishantha.
On Fri, Oct 31, 2014 at 12:25 PM, Ayesha Dissanayaka <[email protected]>
wrote:
> Hi,
>
> In-order to identify UI test failures in automation test execution what
> would be the best approach?
> Some Suggestions are as below which I have come across.
>
> - Use a TestNG listener [01] to capture the current screen on a test
> failure.
> - try-catch in asserts and bind screen-capturing to error handling
> - Any other proper way?
>
> [01]
> http://blog.alvarus.org/2014/05/selenium-capturing-screenshots-of-failed-tests-in-junit-and-testng/
>
> Thanks!
> - Ayesha
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: [email protected] <[email protected]>
>
--
Krishantha Samaraweera
Senior Technical Lead - Test Automation
Mobile: +94 77 7759918
WSO2, Inc.; http://wso2.com/
lean . enterprise . middlewear.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev