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

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

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

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

        硒动态生长表

        时间:2023-09-30
            • <bdo id='H1bfy'></bdo><ul id='H1bfy'></ul>
                <tbody id='H1bfy'></tbody>
              <legend id='H1bfy'><style id='H1bfy'><dir id='H1bfy'><q id='H1bfy'></q></dir></style></legend>

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

                <tfoot id='H1bfy'></tfoot>

                  <i id='H1bfy'><tr id='H1bfy'><dt id='H1bfy'><q id='H1bfy'><span id='H1bfy'><b id='H1bfy'><form id='H1bfy'><ins id='H1bfy'></ins><ul id='H1bfy'></ul><sub id='H1bfy'></sub></form><legend id='H1bfy'></legend><bdo id='H1bfy'><pre id='H1bfy'><center id='H1bfy'></center></pre></bdo></b><th id='H1bfy'></th></span></q></dt></tr></i><div id='H1bfy'><tfoot id='H1bfy'></tfoot><dl id='H1bfy'><fieldset id='H1bfy'></fieldset></dl></div>
                  本文介绍了硒动态生长表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在使用 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()]")).
                  

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

                  上一篇:我们如何测试我们的 Java UI? 下一篇:Docker 图像 - 类型.修身vs修身弹力vs弹力vs高山

                  相关文章

                  最新文章

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

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

                      <bdo id='AFv90'></bdo><ul id='AFv90'></ul>
                    1. <tfoot id='AFv90'></tfoot>

                    2. <legend id='AFv90'><style id='AFv90'><dir id='AFv90'><q id='AFv90'></q></dir></style></legend>