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

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

      1. <small id='w3PJE'></small><noframes id='w3PJE'>

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

        AngularJs Protractor: Element in slide out menu not visible(AngularJs量角器:滑出菜单中的元素不可见)

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

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

                  <legend id='hhIX4'><style id='hhIX4'><dir id='hhIX4'><q id='hhIX4'></q></dir></style></legend>
                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量角器:滑出菜单中的元素不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What are valid deviceNames for Chrome emulation testing with Protractor?(使用 Protractor 进行 Chrome 模拟测试的有效设备名称是什么?)
                  Protractor Check if Element Does Not Exist(量角器检查元素是否不存在)
                  Protractor e2e Tests Login Redirection(Protractor e2e 测试登录重定向)
                  Explain about async/ await in Protractor(解释 Protractor 中的 async/await)
                  Protractor browser.wait doesn#39;t wait(量角器 browser.wait 不等待)
                  How to use Protractor with Angular 2?(如何在 Angular 2 中使用量角器?)

                        <tbody id='vo5xi'></tbody>

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

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

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