Questions tagged [pageloadtimeout]

pageLoadTimeout() sets the amount of time to wait for a page load to complete before throwing a TimeoutException.

pageLoadTimeout()

pageLoadTimeout() sets the amount of time to wait for a page load to complete before throwing a TimeoutException. If the timeout is negative, page loads can be indefinite.

Implementation

  • Java:

    driver.manage().timeouts().pageLoadTimeout(2, TimeUnit.SECONDS);
    
  • Python:

    driver.set_page_load_timeout(2)
    
15 questions
10
votes
1 answer

How to set the timeout of 'driver.get' for python selenium 3.8.0?

In selenium tests, you open a webpage using from selenium import webdriver driver = webdriver.Firefox() driver.get("whateverpage.org.com") How can I set the timeout of this command for selenium version 3.8.0 and python 2.7.12?
Alex
  • 41,580
  • 88
  • 260
  • 469
5
votes
1 answer

What does Selenium .set_script_timeout(n) do and how is it different from driver.set_page_load_timeout(n)?

In context of python selenium, I don't quite understand the exact difference of driver.set_page_load_timeout(n) VS. driver.set_script_timeout(n). Both seem to be used interchangeable to set a timeout to load an URL via driver.get(URL), but sometimes…
sudonym
  • 3,788
  • 4
  • 36
  • 61
5
votes
2 answers

pageLoadTimeout in Selenium not working

I am using below code using selenium in Java. I am adding pageLoadTimeout of 4 seconds, however, the driver continues to wait till the complete page is loaded. Any help? System.setProperty("webdriver.gecko.driver", System.getProperty("user.home") +…
2
votes
2 answers

pageLoadTimeout is not working in Selenium - Java

I am testing a website in linux host.The page i am accessing loads infinitely so I am trying to set pageLoadTimeout for selenium. Firefox is triggered correctly but URL is not loading/navigating/added in url bar.just blank firefox window.I am not…
Jeya Kumar
  • 1,002
  • 1
  • 13
  • 36
1
vote
1 answer

How to force Selenium to refresh if the website takes too much time to load

Here's my code: from selenium import webdriver import time browser = webdriver.Edge() st1 = time.time() browser.get("http://app1.helwan.edu.eg/Commerce/HasasnUpMlist.asp") et1 = time.time() el1 = et1-st1 print(f"Elapsed Time is: {el1} Seconds") #…
1
vote
1 answer

How to stop test if page taking too long to load in selenium python

I'm testing a website and all is good with me except when the page is taking too much time then selenium keeps on searching for the element. I've tried to use driver.set_page_load_timeout(5) but still keeps on loading forever. Here is the code: from…
1
vote
1 answer

Unable to catch TimeOutException from pageLoadTimeout and refresh page using selenium Java FireFox Driver

I have an issue with Selenium Firefox Driver where sometimes a google ad of some kind gets stuck loading. I can get by this by simply clicking the refresh button and the page will fully load, I can read the data I need and move onto the next page.…
1
vote
3 answers

How to make selenium to reload the desired url if it takes too long loading

I want selenium to force the browser to reload the page which it is loading if the loading process takes too long. From StackOverflow I have that this code new WebDriverWait(driver, 30).until((ExpectedCondition) wd -> ((JavascriptExecutor)…
assembler
  • 3,098
  • 12
  • 43
  • 84
1
vote
2 answers

Make Selenium continue after a timeout error

I have a code that returns the title of a list of websites. Sometimes, a website takes an absurd amount of time to load, so when that happens, a timeout error prompts. I'd like to make it so that when such an error happens, the program continues…
WeekSky
  • 55
  • 1
  • 9
0
votes
4 answers

How to close the chrome browser right after 20 seconds handling the exception errors?

I am using this code with ChromeDriver and Chrome browser: driver.manage().timeouts().pageLoadTimeout(Duration.ofSeconds(20)); Thread.sleep(20000); driver.quit(); Then webpage keeps loading more than 20 seconds and closing with…
0
votes
1 answer

Best way to deal with slow pageloads after GET using Selenium

What is the best way to deal with driver->get(URL) and slow page load? I basically have a for loop that runs 3 times at most. Within that loop, I have a try/catch block. In the try block, it loads the page with get OR…
Rick
  • 806
  • 7
  • 15
0
votes
1 answer

Wait until element is clickable does not timeout correctly

I'm having some problem handling timeouts as it doesn't seem to be working in every situation. I have defined the timeout as follows: wait = new FluentWait(driver) .withTimeout(Duration.ofSeconds(60)) …
0
votes
1 answer

How to retrieve the page load timeout through Selenium and Python

Is there any method in Python + Selenium for retrieving the webdriver's current page load timeout? I know to use set_page_load_timeout() and examining the Chromedriver logs shows that this modified its internal state so I am wondering if there's way…
-1
votes
2 answers

Cypress cy.visit doesn't load a website, Timed out after waiting

I have no previous experience working with Cypress and i'm stuck on such simple problem - cypress can't reach the united.com website. Any other page opens easily. Any suggestions? visit https://www.united.com/en/us/ CypressError Timed out after…
user16324008
  • 1
  • 1
  • 2
-3
votes
3 answers

Visiting tutorialspoint with cypress keeps waiting for the page to load

If you try cy.visit('/') with a baseURL of https://www.tutorialspoint.com/html/index.htm you'll see that the viewport doesn't resemble the website at all: NOTE: seems like there's a difference between using baseURL or you just the full URL inside…
user3303019
  • 142
  • 1
  • 11