2

ng-tags-input を追加した Web ページのテストを自動化しようとしています。Selenium Webdriver を使用して ng-tags-input にタグを追加するのに問題があります。Selenium は要素を見つけますが、sendKeys() 関数はそれにテキストを追加しません。

セレンコード (v. 2.49.0):

 driver.findElement(By.id("tags")).sendKeys("test, one, two, three");

HTML:

 <tags-input ng-model="tempTags" id="tags" ng-model-options="{ getterSetter: true }" on-tag-added="convertToTagString()" on-tag-removed="convertToTagString()"></tags-input>

最終的な HTML:

<tags-input ng-model="tempTags" id="tags" ng-model-options="{ getterSetter: true }" on-tag-added="convertToTagString()" on-tag-removed="convertToTagString()" class="ng-pristine ng-valid ng-isolate-scope ng-valid-max-tags ng-valid-min-tags ng-valid-leftover-text ng-touched">
<div class="host" tabindex="-1" ng-click="eventHandlers.host.click()" ti-transclude-append="">
  <div class="tags" ng-class="{focused: hasFocus}">
     <ul class="tag-list">
        <!-- ngRepeat: tag in tagList.items track by track(tag) -->
     </ul>
     <input class="input ng-valid ng-touched ng-dirty ng-valid-parse" autocomplete="off" ng-model="newTag.text" ng-model-options="{getterSetter: true}" ng-keydown="eventHandlers.input.keydown($event)" ng-focus="eventHandlers.input.focus($event)" ng-blur="eventHandlers.input.blur($event)" ng-paste="eventHandlers.input.paste($event)" ng-trim="false" ng-class="{'invalid-tag': newTag.invalid}" ng-disabled="disabled" ti-bind-attrs="{type: options.type, placeholder: options.placeholder, tabindex: options.tabindex, spellcheck: options.spellcheck}" ti-autosize="" type="text" placeholder="Add a tag" spellcheck="true" style="width: 69px;"><span class="input" style="visibility: hidden; width: auto; white-space: pre; display: none;">Add a tag</span>
  </div>
</div>
</tags-input>
4

1 に答える 1