久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

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

        • <bdo id='R79lF'></bdo><ul id='R79lF'></ul>
      1. 量角器中的計數()與長度

        count() vs length in Protractor(量角器中的計數()與長度)

          <legend id='beN95'><style id='beN95'><dir id='beN95'><q id='beN95'></q></dir></style></legend><tfoot id='beN95'></tfoot>

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

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

                  本文介紹了量角器中的計數()與長度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  根據文檔,有兩種方法可以獲取 ElementArrayFinder 中有多少元素(element.all() 調用的結果):

                  • $$(".myclass").length,記錄在 這里:
                  <塊引用>

                  ...數組的length等于ElementArrayFinder找到的元素的length,每個結果代表執行的結果對元素的操作.

                  • $$(".myclass").count(),記錄在 這里:
                  <塊引用>

                  計算ElementArrayFinder所代表的元素個數.

                  這兩種方法有什么區別,應該首選哪一種?

                  解決方案


                  $$(".myclass").length

                  需要解決 promise 以正確獲取元素的長度.

                  //工作$$(".myclass").then(function(items){項目長度;});//不工作$$(".myclass").length;

                  <小時>

                  $$(".myclass").count()

                  $$('.myclass').length 的包裝器,它本身就是一個 Promise,不需要像 .length 那樣解析 Promise

                  $$(".myclass").count();

                  <小時><塊引用>

                  應該首選哪一個?

                  除非在定位$$(".myclass").then(function(items){...})時涉及到一些復雜的業務,那么items.length 將提供更好的性能.

                  否則 $$(".myclass").count() 應始終使用.

                  According to the documentation, there are 2 ways to get how many elements are inside the ElementArrayFinder (the result of element.all() call):

                  • $$(".myclass").length, documented here:

                  ...the array has length equal to the length of the elements found by the ElementArrayFinder and each result represents the result of performing the action on the element.

                  • $$(".myclass").count(), documented here:

                  Count the number of elements represented by the ElementArrayFinder.

                  What is the difference between these two methods and which one should be preferred?

                  解決方案


                  $$(".myclass").length

                  Need to resolve the promise to get the length of element correctly.

                  // WORK
                  $$(".myclass").then(function(items){
                    items.length;
                  });
                  
                  // DOES NOT WORK
                  $$(".myclass").length; 
                  


                  $$(".myclass").count()

                  A wrapper for $$('.myclass').length which being a promise itself and doesn't require to resolve promise like .length

                  $$(".myclass").count(); 
                  


                  which one should be preferred?

                  Unless there some complex business when locating $$(".myclass") and .then(function(items){...}) involved then items.length will give better performance.

                  Otherwise $$(".myclass").count() should always be used.

                  這篇關于量角器中的計數()與長度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                    <bdo id='4nRG8'></bdo><ul id='4nRG8'></ul>

                    1. <i id='4nRG8'><tr id='4nRG8'><dt id='4nRG8'><q id='4nRG8'><span id='4nRG8'><b id='4nRG8'><form id='4nRG8'><ins id='4nRG8'></ins><ul id='4nRG8'></ul><sub id='4nRG8'></sub></form><legend id='4nRG8'></legend><bdo id='4nRG8'><pre id='4nRG8'><center id='4nRG8'></center></pre></bdo></b><th id='4nRG8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4nRG8'><tfoot id='4nRG8'></tfoot><dl id='4nRG8'><fieldset id='4nRG8'></fieldset></dl></div>
                      <legend id='4nRG8'><style id='4nRG8'><dir id='4nRG8'><q id='4nRG8'></q></dir></style></legend>
                        <tbody id='4nRG8'></tbody>

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

                      1. <tfoot id='4nRG8'></tfoot>
                            主站蜘蛛池模板: 国产成人精品久久二区二区91 | 日日爱夜夜操 | 国产一区www| .国产精品成人自产拍在线观看6 | 欧美精品福利视频 | 亚洲日本一区二区 | 国产精品欧美一区二区 | 色橹橹欧美在线观看视频高清 | 色吊丝2288sds中文字幕 | 一区二区三区视频在线观看 | 欧美日韩专区 | 精品在线99 | 国产精品一区在线 | 美国黄色毛片 | 国产精品日韩一区二区 | 久久精品色欧美aⅴ一区二区 | 国产精品国产三级国产aⅴ无密码 | h视频免费在线观看 | sese视频在线观看 | 亚洲一区中文 | 97av| 粉嫩一区二区三区性色av | 亚洲精品久久久久久国产精华液 | 天天草夜夜骑 | 午夜精品久久久久久久久久久久 | 免费一级做a爰片久久毛片潮喷 | 91成人午夜性a一级毛片 | 久久神马 | 欧美舔穴| 日本在线一区二区三区 | 成人一级黄色毛片 | 91精品一区二区三区久久久久 | 激情五月婷婷丁香 | 久久国产日本 | 亚洲欧美在线观看 | 成人国产精品免费观看视频 | 欧美日韩亚洲视频 | 欧美亚洲免费 | 一区二区三区四区电影 | 欧美a∨| 成人av一区二区三区 |