Protractor:How to store values in array and then to do sorting

715 views
Skip to first unread message

Sujata Dwivedi

unread,
Feb 18, 2015, 5:09:59 AM2/18/15
to ang...@googlegroups.com
Hi,

I need to sort list strings under the table ,so for that i have written following lines of code but on console i am not getting any values:
                
                var j=9;
                var rows = element.all(by.repeater('row in renderedRows'));
var column = element.all(by.repeater('col in renderedColumns'));
expect(rows.count()).toEqual(5);//here its printing number of rows
expect(column.count()).toEqual(5);//here its printing number of columns
var arr=[rows.count()];
                for(var i=0;i<rows.count();i++)
{
console.log("aai"+i);
                if(i=0)
{
//var columnvalue=column.get(9).getText();
var columnvalue=column.get(9).getText().then(function(ss){
return ss.trim();
arr[i]=ss.trim(); //here it will save the value first value of column
console.log("value1"+arr[i]);
expect(arr[i]).toEqual('DN');
console.log("aa"+ss.trim());
});
}
else{
var j=j+8;
var columnvalue=column.get(j).getText().then(function(ss){
 return ss.trim();
 arr[i]=ss.trim();//here it will save the other values of column
 console.log("value"+arr[i]);
 expect(arr[i]).toEqual('DN');
 console.log("ab"+ss.trim());
});
 
}
}

Thanks,
Sujata

Sujata Dwivedi

unread,
Feb 18, 2015, 7:57:39 AM2/18/15
to ang...@googlegroups.com
 having error: Cannot read property 'ELEMENT' of undefined
Reply all
Reply to author
Forward
0 new messages