0
如何從下拉菜單中選擇使用selenium web驅動程序與java的元素?
<div class="select-dropdown-icon"
\t ng-mousedown="onDropdownBtnMousedown()"></div>
<div class="select-dropdown" ng-click="onDropdownClick($event)"
\t style="display: block;">
\t <div class="select-contents-container ng-isolate-scope"
\t \t kt-scrollpane="" on-infinite-scroll="onInfiniteScroll()"
\t \t ng-transclude="">
\t \t <kt-select-option value="off_duty" class="ng-scope ng-isolate-scope">
\t \t \t <div class="select-option-container select-option-highlighted"
\t \t \t \t ng-mouseenter="onMouseenter()" ng-click="onClick()"
\t \t \t \t ng-class="{'select-option-highlighted': option.highlighted,'select-option-selected': option.selected,'select-option-hidden': !option.visible,'select-option-new': option.newValue}"
\t \t \t \t ng-transclude="" style="">
\t \t \t \t <span class="ng-scope">Off Duty</span>
\t \t \t </div>
\t \t </kt-select-option>
\t \t <kt-select-option value="sleeper" class="ng-scope ng-isolate-scope">
\t \t \t <div class="select-option-container select-option-selected"
\t \t \t \t ng-mouseenter="onMouseenter()" ng-click="onClick()"
\t \t \t \t ng-class="{'select-option-highlighted': option.highlighted,'select-option-selected': option.selected,'select-option-hidden': !option.visible,'select-option-new': option.newValue}"
\t \t \t \t ng-transclude="">
\t \t \t \t <span class="ng-scope">Sleeper</span>
\t \t \t </div>
\t \t </kt-select-option>
\t \t <!-- ngIf: !logSuggestions.log.isEldEnabled -->
\t \t <kt-select-option value="driving"
\t \t \t ng-if="!logSuggestions.log.isEldEnabled"
\t \t \t class="ng-scope ng-isolate-scope">
\t \t \t <div class="select-option-container" ng-mouseenter="onMouseenter()"
\t \t \t \t ng-click="onClick()"
\t \t \t \t ng-class="{'select-option-highlighted': option.highlighted,'select-option-selected': option.selected,'select-option-hidden': !option.visible,'select-option-new': option.newValue}"
\t \t \t \t ng-transclude="" style="">
\t \t \t \t <span class="ng-scope">Driving</span>
\t \t \t </div>
\t \t </kt-select-option>
\t \t <!-- end ngIf: !logSuggestions.log.isEldEnabled -->
\t \t <kt-select-option value="on_duty" class="ng-scope ng-isolate-scope">
\t \t \t <div class="select-option-container" ng-mouseenter="onMouseenter()"
\t \t \t \t ng-click="onClick()"
\t \t \t \t ng-class="{'select-option-highlighted': option.highlighted,'select-option-selected': option.selected,'select-option-hidden': !option.visible,'select-option-new': option.newValue}"
\t \t \t \t ng-transclude="" style="">
\t \t \t \t <span class="ng-scope">On Duty</span>
\t \t \t </div>
\t \t </kt-select-option>
\t </div>
</div>
請檢查代碼,讓我知道如何訪問下拉菜單並選擇一個元素。元素是「值班」「臥鋪」「下班」
由於html只顯示單詞** driving **。沒有任何下拉菜單。你能分享一些關於HTML的更多細節嗎?問題究竟在哪裏呢? – MKay
我編輯了HTML,你可以請看看。我是新來的HTML和硒,所以我有問題訪問主下拉菜單,並選擇「值班」「臥鋪」「值班」任何一個選項中的任何一個,我想選擇以下任何選項。@ mk08 – Shah
有在編輯中缺少某些東西。你可以分享網址嗎? – MKay