我有一个网页用Angular moment picker来显示时间。使用Selenium and Python我想断言在选择器的输入字段中设置了一个特定的时间。你知道吗
我尝试使用assert '13:19' in driver.page_source
检查时间是否出现在页面源代码中,但由于DOM中没有包含时间值,因此该语句失败。你知道吗
如何从Selenium with Python脚本访问输入字段的这个值?你知道吗
这是选取器的HTML:
<input type="text" id="observation-timedate" ng-disabled="readOnly"
ng-class="{'time-picker-timeDate': !readOnly}" readonly="true"
class="input-block-level ng-valid ng-isolate-scope moment-picker-input
ng-valid-min-date ng-valid-max-date time-picker-timeDate ng-not-empty
ng-dirty ng-valid-parse ng-touched"
ng-model="action.observationTime" format="LT"
moment-picker="observationTimeDate"
tabindex="0"
aria-invalid="false"
style="">
我只能使用JavaScript访问时间值:
相关问题 更多 >
编程相关推荐