Okay... This has been very frusturating because I have a method that always works for lists like this, and when it used for this particular list element, it is only able to click some of the elements!! ughh!! Heres the method I use
public void selectConvienanceComfortFeature(String feature){
List<WebElement> choice = driver.findElements(By.xpath("//ul[@id='j_id_as-searchform-col-wrapper-col1-listingsSearch-featureOptions-checkboxes-j_id_hl-0-j_id_hm-j_id_ho-0-features']/li"));
for(WebElement e : choice){
System.out.println(e.getText());
if(e.getText().contains(feature)){
e.click();
break;
}
}
}
The System.out.println is only in the to see if it is actually finding the elements, which it is! I get a print out of every element in the list. But when I declare selectConvienanceComfortFeature("3rd Row Seats"), it wont click it! But it works for other list options such as "Heated Seats" that were printed to the console as well.. I know its there and I dont know why some of them work and some dont.. No, they are not by default selected.
Here is the HTML segment.
Aucun commentaire:
Enregistrer un commentaire