Вот мой HTML код:
<ul unselectable="on" class="k-list k-reset" tabindex="-1" aria-hidden="true" id="ddlSettleMode_listbox" aria-live="polite" data-role="staticlist" role="listbox"><li tabindex="-1" role="option" unselectable="on" class="k-item k-state-selected k-state-focused" data-offset-index="0" id="18e2d509-b1e1-4588-bd2a-dcff29b45b83">Select</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="1">Cash</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="2">Card</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="3">Cheque</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="4">Paytm</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="5">NEFT</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="6">DD</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="7">IMPS</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="8">Online</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="9">UPI</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="10">Digital</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="11">CMS</li><li tabindex="-1" role="option" unselectable="on" class="k-item" data-offset-index="12">Univ</li></ul>
Это мой код селена:
WebDriverWait Waita = new WebDriverWait(driver, 20);
Waita.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[text() = 'Select']")));
Waita.until(ExpectedConditions.elementToBeClickable(By.xpath("//span[text() = 'Select']"))).click();
WebDriverWait waitb = new WebDriverWait(driver, 20);
waitb.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//li[text() = 'Cash']")));
waitb.until(ExpectedConditions.elementToBeClickable(By.xpath("//li[text() = 'Cash']"))).click();
Я получаю следующее сообщение об ошибке:
Exception in thread "main" org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.xpath: //li[text() = 'Cash'] (tried for 20 second(s) with 500 milliseconds interval)