我有 UI,我需要在其中选中复选框以打开另一个窗口。但是这些复选框被定义为图像,唯一的定位器是
//img[@src='https://myvoice-preprod.primus.ca/HPBX/hpbx/sc/skins/Enterprise/images/DynamicForm/unchecked.png']
List<WebElement>lChekbox = driver.findElements(By.xpath
("//img[@src='https://myvoice-preprod.primus.ca/HPBX/hpbx/sc/skins/Enterprise/images/DynamicForm/unchecked.png']"));
int iChk = lChekbox.size();
for(int i =0; i<=iChk; i++){
if (i==index){
}
}
index= 所需复选框所属的表中行的索引。
如何根据索引单击此复选框/图像或如何将索引传递给此 xpath
谢谢