Javascript 自动执行多选下拉列表(optgroup)

Javascript 自动执行多选下拉列表(optgroup),javascript,php,selenium,multi-select,optgroup,Javascript,Php,Selenium,Multi Select,Optgroup,我正在尝试使用selenium从支持multi-select的下拉列表中自动选择一个值。我发现一个问题,因为下拉列表不是传统的,手动选择一个值将在另一个字段中显示为选定值 它是第三方工具(开发人员提到的optgroup) 下拉列表看起来是这样的 以下是下拉列表的HTML内容 <div class="multiSelectOptions" style="position: absolute; z-index: 99999; visibility: visible; height: 150p

我正在尝试使用selenium从支持multi-select的下拉列表中自动选择一个值。我发现一个问题,因为下拉列表不是传统的,手动选择一个值将在另一个字段中显示为选定值

它是第三方工具(开发人员提到的optgroup)

下拉列表看起来是这样的

以下是下拉列表的HTML内容

<div class="multiSelectOptions" style="position: absolute; z-index: 99999; visibility: visible; height: 150px; width: 203px; top: 958px; left: 398px;">
<label class="cl_Mlslt_emp_id" style="background-color:#FEF4DA;font-weight:bold;color:black;">Search: 
    <input type="textbox" class="comn-input" size="18" style="height:12px;margin:3px 0 2px 0;" onkeyup="searchTextInMultiDropDown(this);" id="srch_Mlslt_emp_id" name="srch_Mlslt_emp_id">
</label>
<label style="height:1px;background-color:#CCCCCC;margin-top:2px;">
</label>
<label class="selectAll">
    <input type="checkbox" class="selectAll">Remove All</label>
<label class="optGroup">My Team</label>
<label class="lbl_Mlslt_emp_id">
    <input type="checkbox" name="Mlslt_emp_id[]" value="1" class="formpref">
        <span>Emp 1</span>
</label>
<label class="lbl_Mlslt_emp_id">
    <input type="checkbox" name="Mlslt_emp_id[]" value="2" class="formpref">
        <span>Emp 2</span>
</label>
<label class="optGroup">Other Team</label>
<label class="lbl_Mlslt_emp_id">
    <input type="checkbox" name="Mlslt_emp_id[]" value="3" class="formpref">
        <span>Other Emp 1</span>
</label>
<label class="lbl_Mlslt_emp_id">
    <input type="checkbox" name="Mlslt_emp_id[]" value="4" class="formpref">
        <span>Other Emp 2</span>
</label>
<label class="lbl_Mlslt_emp_id">
    <input type="checkbox" name="Mlslt_emp_id[]" value="5" class="formpref">
        <span>Other Emp 3</span>
</label>
<label class="lbl_Mlslt_emp_id">
    <input type="checkbox" name="Mlslt_emp_id[]" value="6" class="formpref">
        <span>Other Emp 4</span>
</label>
<label class="lbl_Mlslt_emp_id">
    <input type="checkbox" name="Mlslt_emp_id[]" value="7" class="formpref">
        <span>Other Emp 5</span>
</label>
</div>

搜索:
全部删除
我的团队
环境管理计划1
环境管理计划2
其他团队
其他环境管理计划1
其他环境管理计划2
其他环境管理计划3
其他环境管理计划4
其他环境管理计划5