Help on SET !ERRORIGNORE YES

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

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.

Help on SET !ERRORIGNORE YES

by mohca2121 on Fri Oct 13, 2017 5:35 pm

Hi,

My macro goes to a website and searches for ticket numbers and update them accordingly. If the ticket is not found, I want to continue to the next search. What's happening now is that it is skipping these lines:

Code: Select all
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id105:txtCMReference CONTENT=559
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id42:j_id44:drpstatus CONTENT=%Closed
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id47:j_id49:drCloseReason CONTENT=%Resolution<SP>Provided
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id38:j_id40:drpSeverity CONTENT=%Low
TAG POS=1 TYPE=TEXTAREA FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:j_id116:j_id121:txtInternalComments CONTENT=Released<SP>in<SP>0.0.13


and it goes directly to

Code: Select all
WAIT SECONDS=4


Here is the full macro:


Code: Select all
VERSION BUILD=844 RECORDER=CR
SET !ERRORIGNORE YES
URL GOTO=somelink
TAG POS=1 TYPE=DIV ATTR=CLASS:searchBoxClearContainer&&TXT:
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:phSearchForm ATTR=ID:phSearchInput CONTENT=148935
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:phSearchForm ATTR=ID:phSearchButton
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id105:txtCMReference CONTENT=559
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id42:j_id44:drpstatus CONTENT=%Closed
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id47:j_id49:drCloseReason CONTENT=%Resolution<SP>Provided
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id38:j_id40:drpSeverity CONTENT=%Low
TAG POS=1 TYPE=TEXTAREA FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:j_id116:j_id121:txtInternalComments CONTENT=Released<SP>in<SP>0.0.13
WAIT SECONDS=4
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:pgId:form1 ATTR=NAME:pgId:form1:thePageBlock:j_id1:j_id2
WAIT SECONDS=4
URL GOTO=https://abbenterprisesoftware.my.salesforce.com/home/home.jsp
TAG POS=1 TYPE=A ATTR=TXT:Home
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:phSearchForm ATTR=ID:phSearchInput CONTENT=148936
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:phSearchForm ATTR=ID:phSearchButton
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id105:txtCMReference CONTENT=560
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id42:j_id44:drpstatus CONTENT=%Closed
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id47:j_id49:drCloseReason CONTENT=%Resolution<SP>Provided
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id38:j_id40:drpSeverity CONTENT=%Low
TAG POS=1 TYPE=TEXTAREA FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:j_id116:j_id121:txtInternalComments CONTENT=Released<SP>in<SP>0.0.13
WAIT SECONDS=4
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:pgId:form1 ATTR=NAME:pgId:form1:thePageBlock:j_id1:j_id2
WAIT SECONDS=4


I want to skip only when the ticket number is not found after this line is run:
Code: Select all
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:phSearchForm ATTR=ID:phSearchButton


Thanks,
mohca2121
 
Posts: 1
Joined: Fri Oct 13, 2017 5:28 pm

Re: Help on SET !ERRORIGNORE YES

by chivracq on Sat Oct 14, 2017 6:16 am

mohca2121 wrote:Hi,

My macro goes to a website and searches for ticket numbers and update them accordingly. If the ticket is not found, I want to continue to the next search. What's happening now is that it is skipping these lines:

Code: Select all
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id105:txtCMReference CONTENT=559
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id42:j_id44:drpstatus CONTENT=%Closed
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id47:j_id49:drCloseReason CONTENT=%Resolution<SP>Provided
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id38:j_id40:drpSeverity CONTENT=%Low
TAG POS=1 TYPE=TEXTAREA FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:j_id116:j_id121:txtInternalComments CONTENT=Released<SP>in<SP>0.0.13


and it goes directly to

Code: Select all
WAIT SECONDS=4


Here is the full macro:

Code: Select all
VERSION BUILD=844 RECORDER=CR
SET !ERRORIGNORE YES
URL GOTO=somelink
TAG POS=1 TYPE=DIV ATTR=CLASS:searchBoxClearContainer&&TXT:
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:phSearchForm ATTR=ID:phSearchInput CONTENT=148935
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:phSearchForm ATTR=ID:phSearchButton
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id105:txtCMReference CONTENT=559
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id42:j_id44:drpstatus CONTENT=%Closed
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id47:j_id49:drCloseReason CONTENT=%Resolution<SP>Provided
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id38:j_id40:drpSeverity CONTENT=%Low
TAG POS=1 TYPE=TEXTAREA FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:j_id116:j_id121:txtInternalComments CONTENT=Released<SP>in<SP>0.0.13
WAIT SECONDS=4
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:pgId:form1 ATTR=NAME:pgId:form1:thePageBlock:j_id1:j_id2
WAIT SECONDS=4
URL GOTO=https://abbenterprisesoftware.my.salesforce.com/home/home.jsp
TAG POS=1 TYPE=A ATTR=TXT:Home
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:phSearchForm ATTR=ID:phSearchInput CONTENT=148936
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:phSearchForm ATTR=ID:phSearchButton
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id105:txtCMReference CONTENT=560
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id42:j_id44:drpstatus CONTENT=%Closed
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id47:j_id49:drCloseReason CONTENT=%Resolution<SP>Provided
TAG POS=1 TYPE=SELECT FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:theCaseSection:j_id38:j_id40:drpSeverity CONTENT=%Low
TAG POS=1 TYPE=TEXTAREA FORM=ID:pgId:form1 ATTR=ID:pgId:form1:thePageBlock:j_id116:j_id121:txtInternalComments CONTENT=Released<SP>in<SP>0.0.13
WAIT SECONDS=4
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:pgId:form1 ATTR=NAME:pgId:form1:thePageBlock:j_id1:j_id2
WAIT SECONDS=4


I want to skip only when the ticket number is not found after this line is run:
Code: Select all
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:phSearchForm ATTR=ID:phSearchButton


Thanks,

Good "Quality" in your Post :D , but...:
FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for CR v8.4.4, CR61...?, OS...?

But OK, if I understand correctly, your Script is already skipping the Case Update/Close Actions if the Case Number was not found, thanks indeed to '!ERRORIGNORE', as I guess those HTML Elements will not be found either. But what you could do is already shorten '!TIMEOUT_STEP' to "1" or "0" Seconds, instead of waiting for the Default 6 Sec for all missing Fields.

If those Statements might still do stg "unwanted" on the Page and you really want to "deactivate" them completely, you then need to check for the presence of one Element/Field that will only be present on the Page if a Case was found, with some "fake" 'EXTRACT' and upon found or not, spit out a "1"/"0" with 'EVAL()' to reuse for 'POS=n' on the 'TAG' Statements you want to mute... (TAG POS=0 etc... won't do anything...)

Have a look at the following Thread where I implemented that Technique for the 'Google Search' part of the Macro for that Case, and even toggled the Value for '!TIMEOUT_STEP' dynamically between "1"/"0" depending on if the 'TAG' Statements must be executed or not...:
- Re: How to use EVAL to Stop the Macro when there is no Next?

And mini-Remark, your Script looks like it could easily be looped, instead of repeating the same Blocks hard-coded in the same Macro... :idea:
- (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 General Support & Discussions

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 8 guests

-->