1. <legend id='R9N4n'><style id='R9N4n'><dir id='R9N4n'><q id='R9N4n'></q></dir></style></legend>

  2. <small id='R9N4n'></small><noframes id='R9N4n'>

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

      量角器未知错误,从 DOM 中删除属性

      时间:2023-10-12

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

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

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

            1. <tfoot id='IQZn5'></tfoot>
              • <bdo id='IQZn5'></bdo><ul id='IQZn5'></ul>
                本文介绍了量角器未知错误,从 DOM 中删除属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我是量角器的新手并试图从 DOM 中删除属性但得到未知错误",我不确定可能是什么问题

                Im new to protractor and trying to remove attribute from DOM but getting "unknown error", Im not sure what could be the problem

                我有一个带有自定义指令的简单 HTML.我正在尝试删除它以使我的测试用例通过:

                Im having a simple HTML with a custom directive.I am trying to remove that for my test cases to pass:

                <input type="text" name="rptdate" input-date placeholder="DD-MM-YYYY" data-ng-model="newPatReports.reportDate" />
                

                我运行的命令是:

                browser.executeScript( 'document.getElementsByName("rptdate").removeAttribute("input-date")' );
                browser.driver.findElement(protractor.By.name('rptdate')).removeAttr("input-date");
                browser.executeScript('document.querySelector("input[name='rptdate']").removeAttribute("input-date");');
                

                但他们都没有帮助.

                推荐答案

                使用 Protractor 定位元素,然后将 Web Element 传递给脚本:

                Locate the element with Protractor and then pass the Web Element into the script:

                var elm = element(by.name("rptdate"));
                
                browser.executeScript('arguments[0].removeAttribute("input-date");', elm.getWebElement());
                

                这篇关于量角器未知错误,从 DOM 中删除属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Angularjs,使用 angular-recaptcha 进行 e2e 测试 下一篇:了解量角器对 Promise 的使用

                相关文章

                最新文章

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

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

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