mercredi 28 février 2018

Iterate Element in Nightwatch

I would like to iterate the xpath element and compare the string. The xpath element has similar format.

for (var i = 0; i < jsonObj.Sheet1.length ;++i) { 
 selector = new String('//*[@id="SearchListGridView_DXDataRow' + i + '"]/td[4]');
 browser.expect.element(selector).text.to.contain(jsonObj.Sheet1[i].Account)
} 

But return me error saying text is not element. Please help on this.

Aucun commentaire:

Enregistrer un commentaire