虽然匹配的元素存在于表中,但它并没有进入循环

时间:2015-01-14 09:01:05

标签: selenium-webdriver equals-operator

String bknum=d.findElement(By.xpath(".//*[@id='error-back']/a[@style]")).getText();

List<WebElement> cols=d.findElements(By.xpath("//tbody/tr/td[2][text()]"));
System.out.println("Coloumn was selected");

for(WebElement col:cols){
    if(col.equals(bknum)){
        System.out.println("Bookng exists");
        d.findElement(By.xpath("//tbody/tr/td[2][contains(text(),"+bknum+")]/following-sibling::*[7]/a[2]/img")).click();
    }

0 个答案:

没有答案