• <legend id='tjA9W'><style id='tjA9W'><dir id='tjA9W'><q id='tjA9W'></q></dir></style></legend>

  • <tfoot id='tjA9W'></tfoot>
          <bdo id='tjA9W'></bdo><ul id='tjA9W'></ul>

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

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

        硒动态生长表

        selenium dynamic growing table(硒动态生长表)

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

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

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

                <tbody id='UKT2F'></tbody>
                1. 本文介绍了硒动态生长表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在使用 selenium 处理动态增长表时遇到了一些麻烦.快速总结一下,在我的网络应用程序中,我有一个包含 30 个项目的表格,但它只显示前 20 个项目,我们必须向下滚动才能显示其余项目.而且我不知道如何在不向下滚动的情况下获取第 26 个(例如)项目.

                  I have some troubles to handle dynamic growing table with selenium. To sum up quickly, on my web app I have a table with 30 items but it only displays the twenty first items and we have to scroll down to display the rest. And I don't know how to get the 26th (for example) items without scrolling down.

                  我的 HTML:

                  <table id="tableID" tabindex="0" aria-multiselectable="true" role="grid">
                      <thead>
                      <tbody id="tableID-tblBody">
                          <tr id="item1" role="row" tabindex="-1">
                          <tr id="item2" role="row" tabindex="-1">
                          [... 17 more]
                          <tr id="item20" role="row" tabindex="-1">
                      </tbody>
                  </table>
                  

                  滚动后:

                  <table id="tableID" tabindex="0" aria-multiselectable="true" role="grid">
                      <thead>
                      <tbody id="tableID-tblBody">
                          <tr id="item1" role="row" tabindex="-1">
                          <tr id="item2" role="row" tabindex="-1">
                          [... 27 more]
                          <tr id="item30" role="row" tabindex="-1">
                      </tbody>
                  </table>
                  

                  如果有人可以帮助我,那就太好了^^
                  谢谢!

                  If someone could help me it would be great ^^
                  Thanks!

                  推荐答案

                  我会滚动到表中最后一行的视图(如果需要多次,直到获得所需的行数).为此,我将通过 executeScript() 使用 scrollIntoView():

                  JavascriptExecutor jse = (JavascriptExecutor) driver;
                  jse.executeScript("arguments[0].scrollIntoView();", element);
                  

                  其中元素:

                  WebElement element = driver.findElements(By.xpath("//table[@id = 'tableID']//tr[last()]")).
                  

                  这篇关于硒动态生长表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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?)
                      <bdo id='zBkU9'></bdo><ul id='zBkU9'></ul>

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

                          <legend id='zBkU9'><style id='zBkU9'><dir id='zBkU9'><q id='zBkU9'></q></dir></style></legend>
                          <tfoot id='zBkU9'></tfoot>

                            <tbody id='zBkU9'></tbody>
                        1. <small id='zBkU9'></small><noframes id='zBkU9'>