You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
it('should return count for not existing elements',function(){browser.get('index.html#/form');varparent=element(by.css('not-existing-element'));varlistItems=parent.all(by.css('li'));expect(listItems.count()).toBe(0);});
Output from running the test
1) ElementFinder should return count for not existing elements
Message:
Failed: Class constructors cannot be invoked without 'new'
Stack:
TypeError: Class constructors cannot be invoked without 'new'
at Object.NoSuchElementError (/Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/error.js:229:14)
at /Users/szimek/Projects/src/protractor/built/element.js:343:37
at Promise.invokeCallback_ (/Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:1329:14)
at TaskQueue.execute_ (/Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:2790:14)
at TaskQueue.executeNext_ (/Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:2773:21)
at /Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:2652:27
at /Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:412:9)
From: Task: Run it("should return count for not existing elements") in control flow
at Object.<anonymous> (/Users/szimek/Projects/src/protractor/node_modules/jasminewd2/index.js:81:14)
at /Users/szimek/Projects/src/protractor/node_modules/jasminewd2/index.js:18:5
at Promise.invokeCallback_ (/Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:1329:14)
at TaskQueue.execute_ (/Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:2790:14)
at TaskQueue.executeNext_ (/Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:2773:21)
at /Users/szimek/Projects/src/protractor/node_modules/selenium-webdriver/lib/promise.js:2652:27
From asynchronous test:
Error
at Suite.<anonymous> (/Users/szimek/Projects/src/protractor/spec/basic/elements_spec.js:7:3)
at Object.<anonymous> (/Users/szimek/Projects/src/protractor/spec/basic/elements_spec.js:1:1)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
Steps to reproduce the bug
try to find an element that doesn't exist in DOM and then call e.g. .all(by.css('li')).count() on it
fails with the error message posted above. In Protractor 3.1.1 both versions worked fine. We're using page objects, so we're quite often chaining element selectors like in the failing example.
The text was updated successfully, but these errors were encountered:
Bug report
5.9.1
3.2.2
Chrome 50
OS X 10.11.4
.all(by.css('li')).count()
on itSomething like this works fine:
but this:
fails with the error message posted above. In Protractor 3.1.1 both versions worked fine. We're using page objects, so we're quite often chaining element selectors like in the failing example.
The text was updated successfully, but these errors were encountered: