Want ot proceed after executing the MacroError function

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, 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.

Want ot proceed after executing the MacroError function

by JagadeeshK on Tue Jan 05, 2016 9:20 am

Hi,

I'm using iMacros11 in iMacros Browser V11.0.246.4051. I'm trying to do some validations in my script using the Eval with MacroError function(please refer the below code).Once the MacroError function is completed I want to proceed with the rest of the steps, but it's not happening. I need to do the same kind of validations in multiple pages.Could someone suggest me a work around for this.

Code: Select all
URL GOTO={{!COL1}}
WAIT SECONDS=10
TAG POS=1 TYPE=P ATTR=CLASS:prodname EXTRACT=TXT
'Validating that the Product name contains the particular text or not
SET !VAR2 EVAL("var s=\"{{!EXTRACT}}\";if(s.match(/Level 1/g)&&s.match(/CD-ROM/g)){MacroError(\"Text Found\");} else {MacroError(\"Text not found\");}")
'The above step is executed successfully, after that the below steps are not executed
PROMPT {{!VAR2}}
TAG POS=1 TYPE=SELECT ATTR=NAME:cart[*][qty] CONTENT=%2
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON ATTR=TXT:Checkout


Thanks,
Jagadeesh.K
JagadeeshK
 
Posts: 8
Joined: Tue Jan 05, 2016 8:41 am

Re: Want ot proceed after executing the MacroError function

by chivracq on Tue Jan 05, 2016 1:47 pm

JagadeeshK wrote:Hi,

I'm using
Code: Select all
iMacros11 in iMacros Browser V11.0.246.4051.
I'm trying to do some validations in my script using the Eval with MacroError function(please refer the below code).Once the MacroError function is completed I want to proceed with the rest of the steps, but it's not happening. I need to do the same kind of validations in multiple pages.Could someone suggest me a work around for this.

Code: Select all
URL GOTO={{!COL1}}
WAIT SECONDS=10
TAG POS=1 TYPE=P ATTR=CLASS:prodname EXTRACT=TXT
'Validating that the Product name contains the particular text or not
SET !VAR2 EVAL("var s=\"{{!EXTRACT}}\";if(s.match(/Level 1/g)&&s.match(/CD-ROM/g)){MacroError(\"Text Found\");} else {MacroError(\"Text not found\");}")
'The above step is executed successfully, after that the below steps are not executed
PROMPT {{!VAR2}}
TAG POS=1 TYPE=SELECT ATTR=NAME:cart[*][qty] CONTENT=%2
WAIT SECONDS=5
TAG POS=1 TYPE=BUTTON ATTR=TXT:Checkout


Thanks,
Jagadeesh.K

Hum, I read your Post several times but first I don't understand your Thread Title, especially the "ot" part, it could be "not" but it still doesn't make sense...
And I don't really understand your "'The above step is executed successfully, after that the below steps are not executed" either, do you get the MacroError or not...?

I can't have a look at your Site to test your Code if you don't post the URL...! :roll:

Mini-Hint, I don't like 'match()' that I find complicated to handle, I prefer to use 'split()' (and count the Length of the Array, if your Search Keyword was not found, the Length will be =1, if it was found, it will be >1...).
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Want to proceed after executing the MacroError function

by JagadeeshK on Tue Jan 05, 2016 9:57 pm

Hi Chivracq thanks for your reply.. actually it's "to".. sorry for the typo :)

The below code executed successfully.. I got the appropriate result... but after executing the below step, Macro stopped, it's not executing the rest of the steps.

Code: Select all
SET !VAR2 EVAL("var s=\"{{!EXTRACT}}\";if(s.match(/Level 1/g)&&s.match(/CD-ROM/g)){MacroError(\"Text Found\");} else {MacroError(\"Text not found\");}")


all I'm trying to do is,after adding a product to the cart, just trying to validate appropriate product description is there or not, and want to proceed with the rest of the steps.

In order to check the actual product, hit the URL http://www.rosettastone.com/learn-english and add any product to the cart
JagadeeshK
 
Posts: 8
Joined: Tue Jan 05, 2016 8:41 am

Re: Want to proceed after executing the MacroError function

by chivracq on Wed Jan 06, 2016 6:18 am

JagadeeshK wrote:Hi Chivracq thanks for your reply.. actually it's "to".. sorry for the typo :)

The below code executed successfully.. I got the appropriate result... but after executing the below step, Macro stopped, it's not executing the rest of the steps.

Code: Select all
SET !VAR2 EVAL("var s=\"{{!EXTRACT}}\";if(s.match(/Level 1/g)&&s.match(/CD-ROM/g)){MacroError(\"Text Found\");} else {MacroError(\"Text not found\");}")


all I'm trying to do is,after adding a product to the cart, just trying to validate appropriate product description is there or not, and want to proceed with the rest of the steps.

In order to check the actual product, hit the URL http://www.rosettastone.com/learn-english and add any product to the cart

Ah...!, OK for "ot" = "to", yep logical...! You can still edit the Thread Title of your OP as it is the one visible from the Forum View...

But for your Qt, yep, it's logical, in both cases you trigger a MacroError. MacroError is meant to stop the Macro. If you want your Macro to keep running, you need to use 'PROMPT' (or iimDisplay()' from a '.js' Script). (You cannot use 'alert()' at this moment with the 'URL GOTO=javascript:' Syntax, it is broken, TechSupport aware of it... Oh...!, yes you can!, it is only broken on FF, you are "lucky" to be using the iMacros Browser...)

For an Example with 'PROMPT', you can have a look at this very similar Thread that we had recently on the Forum:
- Re: [SOLVED] EVAL IF ELSE #EANF# anchor not found
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Want ot proceed after executing the MacroError function

by JagadeeshK on Fri Jan 22, 2016 1:37 am

Hi Chivracq,

Thanks for the examples. It helped me a lot in taking a different approach.

Regards,
Jagadeesh.K
JagadeeshK
 
Posts: 8
Joined: Tue Jan 05, 2016 8:41 am

Re: Want ot proceed after executing the MacroError function

by chivracq on Fri Jan 22, 2016 3:24 pm

JagadeeshK wrote:Hi Chivracq,

Thanks for the examples. It helped me a lot in taking a different approach.

Regards,
Jagadeesh.K

Hum, good to hear but you could mention what "different Approach" you chose, and share your Final Script if that can help other Users with a similar Qt...

Oh and I found a Workaround in the meantime for the Conditional PROMPT...

And you didn't correct the Typo in the Thread Title...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests

-->