If you are looking to make a Web Page
wait for 15 minutes, Thread.sleep();
or WebDriverWait
are not the intended ways. To make the Web Page
wait you have to inject Javascript
within the Web Browser
As you tried Thread.sleep()
and WebDriverWait
, here are a few details :
Thread.sleep()
: Is a Java
based method from Thread Class
which holds any further execution of a thread for the specified amount of time.
WebDriverWait
: Is a Selenium
based Class
which extends org.openqa.selenium.support.ui.FluentWait<WebDriver>
and is a specialization of FluentWait
that uses WebDriver
instances and is invoked over WebElements
to attain a certain characteristics over a period of timespan.
From your question, I am not sure about the problem you are facing with Thread.sleep();
or WebDriverWait
but Thread.sleep();
seems works fine for 15 minutes
as follows :
Sample Program :
package demo;
public class SLEEP
{
public static void main(String[] args) throws InterruptedException
{
System.out.println("Program Started");
Thread.sleep(1000*60*1);
System.out.println("Program Ended");
}
}
Console Output :
Program Started
Program Ended
Note : However while working with Selenium
, Thread.sleep();
should be avoided as it degrades the Test Performance
. Instead we must use ExpectedConditions
with a proper method from this list
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…