Page reload in frames with the Tag command

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderator: iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Page reload in frames with the Tag command

by siulung on Wed Nov 11, 2009 6:05 pm

Hi

I am trying to setup macro for a site which dynamic generate its content , a lot of the navigation are by clicking on icon in tables or in frames and part or whole of the page will get refresh ( without ever changing the URL ).

i am able to use imacro to record all those clicking to get what i want , with just one problem , when the page re-load ( re generate ) its content , it take some time , and the icon / table / frame for the next click wouldn't be available until the page finish loading.

With the URL command , imacro wouldn't execute the next line of command until the page finish loading , however this doesn't seems to be happening with the TAG command , if you have multiple TAG command , it will be execute right after another without waiting the page finish loading. The only way i get it to work for my macro now is to put in the WAIT command in between for a few sec but that is so inefficient where the delay time is sometimes not enough and would break the whole script or if i increase the WAIT time really high , it works but would take much more time than need to run the script. Also , there are no way for the script to properly pass back an error to my C# program whom call the macro with an accurate error so that i could send a different macro to refresh the page instead of keep going.

So , my question is are there any way imacro could detect the page have been reload after the TAG command? maybe something like ONPAGEDONE or something like that?

--ADD--
Here is part of the macro that have been record

TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:NoFormName ATTR=NAME:button1
'New page loaded
TAG POS=2 TYPE=INPUT:BUTTON FORM=NAME:NoFormName ATTR=NAME:button1
'New page loaded

so even imacro know that the page have been reload , i just couldn't figure out how i can make imacro know that the page will reload , and wait till the page finish loading until the next TAG command start
siulung
 
Posts: 6
Joined: Fri Nov 06, 2009 6:30 pm

Re: Page reload in frames with the Tag command

by Hannes, Tech Support on Mon Nov 16, 2009 3:30 am

As a workaround, you can set !TIMEOUT to a low value and use !ERRORIGNORE to ignore that shortened timeout. After the problematic command, set both back to the default values.
Hannes, iOpus Support
Hannes, Tech Support
 
Posts: 2119
Joined: Thu Sep 21, 2006 6:27 am

Re: Page reload in frames with the Tag command

by siulung on Thu Nov 19, 2009 5:49 am

The work around you suggest doesn't really do what i really wanted to do. But thanks for the suggestion.

After some more digging on the forum and on the online manual / wiki , i seems to find my solution simular to web testing in ajax , i am adding a image search after the TAG instead of waiting , as there are usually some difference to the picture being load so this seems to have been work good so far ( 95% of the times as there are a few page have the identical pictures.)

However , i still think imacro should have some sort of way to detect when the page got reload or something simular for the macro to take adventage of. I guess that would be a feature enchancement request that i hope to see in the future.
siulung
 
Posts: 6
Joined: Fri Nov 06, 2009 6:30 pm

Re: Page reload in frames with the Tag command

by siulung on Sat Nov 21, 2009 3:41 pm

Hi there

I just found something interesting that if i could get it to work , will do just what i need.

From the wiki
http://wiki.imacros.net/TAG#Triggering_events

under Following links
"Sometimes iMacros continues with a TAG command inside a frame before the web site in that frame has been completely loaded. This can be avoided by adding a WAIT SECONDS=#DOWNLOADCOMPLETE# command before the TAG command."

This is exactly however i couldn't get it to work. no matter if i put this "WAIT SECONDS=#DOWNLOADCOMPLETE#" before or after the TAG command , i got the following error.

BadParameter: expected SECONDS=<number> as parameter 1, line 4

Anyone have any idea if this tag actually work? or i am miss reading it that i mean putting a number there or am i missing something?
siulung
 
Posts: 6
Joined: Fri Nov 06, 2009 6:30 pm

Re: Page reload in frames with the Tag command

by Hannes, Tech Support on Mon Nov 23, 2009 2:43 am

How does the following macro behave on your system? It runs fine here (iMacros version 6.85).
Code: Select all
VERSION BUILD=6851105     
TAB T=1     
TAB CLOSEALLOTHERS     
URL GOTO=http://www.bbc.co.uk/     
WAIT SECONDS=#DOWNLOADCOMPLETE#
Hannes, iOpus Support
Hannes, Tech Support
 
Posts: 2119
Joined: Thu Sep 21, 2006 6:27 am

Re: Page reload in frames with the Tag command

by an other on Sun Feb 07, 2010 9:15 am

I get the same error as the previous poster in iMacros for Firefox V6.5.0.0.

I.e., "BadParameter: expected SECONDS=<number> as parameter 1, line: 5"
an other
 
Posts: 3
Joined: Sun Feb 07, 2010 9:12 am

Re: Page reload in frames with the Tag command

by Daniel, Tech Support on Mon Feb 08, 2010 9:48 am

Could you please run this code and see if it works:
Code: Select all
    VERSION BUILD=6851105     
    TAB T=1     
    TAB CLOSEALLOTHERS     
    URL GOTO=http://www.bbc.co.uk/     
    WAIT SECONDS=#DOWNLOADCOMPLETE#

?
Daniel, iOpus Support
Daniel, Tech Support
 
Posts: 1483
Joined: Tue Jan 26, 2010 4:35 am

Re: Page reload in frames with the Tag command

by an other on Mon Feb 08, 2010 12:33 pm

That is the code I ran (admittedly I wasn't clear about what I had run). I just ran it again, and again got the same error.
an other
 
Posts: 3
Joined: Sun Feb 07, 2010 9:12 am

Re: Page reload in frames with the Tag command

by Daniel, Tech Support on Tue Feb 09, 2010 6:14 am

Hello,

I am very sorry, I missed the part when you said you're running it on Firefox!
#DOWNLOADCOMPLETE# parameter is not supported (and not required) in Firefox. Just delete the line. It will wait for the page to download in any case.
Daniel, iOpus Support
Daniel, Tech Support
 
Posts: 1483
Joined: Tue Jan 26, 2010 4:35 am

Re: Page reload in frames with the Tag command

by an other on Tue Feb 09, 2010 7:27 am

It may be true for "URL GOTO" page loads, that Imacros waits for the load to finish. But I have the same problem as the OP - it doesn't seem to be true for page reloads after TAG commands. I need my script to wait for some kind of indication that the Tag command has been processed - normally the page reload.

I may try the OP's idea of waiting a particular image to load. That will take a lot more work to customize the script, and will break whenever the images change. But whaddayougonnado?
an other
 
Posts: 3
Joined: Sun Feb 07, 2010 9:12 am

Re: Page reload in frames with the Tag command

by Daniel, Tech Support on Wed Feb 10, 2010 5:52 am

Hello,

Could you give a URL and the code which doesn't work on it in this manner?

Best regards,
Daniel, iOpus Support
Daniel, Tech Support
 
Posts: 1483
Joined: Tue Jan 26, 2010 4:35 am

Re: Page reload in frames with the Tag command

by cobal on Mon Mar 08, 2010 11:22 pm

Hi,

I got similar problem, but I would like to refresh only a single frame.
My task is to fill some forms, and click some links (also with java).. but the webpage contains few frames.
I would like to refresh a single frame (not all page - because I lose a previous data filled in forms from other frames).
How to do it?


I found a different solution to jump to next line of macro even if you will get a error:

VERSION BUILD=6600217 RECORDER=FX
TAB T=1

SET !TIMEOUT 25
'set !timeoutignore yes

SET !ERRORIGNORE YES
'SET !LOADCHECK NO

SET !REPLAYSPEED FAST

WAIT SECONDS=1

' exit with error if macro takes longer that 15 seconds
'SET !TIMEOUT_MACRO 20

' exit with error if PAGE is not found after 25 seconds
SET !TIMEOUT_PAGE 10

' exit with error if TAG is not found after 3 seconds
SET !TIMEOUT_TAG 3


TAB T=1
'REFRESH - this refresh dont work in single frame :((
FRAME F=1
TAG POS=1 TYPE=IMG ATTR=ID:n10


TAB T=1
FRAME F=5
TAG POS=1 TYPE=AREA ATTR=HREF:javascript:www-web-java-link
cobal
 
Posts: 1
Joined: Mon Mar 08, 2010 9:56 pm

Re: Page reload in frames with the Tag command

by Daniel, Tech Support on Wed Mar 10, 2010 2:31 pm

Hello,

REFRESH works on the whole browser window. I guess the solution in this case would be to load each frame in a separate window/tab.
Daniel, iOpus Support
Daniel, Tech Support
 
Posts: 1483
Joined: Tue Jan 26, 2010 4:35 am


Return to General Support & Discussions

Who is online

Users browsing this forum: Bing [Bot] and 5 guests

Website Monitoring