I am having trouble retrieving an input element using xpath as the return statement is false.
Oddly enough when attempting to retrieve the label, which is the only sibling of the input, it returns true. I also tried to target it using input[@type="checkbox"] but without success.
try {
var select2 = wait.until(pkg.ExpectedConditions.visibilityOfElementLocated(pkg.By.xpath('//div[@class="arcHier arcVert arcTree"]/ol/li/ul/li[3]/div[@class="dragNode"]/label')))
WDS.log.info('select2 found')
var select3 = wait.until(pkg.ExpectedConditions.visibilityOfElementLocated(pkg.By.xpath('//div[@class="arcHier arcVert arcTree"]/ol/li/ul/li[3]/div[@class="dragNode"]/input')))
WDS.log.info('select3 found')
}
catch (err) {
WDS.log.error('item not found')
}
HTML structure:
<li id="4_2_1_292719_8381e915e3af18b6f1f672da1ee582ef_LI" style="line-height:19px;border-color:#a0a0a0;color:#000000;" class="LI_1_2">
<label class="arcSelectable" style="height:19px;">
<input type="checkbox" id="4_2_1_292719_8381e915e3af18b6f1f672da1ee582ef_X" class="arcHpCbox" checked="checked">
<span class="arcMenuCheckbox"></span>
</label>
<div class="dragNode">
<input type="checkbox" id="4_2_1_292719_8381e915e3af18b6f1f672da1ee582ef" style="margin-top:3px;">
<label draggable="false" for="4_2_1_292719_8381e915e3af18b6f1f672da1ee582ef" style="height:19px;">
<span class="SPAN_1_2" style=""></span>
0001 Training_Test_Company
</label>
</div>
</li>
The logs file:
- 2019-07-10 10:55:33,187 INFO c.g.j.p.w.s.WebDriverSampler: select2 found
- 2019-07-10 10:55:43,310 ERROR c.g.j.p.w.s.WebDriverSampler: item not found