automated tests - nightwatchJS how to use assert.containsText on a table? -
i've starting using nightwatch , want confirm table correctly populated. terminal can like:
$("div#systemviewtable table tbody tr td.sortable").text()
and bunch of text. when trying same selector in nightwatch empty string. i.e.>
browser.assert.containstext("div#systemviewtable table tbody tr td.sortable", "some text")
how can make work properly?
you have options:
because containstext() used on single element can't use in question referencing multiple td elements. either use table, tbody or set class name table (a class name required if have multiple tables on site since selector has unique), match text if it's outside of td element might not want.
otherwise option td elements using instance selenium elements , loop through each of these , compare them given string. see this answer example of how can done.
Comments
Post a Comment