Macro migration v6 -> v7 - Replace #downloadcomplete#

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
yfs
Posts: 2
Joined: Thu Mar 24, 2011 3:22 pm

Macro migration v6 -> v7 - Replace #downloadcomplete#

Post by yfs » Thu Mar 24, 2011 4:03 pm

Hi,

I'm currently trying to evaluate if it's possible to migrate our several thousand macros from the testsuite to the new version7 and I've come to a point where I'm having the most trouble to replace the previously available WAIT SECONDS=#DOWNLOADCOMPLETE#. :?

I'm using the 7.22 version of iMacros and we have to use the iMacros browser with IE8 for the testrun.

In the upgrading information (http://wiki.imacros.net/Upgrading_to_Version_7) there's a note that this script is not necessary anymore, so I would like to know how it is replaced since neither the browser nor the plugin seems to have an automatic function I can use instead.

I tried running one of the macros in question by not using the line but the default timeout is used and the macro can't find the next step within this time.

To further demonstrate the problem I might explain the testing situation first:

A web application is running and collecting data from a database.
While it is collecting the data a progress page is shown.
When all data is available and the result rendered, the page will reload and show the result content.
From there the testcase checks the content of the result page.
If the data collection fails, there is NO reload of the page and the failed message will simply be displayed on the progess page.

In version 6 we used #downloadcomplete# to wait on the progresspage until the result page is finished rendering. This worked perfectly.
Now the macro is trying to locate the next step (checking of the result content) within the progress page, which is not possible.

If I use the regular timeout function I have to decide between the potentially lesser of two evils:
a) I use a very high timeout or wait to ensure that each result page will show up eventually. If the data collection failed, the macro will wait the full timeout until it logs the testcase with an error. With a few thousand testcases this will potentially result in 10 times the runtime we currently have.
b) I use a small timeout or wait to reduce the potential runtime. This will result in testcases failing because the timeout runs out before the result page is rendered.

Is there any other (new?) function I can use for this problem? :?:

I would appreciate any help. Thank you very much.

While I'm at it: What's the workaround for !VARDEFAULT? On the same page as stated above it says this is never used, which is strange because we use it a lot... :(
Marcia, Tech Support
Posts: 1095
Joined: Thu Jan 29, 2009 1:10 pm

Re: Macro migration v6 -> v7 - Replace #downloadcomplete#

Post by Marcia, Tech Support » Thu Mar 24, 2011 10:12 pm

Hello,

Could you please, post here a test macro where you see the need for #DOWNLOADCOMPLETE#? You can also send it to support@iopus.com.
Regards,

Marcia
yfs
Posts: 2
Joined: Thu Mar 24, 2011 3:22 pm

Re: Macro migration v6 -> v7 - Replace #downloadcomplete#

Post by yfs » Fri Mar 25, 2011 6:20 am

Code: Select all

'set variable in case of individual macro run instead of guitest run
SET !VARDEFAULT RTS
'find and start report
TAG POS=1 TYPE=DIV ATTR=NAME:Save4Favs{{RTS}}   
TAG POS=R1 TYPE=INPUT:IMAGE FORM=ID:myFavoritesForm ATTR=ID:myFavoritesForm:*:*:startAsHtmlButton*
'Wait for result
WAIT SECONDS=#DOWNLOADCOMPLETE#
'close report if successful
TAG POS=1 TYPE=INPUT:IMAGE ATTR=SRC:*/images/gfx/dark/close-tab-16.gif  
This is one of the simpler macros where I use it. This one is a bit more difficult for me than the one described above because the close image link is available while it's waiting for the completion of the download. So I can't use timeout here but have to use a wait. The runtime of the reports varies from 2 seconds to several minutes though :(

The principle is the same for others. E.g. we have dropdowns on dialog pages that change the rest of the page through a short reload. I use #downloadcomplete# there too because the application might run in an illegal argument exception if the new element is selected before the reload of the page is complete. I might use wait there but again it's a decision between the knowledge the test will definitely run (high wait) and a faster runtime (small wait) :(

Unfortunately I can not show you a macro that runs on the application itself since it is running within a production environment which can't be accessed from the regular net :?
Volodath
Posts: 23
Joined: Mon Jan 17, 2011 11:32 pm

Re: Macro migration v6 -> v7 - Replace #downloadcomplete#

Post by Volodath » Mon Mar 28, 2011 8:27 pm

Bump for importance.

I'm migrating from 6.7-> 7.2 with firefox and have found several annoying bugs that I'm needing to work around. This one (as well as ONDOWNLOAD not used) are the most troublesome.

Thanks

Volo
Marcia, Tech Support
Posts: 1095
Joined: Thu Jan 29, 2009 1:10 pm

Re: Macro migration v6 -> v7 - Replace #downloadcomplete#

Post by Marcia, Tech Support » Mon Mar 28, 2011 8:50 pm

Hello,
Volodath wrote:I'm migrating from 6.7-> 7.2 with firefox
Sorry, Volodath. This thread refers to the iMacros Browser. Please, post your questions in the iMacros for Firefox forum.

Back to the #DOWNLOADCOMPLETE# problem...

iMacros 7 will wait for the page to complete download if you use:
  • a TAG command on an html element which just appears after the page is ready, or
  • an IMAGESEARCH command on an image which is there after the page is ready, or
  • a SEARCH command for a piece of text in the final page source
In any of these cases, you should tune !TIMEOUT_STEP to the maximum time this page takes to load in seconds.

If you feel that none of these options work in your case, please contact support@iopus.com with a sample macro and we will be glad to help you to find an alternative.
Regards,

Marcia
Volodath
Posts: 23
Joined: Mon Jan 17, 2011 11:32 pm

Re: Macro migration v6 -> v7 - Replace #downloadcomplete#

Post by Volodath » Tue Mar 29, 2011 5:02 pm

Marcia -

My apologies for posting in the wrong forum.
Post Reply