在下拉菜单中设置显示块的难度

时间:2017-07-07 18:40:39

标签: javascript protractor

我的目标:

在我的页面中,我有一个display:none的下拉列表,也就是说,如果我没有将其定义为display:block

,则无法与此元素进行交互

下拉代码:

<dd id="preview_district" class="dd-true select-auto-scroll">
<div class="uk-width-small-1-1 uk-hidden-medium uk-hidden-large">
<div class="material-select filled">
<span class="material-title">Departamento</span>
</div>
</div>
<div class="material-select filled" data-native-select="true" data-toggle-placeholder="true">
<label for="select-1-preview_district">
<span>(Selecciona)</span>
<strong></strong>
</label>
<input id="select-1-preview_district" type="checkbox">
<span class="material-title">Departamento</span>
<select id="selectPreviewDistrict" name="preview_district" placeholder="Departamento" data-native-select="true" data-toggle-placeholder="true">
<option value="*" disabled="" selected="" hidden="">(Selecciona)</option>
<option value="91">AMAZONAS</option>
<option value="5">ANTIOQUIA</option>
<option value="81">ARAUCA</option>
</select>
<ul class="radio">
<li>
<input id="preview_district-0" value="*" name="preview_district" type="radio">
<label for="preview_district-0">(Selecciona)</label>
</li>
<li>
<input id="preview_district-1" value="91" name="preview_district" type="radio">
<label for="preview_district-1">AMAZONAS</label>
</li>
<li>
</ul>
</div>
<small class="validation-msg uk-text-danger" data-field="preview_district" data-validation="invalid" style="display:none;">Selecciona el departamento</small>
</dd>

在这种情况下,<select id="selectPreviewDistrict" name="preview_district" placeholder="Departamento" data-native-select="true" data-toggle-placeholder="true">display:none

有关

我正在尝试使用:

browser.executeScript('arguments[0].style.display = "block"', element(by.id('selectPreviewDistrict')).getWebElement());

但元素仍然不可见。

任何帮助?

0 个答案:

没有答案