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

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

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

        <tfoot id='ixMak'></tfoot>

        我们如何获得使用 Selenium WebDriver 加载页面的准确时间?

        How can we get exact time to load a page using Selenium WebDriver?(我们如何获得使用 Selenium WebDriver 加载页面的准确时间?)

          <tfoot id='ABYwD'></tfoot>
        • <legend id='ABYwD'><style id='ABYwD'><dir id='ABYwD'><q id='ABYwD'></q></dir></style></legend>
            <bdo id='ABYwD'></bdo><ul id='ABYwD'></ul>

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

                  <tbody id='ABYwD'></tbody>
                <i id='ABYwD'><tr id='ABYwD'><dt id='ABYwD'><q id='ABYwD'><span id='ABYwD'><b id='ABYwD'><form id='ABYwD'><ins id='ABYwD'></ins><ul id='ABYwD'></ul><sub id='ABYwD'></sub></form><legend id='ABYwD'></legend><bdo id='ABYwD'><pre id='ABYwD'><center id='ABYwD'></center></pre></bdo></b><th id='ABYwD'></th></span></q></dt></tr></i><div id='ABYwD'><tfoot id='ABYwD'></tfoot><dl id='ABYwD'><fieldset id='ABYwD'></fieldset></dl></div>
                1. 本文介绍了我们如何获得使用 Selenium WebDriver 加载页面的准确时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我们如何获得使用 Selenium WebDriver 加载页面的准确时间?

                  How can we get exact time to load a page using Selenium WebDriver?

                  我们使用 Thread.sleep

                  We use Thread.sleep

                  我们使用隐式等待

                  我们使用 WebDriverWait

                  we use WebDriverWait

                  但是我们如何才能获得使用 Selenium WebDriver 加载页面的准确时间呢?

                  but How can we get exact time to load a page using Selenium WebDriver?

                  推荐答案

                  如果您想了解使用 Selenium WebDriver(又名 Selenium 2)完全加载页面需要多长时间.

                  If you are trying to find out how much time does it take to load a page completely using Selenium WebDriver (a.k.a Selenium 2).

                  通常,WebDriver 只有在页面完全加载后才会将控制权返回给您的代码.

                  Normally WebDriver should return control to your code only after the page has loaded completely.

                  因此,以下 Selenium Java 代码可能会帮助您找到页面加载时间 -

                  So the following Selenium Java code might help you to find the time for a page load -

                  long start = System.currentTimeMillis();
                  
                  driver.get("Some url");
                  
                  long finish = System.currentTimeMillis();
                  long totalTime = finish - start; 
                  System.out.println("Total Time for page load - "+totalTime); 
                  

                  如果这不起作用,那么您将不得不等到页面上显示某些元素 -

                  If this does not work then you will have to wait till some element is displayed on the page -

                   long start = System.currentTimeMillis();
                  
                  driver.get("Some url");
                  
                  WebElement ele = driver.findElement(By.id("ID of some element on the page which will load"));
                  long finish = System.currentTimeMillis();
                  long totalTime = finish - start; 
                  System.out.println("Total Time for page load - "+totalTime); 
                  

                  这篇关于我们如何获得使用 Selenium WebDriver 加载页面的准确时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

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

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

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

                        1. <tfoot id='n16u4'></tfoot>

                              <tbody id='n16u4'></tbody>