I need to error trap if form isnt avail?

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
dayv2005
Posts: 4
Joined: Tue Jun 17, 2008 7:57 pm

I need to error trap if form isnt avail?

Post by dayv2005 » Tue Jun 17, 2008 8:01 pm

ok i wrote a simple script looks like this

VERSION BUILD=6050529 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=website
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value
REFRESH


Ok this just submits a form. Well sometimes when you log into this site. Sometimes there's a form available and sometimes there isnt a form available.

Well if the form is there this line "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value" executes clean. but if there isnt a form their this line produces an error. is there a way to do an if statement basically if there is an error refresh else execute that line?
dayv2005
Posts: 4
Joined: Tue Jun 17, 2008 7:57 pm

Re: I need to error trap if form isnt avail?

Post by dayv2005 » Tue Jun 17, 2008 8:03 pm

btw teh error is this.

Error# 801 in line:7 , TAG not found

TYPE=INPUT:SUBMIT
FORM=ACTION:"Form action here"
ATTR=VALUE:"Value"
jackmacokc
Posts: 9
Joined: Tue Jun 17, 2008 7:07 pm

Re: I need to error trap if form isnt avail?

Post by jackmacokc » Tue Jun 17, 2008 8:30 pm

dayv2005 wrote:ok i wrote a simple script looks like this

VERSION BUILD=6050529 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=website
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value
REFRESH


Ok this just submits a form. Well sometimes when you log into this site. Sometimes there's a form available and sometimes there isnt a form available.

Well if the form is there this line "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:action ATTR=VALUE:value" executes clean. but if there isnt a form their this line produces an error. is there a way to do an if statement basically if there is an error refresh else execute that line?
Not without scripting. There is no built in logic in iMacros. You'll need to use vbscript or C# and the scripting edition of iMacros in order to do that.
dayv2005
Posts: 4
Joined: Tue Jun 17, 2008 7:57 pm

Re: I need to error trap if form isnt avail?

Post by dayv2005 » Tue Jun 17, 2008 11:09 pm

im a programmer can you point me in the right way for documentation on this? i have vs2005 already so i just need to know api docs if you know where i can read that
jackmacokc
Posts: 9
Joined: Tue Jun 17, 2008 7:07 pm

Re: I need to error trap if form isnt avail?

Post by jackmacokc » Wed Jun 18, 2008 12:40 pm

dayv2005 wrote:im a programmer can you point me in the right way for documentation on this? i have vs2005 already so i just need to know api docs if you know where i can read that
Here's a basic reference: http://wiki.imacros.net/CSharp

You basically add the reference to the dll's to your project and then simply insantiate a new iMacros.App object. Very simple, actually. Let me know if you need any help - it took me awhile to figure it all out myself.

Here's a quick example snippet:

Code: Select all

using System;
using System.Collections.Generic;
using System.Text;
using iMacros;

namespace Test
{
    class Example
    {
        public static void Main()
        {
            App imApp = new App();
            Status imStatus = new Status();

            imStatus = imApp.iimInit("-ie", false, "", "", "", 5);
            imStatus = imApp.iimPlay("macro");
            imStatus = imApp.iimExit()
        }
    }
}
dayv2005
Posts: 4
Joined: Tue Jun 17, 2008 7:57 pm

Re: I need to error trap if form isnt avail?

Post by dayv2005 » Wed Jun 18, 2008 1:00 pm

thanks man i greatly appreciate that. I will try getting around to doing it here soon. Im at work right now and i think they'd be upset seeing me messing around with that haha. But i iwll keep you in mind if i need any help with it.
Post Reply