i use nightwatch.js test foreign website code. used command:
.waitforelementvisible('input[id="inputfield"]', timeout) this should wait until specified element visible. warning:
warn: waitforelement found 24 elements selector "input[id="inputfield"]". first 1 checked.
i thought id of tag unique. how possible list of 24 elements when looking id? can select element need?
how possible list of 24 elements when looking id?
because people fail understand basic concept ids must unique. apparently, site you're testing against written 1 or more of people.
what can select element need?
according documentation, nightwatch.js lets use xpath alternative css. xpath, can specify of set of elements target, e.g.:
.usexpath() .waitforelementvisible('//input[@id="inputfield"][1]', timeout) ...would use first, [2] use second, etc.
if can't index of element in document, you'll need find other things can use select (with css or xpath).
Comments
Post a Comment