在我的應用程序中,所有查詢編輯器都是Ace編輯器,我需要使用WebDriver鍵入查詢。我曾嘗試使用發送密鑰,但它似乎不工作。有沒有其他方法可以將我的輸入發送給Ace編輯器並實現自動化?如何使用WebDriver自動化Ace編輯器(發送密鑰)?
下面是我的HTML代碼
<div class="" ng-show="queryType=='Spark Query'">
<pre class=" ace_editor ace-xcode">
<textarea class="ace_text-input" wrap="off" autocorrect="off" autocapitalize="off" spellcheck="false" style="opacity: 0; height: 18px; width: 7px; left: 4px; top: 0px;"/>
<div class="ace_gutter" style="display: none;">
<div class="ace_scroller" style="left: 0px; right: 0px; bottom: 0px;">
<div class="ace_content" style="margin-top: 0px; width: 659px; height: 334px; margin-left: 0px;">
<div class="ace_layer ace_print-margin-layer">
<div class="ace_layer ace_marker-layer"/>
<div class="ace_layer ace_text-layer" style="padding: 0px 4px;">
<div class="ace_layer ace_marker-layer"/>
<div class="ace_layer ace_cursor-layer ace_hidden-cursors">
</div>
</div>
有人可以請建議如何使用webDriver實現sendKeys到AceEditor – Pringa