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

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

        <tfoot id='fv6HC'></tfoot>
        • <bdo id='fv6HC'></bdo><ul id='fv6HC'></ul>
      1. 如何处理量角器中未找到元素的异常

        时间:2023-06-15
        <tfoot id='4g895'></tfoot>
      2. <legend id='4g895'><style id='4g895'><dir id='4g895'><q id='4g895'></q></dir></style></legend>
          <bdo id='4g895'></bdo><ul id='4g895'></ul>
          <i id='4g895'><tr id='4g895'><dt id='4g895'><q id='4g895'><span id='4g895'><b id='4g895'><form id='4g895'><ins id='4g895'></ins><ul id='4g895'></ul><sub id='4g895'></sub></form><legend id='4g895'></legend><bdo id='4g895'><pre id='4g895'><center id='4g895'></center></pre></bdo></b><th id='4g895'></th></span></q></dt></tr></i><div id='4g895'><tfoot id='4g895'></tfoot><dl id='4g895'><fieldset id='4g895'></fieldset></dl></div>

                  <tbody id='4g895'></tbody>

                <small id='4g895'></small><noframes id='4g895'>

                  本文介绍了如何处理量角器中未找到元素的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  就像 Selenium webdriver 为 Java 提供了各种异常处理一样,有什么方法可以使用 Protractor 来实现.

                  Just like Selenium webdriver provides various Exception handling for Java, is there any way we can achieve same using Protractor.

                  如果我们想处理 element not found 异常,那么使用 Protractor 最好的方法是什么?

                  If we want to handle element not found exception, then what is the best way to do it using Protractor?

                  推荐答案

                  回答这个问题现在在 Protractor 的常见问题解答中

                  当命令无法完成时,WebDriver 会抛出错误 - 例如无法单击被另一个元素遮挡的元素.如果您需要重试这些操作,请尝试使用 webdriverjs-retry.如果您只想捕获错误,请这样做

                  WebDriver throws errors when commands cannot be completed - e.g. not being able to click on an element which is obscured by another element. If you need to retry these actions, try using webdriverjs-retry. If you would just like to catch the error, do so like this

                  根据您的问题改编:

                  elm.isPresent().then(function(present) {
                    /* no webdriver js errors here *
                • <i id='HE3GM'><tr id='HE3GM'><dt id='HE3GM'><q id='HE3GM'><span id='HE3GM'><b id='HE3GM'><form id='HE3GM'><ins id='HE3GM'></ins><ul id='HE3GM'></ul><sub id='HE3GM'></sub></form><legend id='HE3GM'></legend><bdo id='HE3GM'><pre id='HE3GM'><center id='HE3GM'></center></pre></bdo></b><th id='HE3GM'></th></span></q></dt></tr></i><div id='HE3GM'><tfoot id='HE3GM'></tfoot><dl id='HE3GM'><fieldset id='HE3GM'></fieldset></dl></div>
                  <tfoot id='HE3GM'></tfoot>

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

                      1. <legend id='HE3GM'><style id='HE3GM'><dir id='HE3GM'><q id='HE3GM'></q></dir></style></legend>
                          <bdo id='HE3GM'></bdo><ul id='HE3GM'></ul>

                            <tbody id='HE3GM'></tbody>