From ec7ca89cfa309f388bcc4659e11d6e35bb005f52 Mon Sep 17 00:00:00 2001 From: Julie Date: Fri, 4 Apr 2014 12:50:32 -0700 Subject: [PATCH] docs(faq): add link to webdriverjs-retry and question about catching errors --- docs/faq.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index 01c99dfee..50c59dea2 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -95,3 +95,10 @@ How do I produce an XML report of my test results? -------------------------------------------------- Use jasmine-reporters and add a JUnit XML Reporter. Check out [this example](https://github.com/angular/protractor/blob/master/spec/junitOutputConf.js). + +How can I catch errors such as ElementNotFound? +----------------------------------------------- +WebDriver throws errors when commands cannot be completed - e.g. not being able to click on an element which is obscured by another element. If you need to retry these actions, try using [webdriverjs-retry](https://github.com/juliemr/webdriverjs-retry). If you would just like to catch the error, do so like this +```javascript +elm.click().then(function() { /* passing case */}, function(err) { /* error handling here */}) +```