I am using protractor for my UI test. I am trying to retrieve and validate the rows from the table. Below is my code. The issue I have here is , It returns each row in the table when I do console.log but when I do expect to validate with rows. Its validating with empty values. I am using async.series for my flow. below function is part of my async. Each row has the value "SDY789".
function(callback){
element.all(by.tagName("tr")).each(function(row,index){
row.getText().then(function(text){
console.log("print text************"+text);
expect(text).toContain("SDY789");
})
})
callback();
},
This is what i am getting with as a result.
print text************06-15-2016 james SDY789 28 Male
print text************
print text************04-15-2011 williams SDY789 56 Male
print text************
print text************10-14-2003 harry SDY789 32 Male
print text************
print text************12-14-2004 elliot SDY789 41 Male
print text************
print text************02-14-2005 andy SDY789 28 Male
Expected '' to contain 'SDY789'.
Expected '' to contain 'SDY789'.
Expected '' to contain 'SDY789'.
Expected '' to contain 'SDY789'.
Expected '' to contain 'SDY789'.
Please also suggest how to retrieve specific column only. The table is not using ng-repeat so I cannot use repeater control from Protractor.