小编Pri*_*nga的帖子

如何使用 WebDriver 自动化 Ace Editor(发送密钥)?

在我的应用程序中,所有查询编辑器都是 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>
Run Code Online (Sandbox Code Playgroud)

ui-automation ace-editor selenium-webdriver

5
推荐指数
1
解决办法
3223
查看次数