How to keep selenium step to be keep waiting for 1 hour

Selecting a button on a page generates new window. New window keeps loading for 1 hour as it will generate files from DataBase to local. How do I keep selenium to wait until for 1 hour?? i am trying to automate this scenario. New window will have print statements after completion of db files generation in the background.

Well as we all should assume the file generations can take more or less time.

So you maybe need something more flexible, like this:

WebDriverWait wait = new WebDriverWait(webdriver, waitForElementTimeout).until(ExpectedConditions.attributeToBe(webelement, "text", expected));

this code would wait until the Statement variable, which will be printed, gets the right value

1 Like

Use following to wait for 1 hour:

int hourInSecond = 3600;
WebDriverWait wait = new WebDriverWait(WebDriver, hourInSecond);
wait.until(ExpectedConditions.elementToBeClickable(locator));

1 hour = 3600 seconds;

1 Like