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
I'm new to Protractor and currently in learning phase. We are looking to use this in the next project. In learning, I'm trying to print length and count for element.all but unfortunately runner is showing error. Could you please help me where I'm missing if any. Thank you for your support.
Code:
//
var angjspage_Basicssec = require('../page/basicssection_page.js');
var angjspage_Todolist = require('../page/todosection_object.js');
describe("AngularJS Page automation",function(){
beforeEach(function(){
browser.get("http://angularjs.org");
});
it("Verify Todo section and add Task function",function(){
var strtodoitem = 'Angular test2';
//browser.waitForAngular();
console.log(element.all(by.css("[ng-repeat = 'todo in todoList.todos']")).count());
console.log(element.all(by.repeater("todo in todoList.todos")).length);
});
count() returns a promise (you are seeing the promise object logged out), so you will need to wait for the promise to be resolved with the actual value:
element.all(by.repeater("todo in todoList.todos")).count().then(function(size){console.log(size);});
Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)
Hi,
I'm new to Protractor and currently in learning phase. We are looking to use this in the next project. In learning, I'm trying to print length and count for element.all but unfortunately runner is showing error. Could you please help me where I'm missing if any. Thank you for your support.
Code:
//
var angjspage_Basicssec = require('../page/basicssection_page.js');
var angjspage_Todolist = require('../page/todosection_object.js');
describe("AngularJS Page automation",function(){
beforeEach(function(){
browser.get("http://angularjs.org");
});
it("Verify Todo section and add Task function",function(){
var strtodoitem = 'Angular test2';
});
Error:
[launcher] Running 1 instances of WebDriver
Object {
closure_uid_696411893: 356,
flow_:
Object {
events_: Object {},
closure_uid_696411893: 1,
activeFrame_:
Object {
events_: Object {},
closure_uid_696411893: 335,
flow_: [Circular],
parent_: [Object],
children_: [Object],
lastInsertedChild_: [Object],
pendingTask_: null,
isLocked_: false,
isBlocked_: false,
pendingCallback: false,
pendingRejection: false,
cancellationError_: null },
runningFrame_:
Object {
events_: Object {},
closure_uid_696411893: 335,
flow_: [Circular],
parent_: [Object],
children_: [Object],
lastInsertedChild_: [Object],
pendingTask_: null,
isLocked_: false,
isBlocked_: false,
pendingCallback: false,
pendingRejection: false,
cancellationError_: null },
schedulingFrame_:
Object {
events_: Object {},
closure_uid_696411893: 335,
flow_: [Circular],
parent_: [Object],
children_: [Object],
lastInsertedChild_: [Object],
pendingTask_: null,
isLocked_: false,
isBlocked_: false,
pendingCallback: false,
pendingRejection: false,
cancellationError_: null },
shutdownTask_: null,
eventLoopTask_: null,
hold_:
{ called: false,
idleTimeout: 2147483647,
idlePrev: [Object],
idleNext: [Object],
idleStart: 8217,
onTimeout: [Function: wrapper],
repeat: [Function] },
yieldCount: 2 },
stack: null,
parent:
Object {
closure_uid_696411893: 354,
flow:
Object {
events: Object {},
closure_uid_696411893: 1,
activeFrame: [Object],
runningFrame: [Object],
schedulingFrame_: [Object],
shutdownTask_: null,
eventLoopTask_: null,
hold_: [Object],
yieldCount_: 2 },
stack_: null,
parent_:
Object {
closure_uid_696411893: 352,
flow_: [Object],
stack_: null,
parent_: [Object],
callbacks_: [Object],
state_: 'pending',
handled_: true,
pendingNotifications_: false,
value_: undefined },
callbacks_: [ [Object] ],
state_: 'pending',
handled_: true,
pendingNotifications_: false,
value_: undefined },
callbacks_: null,
state_: 'pending',
handled_: false,
pendingNotifications_: false,
value_: undefined }
The text was updated successfully, but these errors were encountered: