• <tfoot id='xtBF8'></tfoot><legend id='xtBF8'><style id='xtBF8'><dir id='xtBF8'><q id='xtBF8'></q></dir></style></legend>
  • <small id='xtBF8'></small><noframes id='xtBF8'>

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

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

      1. org.openqa.selenium.ElementNotVisibleException:元素当前不可见,因此可能无

        org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with Command duration or timeout:(org.openqa.selenium.ElementNotVisibleException:元素当前不可见,因此可能无法与命令持续时间或超时

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

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

                  本文介绍了org.openqa.selenium.ElementNotVisibleException:元素当前不可见,因此可能无法与命令持续时间或超时交互:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的问题是硒给出了异常可见的元素.我不明白这一点,因为当我在我的机器上进行构建时!(测试建立在竹子上).

                  My problem is that selenium give the exception so visible elements. I don't understand this because when I put to build in my machine works! ( The tests build at bamboo).

                  这是一个例外:

                  org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with Command duration or timeout: 30.06 seconds Build info: version: '2.44.0', revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8', time: '2014-10-23 13:11:40' System info: host: 'N/A', ip: 'N/A', os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-52-virtual', java.version: '1.7.0_72' Session ID: 1757208d-d49e-4792-b053-e55e7300c233 Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=34.0}]
                  org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
                  Command duration or timeout: 30.06 seconds

                  代码:

                  String name;
                  String key;
                  
                  @Before
                  public void setUp() throws InterruptedException {
                  
                      driver.findElement(By.id("menu_topMenu.maintenance")).click();
                      Thread.sleep(1000);
                      driver.findElement(By.id("menu_topMenu.route")).click();
                  }
                  
                  @Test
                  public void test() throws InterruptedException {
                  
                      AddRoute addRoute = new AddRoute(driver);
                      addRoute.add();
                      name = addRoute.getName();
                      key = addRoute.getKey();
                      Thread.sleep(3000);
                      driver.findElement(By.cssSelector
                              ("#Route_btn_novo")).click();
                      driver.findElement(By.cssSelector
                              ("#Route_key > input[type="text"]")).sendKeys(key);
                      driver.findElement(By.cssSelector
                              ("#Route_description > input[type="text"]")).clear();
                      driver.findElement(By.cssSelector
                              ("#Route_description > input[type="text"]")).sendKeys(name);
                      driver.findElement(By.cssSelector
                              ("#Route_organization > div.lookUpHitArea")).click();
                      driver.findElement(By.cssSelector
                              ("#MonetUIFieldsLookupGridContainer_organization > div.slick-pane.slick-pane-top.slick-pane-left > div.slick-viewport.slick-viewport-top.slick-viewport-left > div > div:nth-child(2) > div.slick-cell.l0.r0.cell-row")).click();
                      driver.findElement(By.cssSelector
                              ("#Route_plannedCost > input")).sendKeys("10000");
                      driver.findElement(By.cssSelector
                              ("#Route_origin > div.lookUpHitArea")).click();
                      driver.findElement(By.cssSelector
                              ("#MonetUIFieldsLookupGridContainer_location > div.slick-pane.slick-pane-top.slick-pane-left > div.slick-viewport.slick-viewport-top.slick-viewport-left > div > div:nth-child(1) > div.slick-cell.l1.r1.cell-row.selected")).click();
                      driver.findElement(By.cssSelector
                              ("#Route_lastStopIsDestination > input")).click();
                      Thread.sleep(1000);
                      driver.findElement(By.cssSelector
                              ("#Route_btn_save_and_close")).click();
                      Thread.sleep(3000);
                      assertTrue("Rota existente nao validada corretamente",
                              isDisplayedByCssSelector(driver, "#form_and_grid > div > div.monetInlineAlerContainer > div"));
                  }
                  

                  }

                  我不知道该怎么办了!

                  推荐答案

                  我不确定你的整个设置是什么样子的.但是,一种常见的做法是在这种情况下使用 Selenium Grid.这个想法是拥有一个 selenium 集线器和多个从属设备(根据您的需要,可能是虚拟机),并让 CI 服务器控制从属设备来执行测试.您遇到的问题是因为 CI 服务器的行为不像您的本地机器那样.该元素不可见意味着 selenium 无法与浏览器进行交互,它不应该在 CI 上进行交互.请参阅 this 了解有关网格.这应该可以帮助您入门.

                  I am not sure how your entire set up looks like. But, a common practice is to use Selenium Grid in such case. The idea is to have a selenium hub and multiple slaves(as many as you need and may be virtual machines) and have the CI server controlling the slaves to execute the tests. The issue you are having is because of CI server is not acting like your local machine is doing. The element is not visible means selenium is not able to interact with the browser which it should not on CI. See this to explore more about the grid. This should help you to get started.

                  注意:这是从 CI 执行 selenium 测试的众多方法之一

                  这篇关于org.openqa.selenium.ElementNotVisibleException:元素当前不可见,因此可能无法与命令持续时间或超时交互:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
                  Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
                  How to convert Integer to int?(如何将整数转换为整数?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
                  Inconsistent behavior on java#39;s ==(java的行为不一致==)
                  Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)

                  <legend id='36lWn'><style id='36lWn'><dir id='36lWn'><q id='36lWn'></q></dir></style></legend>
                  <tfoot id='36lWn'></tfoot>

                    <small id='36lWn'></small><noframes id='36lWn'>

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