Waiting for Download Option

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
adar601278
Newbie
Posts: 1
Joined: Mon Nov 22, 2021 4:40 am

Waiting for Download Option

Post by adar601278 » Mon Nov 22, 2021 4:47 am

Hi Folks
I am wondering how do I factor in either a wait option or until option to click on the download hyper text.
I can't really factor in 'wait' as the time depends on how many transactions for the day, so it could run quicker or in my case slower.
There is a value that changes from "Processing" to "Download" but how do I tell Macro Scheduler to keep looking until this changes and then progress to the next function?{

Looking forward to your reply

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Waiting for Download Option

Post by Dorian (MJT support) » Mon Nov 22, 2021 10:04 am

It depends on what changes on the page once the download is ready. If some tell-tale element appears once it's ready you could detect for that. If the link doesn't appear until it's ready, then you can keep looking for it until it exists.

This loop will keep looking for it while it doesn't exist, and will then continue once it's found. I'm guessing you're trying this on Chrome/Edge, using the Chrome/Edge functions and are already familiar with ChromeDriver etc. :

Code: Select all

let>TheURL=https://www.mjtnet.com/example-form/
Let>CHROMEDRIVER_EXE=c:\chromedriver.exe

ChromeStart>session_id
ChromeNavigate>session_id,url,%TheURL%


let>elements_count=0
While>elements_count<1
  ChromeFindElements>session_id,name,FirstName,elements
  Wait>1
Endwhile
If using the IE functions you can use IEWaitForText or IEContainsText.

In more complex cases sometimes grabbing the page source can help too.

I hope this gives you a good starting point, but I can give you a more specific answer with a more specific question.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts