<bdo id='PSKZw'></bdo><ul id='PSKZw'></ul>

  • <tfoot id='PSKZw'></tfoot>
  • <small id='PSKZw'></small><noframes id='PSKZw'>

      <legend id='PSKZw'><style id='PSKZw'><dir id='PSKZw'><q id='PSKZw'></q></dir></style></legend>
      <i id='PSKZw'><tr id='PSKZw'><dt id='PSKZw'><q id='PSKZw'><span id='PSKZw'><b id='PSKZw'><form id='PSKZw'><ins id='PSKZw'></ins><ul id='PSKZw'></ul><sub id='PSKZw'></sub></form><legend id='PSKZw'></legend><bdo id='PSKZw'><pre id='PSKZw'><center id='PSKZw'></center></pre></bdo></b><th id='PSKZw'></th></span></q></dt></tr></i><div id='PSKZw'><tfoot id='PSKZw'></tfoot><dl id='PSKZw'><fieldset id='PSKZw'></fieldset></dl></div>
      1. 我如何在 e2e 测试 Angular Protractor 的标签中添加文本

        时间:2023-06-15

          <tbody id='306lM'></tbody>

          <bdo id='306lM'></bdo><ul id='306lM'></ul>
          <tfoot id='306lM'></tfoot>
          <legend id='306lM'><style id='306lM'><dir id='306lM'><q id='306lM'></q></dir></style></legend>

                • <small id='306lM'></small><noframes id='306lM'>

                  <i id='306lM'><tr id='306lM'><dt id='306lM'><q id='306lM'><span id='306lM'><b id='306lM'><form id='306lM'><ins id='306lM'></ins><ul id='306lM'></ul><sub id='306lM'></sub></form><legend id='306lM'></legend><bdo id='306lM'><pre id='306lM'><center id='306lM'></center></pre></bdo></b><th id='306lM'></th></span></q></dt></tr></i><div id='306lM'><tfoot id='306lM'></tfoot><dl id='306lM'><fieldset id='306lM'></fieldset></dl></div>
                • 本文介绍了我如何在 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 的标签中添加文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文章

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

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