<tfoot id='2lKiM'></tfoot>

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

        <small id='2lKiM'></small><noframes id='2lKiM'>

        量角器“by.css()"vs“$()"美元符号与“$$()"'亮闪闪'

        时间:2023-06-15
          <tbody id='9fVUr'></tbody>
          <bdo id='9fVUr'></bdo><ul id='9fVUr'></ul>

        • <legend id='9fVUr'><style id='9fVUr'><dir id='9fVUr'><q id='9fVUr'></q></dir></style></legend>

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

                  <tfoot id='9fVUr'></tfoot>
                  本文介绍了量角器“by.css()"vs“$()"美元符号与“$$()"'亮闪闪'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我不太明白 $ 和 $$ 命令的用途.我认为它们只是by.css"的替代品,但为什么要使用 $$?

                  I don't really understand what the $ and $$ commands are for. I thought they are just a replacement for 'by.css' but why the $$?

                  <element id = "eId"></element>
                  

                  我认为,鉴于上述情况,这些将是等效的:

                  I thought, that given the above, these would be equivalent:

                  element(by.css('#eId'));
                  

                  element($('#eId'));
                  

                  但是,第一个有效,第二个无效.为什么,这三者有什么区别?

                  However, the first one works and the second doesn't. Why, what's the difference between the three?

                  docs 帮助不大.他们似乎暗示$"仅用于链接,例如element(by.css('#eId')).element($('#childId')); 或选择第一个元素,然后选择第一个元素内的第二个元素."但是,我已经看到使用 $ 来选择第一个元素的示例.

                  The docs are of little help. They seem to imply that "$" is for chaining only, e.g. element(by.css('#eId')).element($('#childId')); or "Select the first element, and then select the second element within the first element.' However, I have seen examples with $ being used to select the first element.

                  不管怎样,这三个(by.css、$ 和 $$)之间有什么区别?"的文字很多.

                  Anyway, that's a lot of text for "What are the differences between the three (by.css, $, and $$)?"

                  推荐答案

                  $$$ 只是方便的快捷方式.

                  $ and $$ are just convenient shortcuts.

                  $("selector")element(by.css("selector")) 的替代品.

                  $$("selector")element.all(by.css("selector")) 的替代品.

                  仅供参考,引用自 源代码:p>

                  FYI, quote from the source code:

                  ElementFinder.prototype.$ = function(selector) {
                    return this.element(webdriver.By.css(selector));
                  };
                  
                  ElementArrayFinder.prototype.$$ = function(selector) {
                    return this.all(webdriver.By.css(selector));
                  };
                  

                  以及最初实现它的实际提交.

                  这篇关于量角器“by.css()"vs“$()"美元符号与“$$()"'亮闪闪'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:什么是与量角器一起运行的好的无头浏览器? 下一篇:量角器 - 在哪里使用 browser.waitForAngular()

                  相关文章

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

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

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

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