diff --git a/examples/tests/ecosia.js b/examples/tests/ecosia.js index 784554b6fa..42c1becb8f 100644 --- a/examples/tests/ecosia.js +++ b/examples/tests/ecosia.js @@ -16,5 +16,11 @@ describe('Ecosia.org Demo', function() { .assert.textContains('.layout__content', 'Nightwatch.js'); }); + it('Demo test ecosia.org whether the element is not present', function(browser) { + browser + .waitForElementVisible('body') + .element('.main-nav').find('.btn'); + }); + after(browser => browser.end()); }); diff --git a/lib/api/web-element/scoped-element.js b/lib/api/web-element/scoped-element.js index 69cd42123f..2609eade4c 100644 --- a/lib/api/web-element/scoped-element.js +++ b/lib/api/web-element/scoped-element.js @@ -170,6 +170,7 @@ class ScopedWebElement { return null; } + error.name = 'NoSuchElementError'; const narrowedError = createNarrowedError({error, condition, timeout}); Logger.error(narrowedError);