我正在尝试操作的 HTML:
<select id="GlobalDateTimeDropDown" class="combo"
onchange="CalculateGlobalDateTime('Time',this.value)" name="GlobalDateTimeDropDown">
<option value="+5.5" selected="selected"> … </option>
<option value="+12"> … </option>
<option value="+8"> … </option>
<option value="+2"> … </option>
</select>
<input id="GlobalDateTimeText" class="combo" type="text" name="GlobalDateTimeText" value="" style="width:215px;padding:2px;" readonly="readonly"></input>
Java 代码:
WebElement values=driver.findElement(By.id("GlobalDateTimeText")).getAttribute("Value");
System.out.println(values);
输出:空白