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

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

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

      1. AngularJs量角器:滑出菜单中的元素不可见

        时间:2023-10-12

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

                  <tbody id='S4t9N'></tbody>
                <tfoot id='S4t9N'></tfoot>

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

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

                1. 本文介绍了AngularJs量角器:滑出菜单中的元素不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我带着更多量角器问答回来了.因此,在尝试查找滑出菜单内的元素时,我遇到了一个问题.

                  I'm back with more Protractor Q&A. So, I am coming across an issue when trying for find an element that is inside a slide out menu.

                  html片段:

                  <div class="ng-scope" ui-view="navmenu">
                  <nav class="menu slide-menu-left ng-scope">
                    <md-content class="md-default-theme" style="display: table" ng-click="slideMenuLeft()" tabindex="0">
                      <button class="md-button md-default-theme" ng-transclude="" 
                              style="width:50%;height:72px;border-right:1px solid #ddd;border-bottom:1px solid #ddd" 
                              ng-click="checkmap()" tabindex="0">
                  

                  以下是我尝试从该菜单中获取按钮的方法:

                  Here are the ways I have tried to grab the the button out of this menu:

                  element(by.css('Button[ng-click="logoff()"]'));
                  element(by.xpath('/html/body/section/div[@class="ng-scope"]/nav[@class="menu slide-menu-left ng-scope"]/md-content/button[@ng-click="logoff()"]'));
                  

                  量角器不喜欢并继续告诉我:

                  Protractor does not like and proceeds to tell me this:

                  Stacktrace:
                    ElementNotVisibleError: element not visible
                    (Session info: chrome=40.0.2214.115)
                    (Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)
                  Command duration or timeout: 31 milliseconds
                  Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
                  

                  任何人都可以就我可能做错的事情向我提出建议吗?

                  Can anyone throw me suggestions as to what I may be doing wrong?

                  推荐答案

                  在定位并点击子菜单之前需要打开菜单:

                  You need to open up the menu before locating and clicking the submenu:

                  element(by.css('nav.menu > md-content')).click();
                  element(by.css('nav.menu > md-content > button[ng-click="logoff()"]')).click();
                  

                  您可能还需要使用 elementToBeClickable 预期条件等待子菜单变为可点​​击(需要量角器 1.7 或更高版本):

                  You may also need to use a elementToBeClickable expected condition to wait for the submenu to become clickable (needs protractor 1.7 or above):

                  var EC = protractor.ExpectedConditions;
                  var logoff = element(by.css('nav.menu > md-content > button[ng-click="logoff()"]'));
                  
                  browser.wait(EC.elementToBeClickable(logoff), 10000);
                  logoff.click();
                  

                  这篇关于AngularJs量角器:滑出菜单中的元素不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:带有量角器js的剪贴板中的文本 下一篇:在量角器中定义页面对象的规范方法

                  相关文章

                  最新文章

                  <small id='9agIE'></small><noframes id='9agIE'>

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