• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Selenium Timeout Before finished downloading file|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Selenium Timeout Before finished downloading file|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosSelenium Timeout Before finished do…
sp_PrintTopic sp_TopicIcon
Selenium Timeout Before finished downloading file
Avatar
Phillip Kruchten

New Member
Members
Level 0
Forum Posts: 1
Member Since:
June 30, 2022
sp_UserOfflineSmall Offline
1
June 30, 2022 - 5:23 am
sp_Permalink sp_Print

I am using the Selenium ChromeDriver for the first time to automate a chrome web page.  I am using VBA in an excel spreadsheet to do the macro.

The Philip Treacy video https://www.myonlinetraininghu.....ling-forms is very helpful. 

If I filter the data enough (so the downloaded file does not take more than 60 seconds to be created), your recommended command for clicking the button works fine:

Driver.FindElementByClass("button-content").Click

After doing some research, I altered the command to include a longer timeout so now it is this

Driver.FindElementByClass("button-content", timeout:=480000).Click

The problem I am having is that there is a delay after clicking a button on the webpage (could be 2 minutes or more) before the downloaded file finished downloading. 

After 60 seconds I am getting a Microsoft Visual Basic Run-Time error "21": Timeout error.  Timeout: timed out receiving message from rendered: 60:000. (Session info: Chrome=103.0.5060.53.   Driver Info: Crimedriver=103.0.5060.53 (a1711811edd74ff1cf2150f36ffa3b0dae40b17f-refs/branch-heads/506  NT 10.0.19044 x86_64)

It seems that even though I am adding a explicit wait of 480 seconds (8 minutes) after hitting the click button, that I am actually only given 60 seconds before it times out.  Am I writing the timeout wrong?  Is there a better way to force Selenium to wait longer before proceeding.  By the way, nothing changes on the screen after it is done with the download.  I can look for the downloaded file to see if it exists, but don't know how to write the click method in the way that it waits until the downloaded file is created before moving on.

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
July 3, 2022 - 2:52 pm
sp_Permalink sp_Print

Hi Phillip,

There are multiple ways  to set  a timeout:

driver.Timeouts.ImplicitWait = 5000 ' 5 seconds

As well as individually :

driver.FindElementById("id", timeout:=10000).Click  ' implicitly wait of 10sec
driver.FindElementById("id", timeout:=0).Click  ' no implicit waiting

To set the timeout for the server that runs the browser:

driver.Timeouts.Server = 120000 ' 2 mins

source: https://stackoverflow.com/questions/32348486/how-to-make-selenium-wait-for-the-page-to-fully-load-in-selenium-wrapper-for-e

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 11
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 215
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Ngoc Qui Nguyen
Clement Mansfield
Rose .
Bindu Menon
Baruch Zemer
Forum Stats:
Groups: 3
Forums: 24
Topics: 6352
Posts: 27779

 

Member Stats:
Guest Posters: 49
Members: 32319
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.