我想选择以下代码的第一个值:
<select class="form-control input-sm">
<option value="PARENT-CHILD">Parent-Child (1:Many)</option>
<option value="PRIMARY-SECONDARY">Primary-Secondary (1:Many)</option
<option value="ASSOCIATED-TO">Associated To (Many:Many)</option>
</select>
代码尝试:
driver.findElement(By.xpath("//*[@id=\"popover162353\"]/div[2]/div/form/div/div[1]/div[1]/select")).click();
new Select(driver.findElement(By.xpath("//*[@id=\"popover162353\"]/div[2]/div/form/div/div[1]/div[1]/select"))).selectByVisibleText("Parent-Child (1:Many)");
网址:
<div class="popover-content">
<div>
<div class="editableform-loading" style="display: none;"></div>
<form class="form-inline editableform" style="">
<div class="control-group form-group">
<div>
<div class="editable-input">
<select class="form-control input-sm">
<option value="PARENT-CHILD">Parent-Child (1:Many)</option>
<option value="PRIMARY-SECONDARY">Primary-Secondary (1:Many)</option>
<option –value="ASSOCIATED-TO">Associated To (Many:Many)</option>
</select>
</div>
<div class="editable-buttons">
<button type="submit" class="btn btn-primary btn-sm editable-submit"><i class="glyphicon glyphicon-ok"></i></button>
<button type="button" class="btn btn-default btn-sm editable-cancel"><i class="glyphicon glyphicon-remove"></i></button>
</div>
</div>
<div class="editable-error-block help-block" style="display: none;"></div>
</div>
</form>
</div>
慕的地6264312
饮歌长啸
慕沐林林
相关分类