Open URL and wait until page has finished loading

Post here if you need help using Actiona
Post Reply
ricardoq5
Posts: 4
Joined: 14 May 2019, 02:27

Open URL and wait until page has finished loading

Post by ricardoq5 » 15 May 2019, 15:10

Does anybody have any idea how to do it? I've being trying to figure it out with window and system objects but no luck.

For now, I set a time in "pause after" in the Open Url action, but depending on internet connection, it may be either not enough and ruin further actions or be too much and slow down the script with unnecessary waiting.

Thanks in advance.

eureka
Posts: 78
Joined: 08 Mar 2016, 22:18

Re: Open URL and wait until page has finished loading

Post by eureka » 15 May 2019, 17:55

I would try loop syntax viewtopic.php?f=35&t=1778&p=6218&hilit=loop#p6218, rather than pause.

ricardoq5
Posts: 4
Joined: 14 May 2019, 02:27

Re: Open URL and wait until page has finished loading

Post by ricardoq5 » 17 May 2019, 00:16

eureka wrote:
15 May 2019, 17:55
I would try loop syntax viewtopic.php?f=35&t=1778&p=6218&hilit=loop#p6218, rather than pause.
I'm not sure if you understood what I meant. I see no use for loops in my case, but thanks for replying anyway.

Well, for those going through the same as me, I managed to emulate this effect of "waiting till webpage finished loading" with the "Find Image" action. I take a screenshot of the page fully loaded and set the action to wait until it finds that image on the screen.

If anybody has a better idea, please post, this will surely help those who are making scripts to automate actions done in browsers.

francois
Posts: 323
Joined: 18 Oct 2010, 10:33
Location: France

Re: Open URL and wait until page has finished loading

Post by francois » 18 May 2019, 10:34

I propose a script on the french forum :
viewtopic.php?f=25&t=18648
(script to download)

ricardoq5
Posts: 4
Joined: 14 May 2019, 02:27

Re: Open URL and wait until page has finished loading

Post by ricardoq5 » 19 May 2019, 01:30

francois wrote:
18 May 2019, 10:34
I propose a script on the french forum :
viewtopic.php?f=25&t=18648
(script to download)
Cool, francois. By taking a look at your script, it seems you've come to the same conclusion as me, but I have a question about your script: is all that code really necessary? I mean, there's an option to wait if the image is not found as well as an option to do something if the image is found in the very Find Image action. Is there another purpose behind the code?

francois
Posts: 323
Joined: 18 Oct 2010, 10:33
Location: France

Re: Open URL and wait until page has finished loading

Post by francois » 19 May 2019, 11:08

Is there another purpose behind the code?
No, the script :
- initialize some variables.
- Try to find an image ( with the loop)
- If the image is found, click on it, otherwise there is a message.
If anybody has a better idea, please post, this will surely help those who are making scripts to automate actions done in browsers.
you can use the action 'Find Image' (without code):
- in the tab 'Advanced', "delay between two search when waiting".
- in the tab "Common", "timeout".

I use a loop with code because I have not seen in the documentation how to indicate "delay between two search when waiting"

An example in the french forum : viewtopic.php?f=25&t=18648
( the second message)

eureka
Posts: 78
Joined: 08 Mar 2016, 22:18

Re: Open URL and wait until page has finished loading

Post by eureka » 19 May 2019, 13:01

command: curl
parameters: -Is http://www.google.com | head -n 1

actions flow ..

01 Commands
02 Console
03 Loop

Parse the output (written to a var) to look for "200 OK".

francois
Posts: 323
Joined: 18 Oct 2010, 10:33
Location: France

Re: Open URL and wait until page has finished loading

Post by francois » 07 Jul 2019, 21:04

In the French forum, I propose a script :
viewtopic.php?f=25&t=18667

It's simpler than the first script I had proposed before, there is no need to create an image and test its presence on the screen.

François

Post Reply