Может кто-нибудь помочь мне найти решение здесь
![enter image description here](https://i.stack.imgur.com/42Q4Z.png)
Сценарий автоматизации Selenium для тега <input>
, работающий как тег выбора (выпадающий) с установленным флажком для множественного выбора.
Выбранные значения считываются из файла Excel. Пожалуйста, найдите ниже пробный код:
List<WebElement> elements = (List<WebElement>) driver
.findElements(By.id("ctl00_ContentPlaceHolder1_rcbClinicians_Input"));
int numberOfElements = elements.size();
System.out.println("----size----- " + numberOfElements);
for (int i = 0; i < numberOfElements; i++) {
System.out.println(i);
elements = driver.findElements(By.id("ctl00_ContentPlaceHolder1_rcbClinicians_Input"));
elements.get(i).click();
}
Пожалуйста, помогите мне найти решение
<li>Choose Clincians* </li>
<li>
<div id="ctl00_ContentPlaceHolder1_rcbClinicians" class="RadComboBox RadComboBox_Default" style="width:500px;white-space:normal;">
<table summary="combobox" style="border-width:0;border-collapse:collapse;width:100%" class="rcbFocused">
<tbody><tr>
<td style="width:100%;" class="rcbInputCell rcbInputCellLeft"><input name="ctl00$ContentPlaceHolder1$rcbClinicians" type="text" class="rcbInput" id="ctl00_ContentPlaceHolder1_rcbClinicians_Input" value="" autocomplete="off"></td>
<td class="rcbArrowCell rcbArrowCellRight"><a id="ctl00_ContentPlaceHolder1_rcbClinicians_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a></td>
</tr>
</tbody></table>
<input id="ctl00_ContentPlaceHolder1_rcbClinicians_ClientState" name="ctl00_ContentPlaceHolder1_rcbClinicians_ClientState" type="hidden" autocomplete="off" value="{"logEntries":[],"value":"","text":"","enabled":true,"checkedIndices":[],"checkedItemsTextOverflows":false}">
</div>
</li>
</ul>
<ul>
<li>Choose CaseManagers* </li>
<li>
<div id="ctl00_ContentPlaceHolder1_rcbCaseManagers" class="RadComboBox RadComboBox_Default" style="width:500px;white-space:normal;">
<table summary="combobox" style="border-width:0;border-collapse:collapse;width:100%" class="">
<tbody><tr>
<td style="width:100%;" class="rcbInputCell rcbInputCellLeft"><input name="ctl00$ContentPlaceHolder1$rcbCaseManagers" type="text" class="rcbInput" id="ctl00_ContentPlaceHolder1_rcbCaseManagers_Input" value="" autocomplete="off"></td>
<td class="rcbArrowCell rcbArrowCellRight"><a id="ctl00_ContentPlaceHolder1_rcbCaseManagers_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a></td>
</tr>
</tbody></table>
<input id="ctl00_ContentPlaceHolder1_rcbCaseManagers_ClientState" name="ctl00_ContentPlaceHolder1_rcbCaseManagers_ClientState" type="hidden" autocomplete="off" value="{"logEntries":[],"value":"","text":"","enabled":true,"checkedIndices":[],"checkedItemsTextOverflows":false}">
</div>
</li>
</ul>