Может кто-нибудь помочь мне, как выбрать несколько вариантов (флажок) в раскрывающемся списке. Нужно выбрать опцию на основе значений в листе Excel. В тестовой таблице данных будут предоставлены разделенные запятыми значения с частичным текстом, и на основании этого нам нужно будет выбрать параметры.
Мой код:
String[] app=apps.split(",");
for(String apl:app)
{
applications.click();
System.out.println(apl);
WebElement selecapp=MainConfig.getDriver().findElement(By.xpath("//label[contains(.,"+apl+")]"));
selecapp.click();
Thread.sleep(1000);
}
Выпадающее изображение из приложения
HTML Код:
<ul class="dropdown-menu selectItems" id="thisWidth" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 35px, 0px);">
<li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">Test1 -
Test1
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2121 -
Default
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2139 -
acsIVRautomated
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2160 -
ISurvey121
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2176 -
SurveyDemo2
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2177 -
EditedSurvey
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2179 -
TestSurvey234
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2199 -
ForDeletedfgsdh
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2200 -
SurveyReportTest
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2221 -
SurveyDemo25
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2226 -
TestRuleExpression
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2244 -
TestSurvey
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2251 -
dsg
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">A6235 -
A6235
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2253 -
Survey6235
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2254 -
sdgsdg
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2255 -
Testhhh
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2256 -
GGGGGGGGGGGGGGGGGGGGG
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2257 -
dfgdfg
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2258 -
dfgdfhdh
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2259 -
gfhjfgjfg
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2367 -
TestsampleAuto
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2368 -
sampleA1
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2369 -
sampleA12
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2370 -
sampleA13
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2371 -
sampleA15
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2372 -
sampleA16
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2373 -
sampleA17
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2374 -
Nsy5
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2376 -
NSY1
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2381 -
TestsampleAutomationTestsampleAutomationTestsampleAutomationTestsampleAutomationTestsampleAutomation
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2382 -
Te
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2383 -
Te1
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2384 -
Testing123Testing123Testing123Testing123Testing123Testing123Testing123Testing123Testing123Testing123
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2388 -
CyaraHappyPath
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2403 -
SampleTestAutoWithMoreThanLinkText
</label>
</li><li id="app" data-toggle="tooltip" title="">
<label class="dropdown-item">
<input type="checkbox" checked.bind="avl.selected" change.delegate="addAllocation()" id="app" onkeydown="return (event.keyCode!=13);" class="au-target" au-target-id="191">2404 -
Survey2sample
</label>
</li><!--anchor-->
</ul>
</div>
Любая помощь будет по достоинству оценена.
Заранее спасибо