У меня есть следующий код из SNAPDEAL, я хочу выбрать 1 ТБ и 120 ГБ
<div class="filter-inner overflow-filter" data-name="Capacity_s">
<div class="filters-list sdCheckbox ">
<input class="filter-value" type="checkbox" value="1 TB">
<label for="Capacity_s-1 TB">
<a class="filter-name hashAdded" href="https://www.snapdeal.com/products/storage-devices/filters/Capacity_s~1%20TB#bcrumbLabelId:3032">
1 TB</a>
<span class="filter-prod-count">20</span>
</label>
</div>
<div class="filters-list sdCheckbox ">
<input class="filter-value" type="checkbox" value="120 GB">
<label for="Capacity_s-120 GB">
<a class="filter-name hashAdded" href="https://www.snapdeal.com/products/storage-devices/filters/Capacity_s~120%20GB#bcrumbLabelId:3032">
120 GB</a>
<span class="filter-prod-count">1</span>
</label>
</div>
</div>
Написал следующий код, он выбирает первый флажок, но, тем не менее, он не выбрал оставшийся, и есть ошибка
@FindBy(xpath = "//div[@class='filter-inner overflow-filter']/div") List<WebElement> list_elements;
SnapDeal sd = PageFactory.initElements(driver, SnapDeal.class);
for ( WebElement el : sd.list_elements ) {
if ( !el.isSelected() ) {
el.click();
}
Исключение в потоке "main" org.openqa.selenium.StaleElementReferenceException: устаревшая ссылка на элемент: элемент не прикреплен к документу страницы