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

  • <tfoot id='XA731'></tfoot>

      <bdo id='XA731'></bdo><ul id='XA731'></ul>
    <legend id='XA731'><style id='XA731'><dir id='XA731'><q id='XA731'></q></dir></style></legend>

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

        量角器检查元素是否不存在

        时间:2023-10-12
        <tfoot id='Xlz7h'></tfoot>

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

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

        <legend id='Xlz7h'><style id='Xlz7h'><dir id='Xlz7h'><q id='Xlz7h'></q></dir></style></legend>
            <tbody id='Xlz7h'></tbody>
            • <bdo id='Xlz7h'></bdo><ul id='Xlz7h'></ul>

                  本文介绍了量角器检查元素是否不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在基于 Angular 的网站中有一个设置可以打开和关闭下拉菜单.如果它关闭,则它不会显示在主页上.

                  I have a setting in my angular based website that turns a dropdown on and off. If it is off, then it does not show on the main page.

                  使用量角器,我需要检查开关关闭时是否不存在此元素.但是,我不应该陷入 Element Not Found Error,因为它是一组测试中的一个.我该怎么做?

                  With Protractor, I need to check to see if this element is not present when the switch is off. However, I should not be thrown into Element Not Found Error, as it is one test in a set of many. How should I do this?

                  我已经尝试过:

                  expect($$('.switch').count()).to.equal(0).and.notify(next);
                  

                  但是我收到了一个 AssertionError ......

                  But I am getting an AssertionError with this...

                  推荐答案

                  通过使用我在文档中找到的东西来解决问题:

                  Got the thing working by using something I found in the docs:

                  expect(element(by.css('.switch')).isPresent()).to.become(false).and.notify(next);
                  

                  也使用断言,所以它不会破坏 cucumberjs.

                  Also uses assertions, so it doesn't break cucumberjs.

                  这篇关于量角器检查元素是否不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Protractor e2e 测试登录重定向 下一篇:使用 Protractor 进行 Chrome 模拟测试的有效设备名称

                  相关文章

                  最新文章

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

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

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

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