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

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

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

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

        <tfoot id='IX4Ll'></tfoot>

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

        时间:2023-10-12
          <tbody id='z0qZD'></tbody>

          <tfoot id='z0qZD'></tfoot>
        • <legend id='z0qZD'><style id='z0qZD'><dir id='z0qZD'><q id='z0qZD'></q></dir></style></legend>
            <bdo id='z0qZD'></bdo><ul id='z0qZD'></ul>

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

                • 本文介绍了量角器“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“$()"美元符号与“$$()"'亮闪闪'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                  相关文章

                  最新文章

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

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

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