Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(NoSuchElementError): add 'new' keyword to instantiate class
Browse files Browse the repository at this point in the history
The class NoSuchElementError is called without the new keyword in the `ElementArrayFinder.prototype.count` causing a `Class constructors cannot be invoked without 'new'`

closes #3079
  • Loading branch information
davinkevin authored and cnishina committed Apr 1, 2016
1 parent 582411b commit 88dd568
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ ElementArrayFinder.prototype.count = function() {
return this.getWebElements().then(function(arr) {
return arr.length;
}, function(err) {
if (err.code == webdriver.error.NoSuchElementError()) {
if (err.code == new webdriver.error.NoSuchElementError()) {
return 0;
} else {
throw err;
Expand Down

0 comments on commit 88dd568

Please sign in to comment.