find by xpath only in child of element with c# selenium -
i have code :
readonlycollection<iwebelement> questions = driver.findelements(by.xpath("//fieldset[@data-seleniumrp='question']")); foreach (iwebelement question in questions) { readonlycollection<iwebelement> repdispo = question.findelements(by.xpath("//input[@data-selenium-positionquestion]")); } my collection "questions" have 11 elements, right ! each "question" normaly have 4 elements ... code , have 44 results ( elements in page ) in "repdispo" ...
how childrend element , not element ?
i suspect problem in xpath inside foreach loop. need add . @ beginning of // axis make relative current question element :
".//input[@data-selenium-positionquestion]"
Comments
Post a Comment