<i id='2vrGR'><tr id='2vrGR'><dt id='2vrGR'><q id='2vrGR'><span id='2vrGR'><b id='2vrGR'><form id='2vrGR'><ins id='2vrGR'></ins><ul id='2vrGR'></ul><sub id='2vrGR'></sub></form><legend id='2vrGR'></legend><bdo id='2vrGR'><pre id='2vrGR'><center id='2vrGR'></center></pre></bdo></b><th id='2vrGR'></th></span></q></dt></tr></i><div id='2vrGR'><tfoot id='2vrGR'></tfoot><dl id='2vrGR'><fieldset id='2vrGR'></fieldset></dl></div>

    <tfoot id='2vrGR'></tfoot>
  1. <legend id='2vrGR'><style id='2vrGR'><dir id='2vrGR'><q id='2vrGR'></q></dir></style></legend>

    1. <small id='2vrGR'></small><noframes id='2vrGR'>

        <bdo id='2vrGR'></bdo><ul id='2vrGR'></ul>
    2. 我如何在 e2e 测试 Angular Protractor 的标签中添加文

      时间:2023-10-12

    3. <i id='gHHeC'><tr id='gHHeC'><dt id='gHHeC'><q id='gHHeC'><span id='gHHeC'><b id='gHHeC'><form id='gHHeC'><ins id='gHHeC'></ins><ul id='gHHeC'></ul><sub id='gHHeC'></sub></form><legend id='gHHeC'></legend><bdo id='gHHeC'><pre id='gHHeC'><center id='gHHeC'></center></pre></bdo></b><th id='gHHeC'></th></span></q></dt></tr></i><div id='gHHeC'><tfoot id='gHHeC'></tfoot><dl id='gHHeC'><fieldset id='gHHeC'></fieldset></dl></div>

        <legend id='gHHeC'><style id='gHHeC'><dir id='gHHeC'><q id='gHHeC'></q></dir></style></legend>
          <tbody id='gHHeC'></tbody>
        1. <tfoot id='gHHeC'></tfoot>

            • <bdo id='gHHeC'></bdo><ul id='gHHeC'></ul>

              <small id='gHHeC'></small><noframes id='gHHeC'>

              1. 本文介绍了我如何在 e2e 测试 Angular Protractor 的标签中添加文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我如何在

                标签中添加内容以在量角器中进行 e2e 测试

                how i add content in

                tag for e2e testing in protractor

                <html lang="en" dir="ltr">
                 <head>
                  <body class="cke_editable cke_editable_themed cke_contents_ltr cke_show_borders" contenteditable="true" spellcheck="true">
                   <p>
                     <br type="_moz">
                   </p>
                 </body>
                </html>
                

                我试试这个,但这不起作用

                i try this but this is not working

                var p = element(by.css('.cke_editable p'));
                p.sendKeys('This is a peragraph tag');
                

                推荐答案

                首先,在这种情况下,它是可编辑的主体 - 向它发送密钥:

                First of all, it is the body that's editable in this case - send keys to it:

                var body = element(by.css('body.cke_editable'));
                body.sendKeys('This is a paragraph tag');
                

                一个更大的问题是,因为这是一个 CKeditor - 它通常嵌入在 iframe 中.这对我们来说实际上很重要——我们需要让 webdriver 知道我们想要 切换到iframe的上下文:

                A bigger problem though is that, since this is a CKeditor - it's usually embedded in an iframe. This is actually important for us - we need to let the webdriver know that we want to switch into the context of the iframe:

                browser.switchTo().frame(element(by.css("iframe.cke_wysiwyg_frame")));
                
                var body = element(by.css('body.cke_editable'));
                body.sendKeys('This is a paragraph tag');
                

                这篇关于我如何在 e2e 测试 Angular Protractor 的标签中添加文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:了解量角器对 Promise 的使用 下一篇:如何将焦点设置在我网页的某个部分然后向下滚

                相关文章

                最新文章

                    <bdo id='HeGzZ'></bdo><ul id='HeGzZ'></ul>
                  <tfoot id='HeGzZ'></tfoot>
                1. <i id='HeGzZ'><tr id='HeGzZ'><dt id='HeGzZ'><q id='HeGzZ'><span id='HeGzZ'><b id='HeGzZ'><form id='HeGzZ'><ins id='HeGzZ'></ins><ul id='HeGzZ'></ul><sub id='HeGzZ'></sub></form><legend id='HeGzZ'></legend><bdo id='HeGzZ'><pre id='HeGzZ'><center id='HeGzZ'></center></pre></bdo></b><th id='HeGzZ'></th></span></q></dt></tr></i><div id='HeGzZ'><tfoot id='HeGzZ'></tfoot><dl id='HeGzZ'><fieldset id='HeGzZ'></fieldset></dl></div>

                  1. <small id='HeGzZ'></small><noframes id='HeGzZ'>

                    <legend id='HeGzZ'><style id='HeGzZ'><dir id='HeGzZ'><q id='HeGzZ'></q></dir></style></legend>