Need help with > IF Dialog THEN SAVEAS

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
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
Shumihaze
Posts: 6
Joined: Fri Sep 14, 2018 5:15 am

Need help with > IF Dialog THEN SAVEAS

Post by Shumihaze » Fri Sep 14, 2018 5:48 am

Hello, I'm learning how to use iMacro since last week (It's always better learn before buy :lol: ) and I'm having great advances!

Yesterday I bumped into a problem and need help to make my macro work as I'm specting.. :twisted:

I need to save only the numbers (taken from my .csv file that has a list of 30,000 numbers) that activate a dialog box saying "This number is not registered", but I could not find anything in iMacros to help me do this, because it does not know when this dialog box will appear (I can only make it click on the "OK" of the dialog box).

Could someone give me a direction on what to do in this case?

Here is my script till now:

Code: Select all

VERSION BUILD=11.5.498.2403
TAB T=1
TAB CLOSEALLOTHERS

SET !DATASOURCE ..\Files\list.csv
SET !LOOP 20
SET !DATASOURCE_LINE {{!LOOP}}
SET !ERRORIGNORE YES
'Here I click to begin a new Search
TAG POS=1 TYPE=A ATTR=TXT:Nova<SP>Consulta
TAG POS=1 TYPE=SELECT ATTR=NAME:selForma CONTENT=%CP
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:txtValor CONTENT={{!COL1}}
'I put my number from my file based on which loot I'm at and store as EXTRACT.
SET !VAR1 {{!LOOP}}<SP>-<SP>{{!COL1}}
SET !EXTRACT {{!VAR1}}

WAIT SECONDS=1
TAG POS=1 TYPE=SELECT ATTR=NAME:selOrigem CONTENT=%PR
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=NAME:chkMostrarBaixados CONTENT=YES
WAIT SECONDS=1

ONDIALOG POS=1 BUTTON=OK
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:botaoEnviar
WAIT SECONDS=1

'                           \/
'So, here I need to use some kind of conditional to check if a DIALOG pops up saying that my number is not registered 
'and if this happens, then I need to click OK (ONDIALOG) and save using the SAVEAS in the last line, but ONLY if this dialog appears
'otherwise it should not save anything and just continue following the script.
ONDIALOG POS=1 BUTTON=OK 
'                           /\

WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:botaoEnviar
WAIT SECONDS=1
SAVEAS TYPE=EXTRACT FOLDER=...\Files FILE=Not_Reg.csv
Any kind of help will be very welcome, I apologize in case my English has not been clear enough.

Thank you,
Victor.

iMacro Version that I'm using: 11.5.498.2403
My OS: Windows 8.1
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Need help with > IF Dialog THEN SAVEAS

Post by chivracq » Fri Sep 14, 2018 5:39 pm

Shumihaze wrote:

Code: Select all

iMacro Version that I'm using: 11.5.498.2403
My OS: Windows 8.1
Hello, I'm learning how to use iMacro since last week (It's always better learn before buy :lol: ) and I'm having great advances!

Yesterday I bumped into a problem and need help to make my macro work as I'm specting.. :twisted:

I need to save only the numbers (taken from my .csv file that has a list of 30,000 numbers) that activate a dialog box saying "This number is not registered", but I could not find anything in iMacros to help me do this, because it does not know when this dialog box will appear (I can only make it click on the "OK" of the dialog box).

Could someone give me a direction on what to do in this case?

Here is my script till now:

Code: Select all

VERSION BUILD=11.5.498.2403
TAB T=1
TAB CLOSEALLOTHERS

SET !DATASOURCE ..\Files\list.csv
SET !LOOP 20
SET !DATASOURCE_LINE {{!LOOP}}
SET !ERRORIGNORE YES
'Here I click to begin a new Search
TAG POS=1 TYPE=A ATTR=TXT:Nova<SP>Consulta
TAG POS=1 TYPE=SELECT ATTR=NAME:selForma CONTENT=%CP
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:txtValor CONTENT={{!COL1}}
'I put my number from my file based on which loot I'm at and store as EXTRACT.
SET !VAR1 {{!LOOP}}<SP>-<SP>{{!COL1}}
SET !EXTRACT {{!VAR1}}

WAIT SECONDS=1
TAG POS=1 TYPE=SELECT ATTR=NAME:selOrigem CONTENT=%PR
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=NAME:chkMostrarBaixados CONTENT=YES
WAIT SECONDS=1

ONDIALOG POS=1 BUTTON=OK
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:botaoEnviar
WAIT SECONDS=1

'                           \/
'So, here I need to use some kind of conditional to check if a DIALOG pops up saying that my number is not registered 
'and if this happens, then I need to click OK (ONDIALOG) and save using the SAVEAS in the last line, but ONLY if this dialog appears
'otherwise it should not save anything and just continue following the script.
ONDIALOG POS=1 BUTTON=OK 
'                           /\

WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:botaoEnviar
WAIT SECONDS=1
SAVEAS TYPE=EXTRACT FOLDER=...\Files FILE=Not_Reg.csv
Any kind of help will be very welcome, I apologize in case my English has not been clear enough.

Thank you,
Victor.

Code: Select all

iMacro Version that I'm using: 11.5.498.2403
My OS: Windows 8.1
Any chance you can post the URL of that Site/Page for me to have a look...?
+ Mention a few Registered + Not Registered Values from your '.CSV'...

[Hum..., and I'm not sure what you intend "to buy", iMB v11.5 is already 2 years old, latest/current Version is iMB v12.0 which was released in Aug 2017, which means you already had at least 14 months to "try" v11.5, and for both Versions, the "Trial" is supposed to be for 1 month, ah-ah...! :wink: (Don't worry, I don't care, but you don't need "to pretend"...)]
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Shumihaze
Posts: 6
Joined: Fri Sep 14, 2018 5:15 am

Re: Need help with > IF Dialog THEN SAVEAS

Post by Shumihaze » Fri Sep 14, 2018 6:31 pm

Oh hello, chivracq!
Thanks for replying! I've seen your posts and answers all over the forum, I'm your huge fan! Hahahaha :lol:
[Hum..., and I'm not sure what you intend "to buy", iMB v11.5 is already 2 years old, latest/current Version is iMB v12.0 which was released in Aug 2017, which means you already had at least 14 months to "try" v11.5, and for both Versions, the "Trial" is supposed to be for 1 month, ah-ah...! :wink: (Don't worry, I don't care, but you don't need "to pretend"...)]
I'm not pretending hahahaha, it was the version that I found for downaload on a site when I researched for web site automation programs.. But by your indignation I should be using the most up to date version right? hahahaha, I'll update then. :wink:
Any chance you can post the URL of that Site/Page for me to have a look...?
+ Mention a few Registered + Not Registered Values from your '.CSV'...
Sure. Here it is:

URL: https://www2.trf4.jus.br/trf4/controlad ... =principal
(It is in Portuguese-BR)

Here is an example number that is not registered:

Code: Select all

15589390915
The registered numbers will just open another page that won't be useful to me and it will go back to check another numbers of the loop, I'll conclude this part after solving this issue. (Not hard) 8)
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Need help with > IF Dialog THEN SAVEAS

Post by chivracq » Fri Sep 14, 2018 7:29 pm

Shumihaze wrote:Oh hello, chivracq!
Thanks for replying! I've seen your posts and answers all over the forum, I'm your huge fan! Hahahaha :lol:
[Hum..., and I'm not sure what you intend "to buy", iMB v11.5 is already 2 years old, latest/current Version is iMB v12.0 which was released in Aug 2017, which means you already had at least 14 months to "try" v11.5, and for both Versions, the "Trial" is supposed to be for 1 month, ah-ah...! :wink: (Don't worry, I don't care, but you don't need "to pretend"...)]
I'm not pretending hahahaha, it was the version that I found for downaload on a site when I researched for web site automation programs.. But by your indignation I should be using the most up to date version right? hahahaha, I'll update then. :wink:
Any chance you can post the URL of that Site/Page for me to have a look...?
+ Mention a few Registered + Not Registered Values from your '.CSV'...
Sure. Here it is:

URL: https://www2.trf4.jus.br/trf4/controlad ... =principal
(It is in Portuguese-BR)

Here is an example number that is not registered:

Code: Select all

15589390915
The registered numbers will just open another page that won't be useful to me and it will go back to check another numbers of the loop, I'll conclude this part after solving this issue. (Not hard) 8)
Oh...!, perfect for URL, but no, I need at least 2 Nb's for each..., => "won't be useful to me [=you]" maybe, but to me, yes, I wouldn't ask otherwise... I need to compare the (Difference in) "Behaviour" between the 2...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Shumihaze
Posts: 6
Joined: Fri Sep 14, 2018 5:15 am

Re: Need help with > IF Dialog THEN SAVEAS

Post by Shumihaze » Fri Sep 14, 2018 8:30 pm

Oh...!, perfect for URL, but no, I need at least 2 Nb's for each..., => "won't be useful to me [=you]" maybe, but to me, yes, I wouldn't ask otherwise... I need to compare the (Difference in) "Behaviour" between the 2...

Oh, that's make sense! :lol:
Here you are:

Not Registered ->

Code: Select all

15589390915
03883213934
Registered ->

Code: Select all

11161400982
63391295953
Thank you for the fast replies chivracq! Do you think it's possible do to it?
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Need help with > IF Dialog THEN SAVEAS

Post by chivracq » Fri Sep 14, 2018 10:34 pm

Shumihaze wrote:
Oh...!, perfect for URL, but no, I need at least 2 Nb's for each..., => "won't be useful to me [=you]" maybe, but to me, yes, I wouldn't ask otherwise... I need to compare the (Difference in) "Behaviour" between the 2...
Oh, that's make sense! :lol:
Here you are:

Not Registered ->

Code: Select all

15589390915
03883213934
Registered ->

Code: Select all

11161400982
63391295953
Thank you for the fast replies chivracq! Do you think it's possible do to it?
Hum, OK, managed to have a look..., after commenting out your "Nova<SP>Consulta" Link, as it was apparently not needed..., but hum, I don't get any Popup at all, all 4 Nb's trigger exactly the same Behaviour for me...: => The "Consulta Processual Unificada" Page with a Captcha to enter...

Here is the Script I used...:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'SET !ERRORIGNORE YES
'SET !EXTRACT_TEST_POPUP NO

SET !SINGLESTEP YES
'https://www2.trf4.jus.br/trf4/controlador.php?acao=principal
'PAUSE

'Not Registered -> 15589390915 03883213934
'Registered ->     11161400982 63391295953
SET !VAR1 03883213934

'Here I click to begin a new Search
'TAG POS=1 TYPE=A ATTR=TXT:Nova<SP>Consulta
TAG POS=1 TYPE=SELECT ATTR=NAME:selForma CONTENT=%CP
'WAIT SECONDS=1

'TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:txtValor CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:txtValor CONTENT={{!VAR1}}
'I put my number from my file based on which loot I'm at and store as EXTRACT.
'SET !VAR1 {{!LOOP}}<SP>-<SP>{{!COL1}}
SET !EXTRACT {{!VAR1}}

'WAIT SECONDS=1
TAG POS=1 TYPE=SELECT ATTR=NAME:selOrigem CONTENT=%PR
'WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=NAME:chkMostrarBaixados CONTENT=YES
'WAIT SECONDS=1

'ONDIALOG POS=1 BUTTON=OK
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:botaoEnviar
'WAIT SECONDS=1

'                           \/
'So, here I need to use some kind of conditional to check if a DIALOG pops up saying that my number is not registered
'and if this happens, then I need to click OK (ONDIALOG) and save using the SAVEAS in the last line, but ONLY if this dialog appears
'otherwise it should not save anything and just continue following the script.
'ONDIALOG POS=1 BUTTON=OK
'                           /\

'WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:botaoEnviar
'WAIT SECONDS=1
PAUSE
'SAVEAS TYPE=EXTRACT FOLDER=...\Files FILE=Not_Reg.csv
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10_x64.)

+ For all 4 Nb's, the 'TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:botaoEnviar' Line each time triggers some Element_not_found RuntimeError which I guess is a bit normal as I didn't even try to fill in the Captcha (I don't help for Captchas anyway...).

Very heavy Site btw, badly designed, took about 2 min for the first Load on the Link you provided..., + not sure why they need FB + Twitter Links/Trackers... :shock:

But anyway, if I get the same Behaviour for all 4 Nb's and land on the same (similar) Page without any Popup and I don't see any Difference in the Source, then I don't have any "easy" Solution for you... :oops:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Shumihaze
Posts: 6
Joined: Fri Sep 14, 2018 5:15 am

Re: Need help with > IF Dialog THEN SAVEAS

Post by Shumihaze » Sun Sep 16, 2018 8:00 pm

Hum, OK, managed to have a look..., after commenting out your "Nova<SP>Consulta" Link, as it was apparently not needed..., but hum, I don't get any Popup at all, all 4 Nb's trigger exactly the same Behaviour for me...: => The "Consulta Processual Unificada" Page with a Captcha to enter...
There is a way to avoid this captcha, after you complete it once, it almost never comes back. So before I start the macro, I do the captcha once, and use "Nova<SP>Consulta" Link to do a new search using another number from the .csv file.
Very heavy Site btw, badly designed, took about 2 min for the first Load on the Link you provided..., + not sure why they need FB + Twitter Links/Trackers...
It is heavy, it's a data site.
But anyway, if I get the same Behaviour for all 4 Nb's and land on the same (similar) Page without any Popup and I don't see any Difference in the Source, then I don't have any "easy" Solution for you...
Oh.. How strange, you should have received a dialog before the captcha, in the unregistered numbers.

This are important in order to receive the dialog, otherwise it will not find:

Code: Select all

TAG POS=1 TYPE=SELECT ATTR=NAME:selForma CONTENT=%CP
TAG POS=1 TYPE=SELECT ATTR=NAME:selOrigem CONTENT=%PR
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Need help with > IF Dialog THEN SAVEAS

Post by chivracq » Mon Sep 17, 2018 12:07 am

Shumihaze wrote:
Hum, OK, managed to have a look..., after commenting out your "Nova<SP>Consulta" Link, as it was apparently not needed..., but hum, I don't get any Popup at all, all 4 Nb's trigger exactly the same Behaviour for me...: => The "Consulta Processual Unificada" Page with a Captcha to enter...
There is a way to avoid this captcha, after you complete it once, it almost never comes back. So before I start the macro, I do the captcha once, and use "Nova<SP>Consulta" Link to do a new search using another number from the .csv file.
Hum, OK, I will fill once their Captcha and give it another try...
A bit skeptic about such a Behaviour, is "programmatically" possible indeed, but I've never seen it implemented on any Site... :P
Shumihaze wrote:
Very heavy Site btw, badly designed, took about 2 min for the first Load on the Link you provided..., + not sure why they need FB + Twitter Links/Trackers...
It is heavy, it's a data site.
Nope, no good Argument, talking about their Home Page, no Data at all there (yet), only Links to Sub-Pages/Sub-Domains, that Page should load in less than 3 sec, not 2 min...
Shumihaze wrote:
But anyway, if I get the same Behaviour for all 4 Nb's and land on the same (similar) Page without any Popup and I don't see any Difference in the Source, then I don't have any "easy" Solution for you...
Oh.. How strange, you should have received a dialog before the captcha, in the unregistered numbers.

This are important in order to receive the dialog, otherwise it will not find:

Code: Select all

TAG POS=1 TYPE=SELECT ATTR=NAME:selForma CONTENT=%CP
TAG POS=1 TYPE=SELECT ATTR=NAME:selOrigem CONTENT=%PR
OK..., I'll give it a 2nd try...
[=> ... when I find the time (again), would help if you could reply/follow up a bit quicker :idea: , 2 days later, several other Threads reached the Forum in the meantime, I'll need to go digging again "from the beginning" into your Thread, I've probably "lost" the Script I was using for your Thread 2 days ago and will have to start all over again...]
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Shumihaze
Posts: 6
Joined: Fri Sep 14, 2018 5:15 am

Re: Need help with > IF Dialog THEN SAVEAS

Post by Shumihaze » Wed Sep 19, 2018 2:23 pm

Hum, OK, I will fill once their Captcha and give it another try...
A bit skeptic about such a Behaviour, is "programmatically" possible indeed, but I've never seen it implemented on any Site... :P
I don't really know why they do this kind of captcha behaviour, but this is how they work in this site :lol:
Nope, no good Argument, talking about their Home Page, no Data at all there (yet), only Links to Sub-Pages/Sub-Domains, that Page should load in less than 3 sec, not 2 min...
Some numbers has a lot of data, some don't. 2 minutes is too much indeed.. I don't know why you are experiencing this much lag :(
OK..., I'll give it a 2nd try...
Thank you bro, I appreciate your help.
[=> ... when I find the time (again), would help if you could reply/follow up a bit quicker :idea: , 2 days later, several other Threads reached the Forum in the meantime, I'll need to go digging again "from the beginning" into your Thread, I've probably "lost" the Script I was using for your Thread 2 days ago and will have to start all over again...]
I did not have time to train imacros scripting or to enter the forum this weekend / week. Forgive me. :oops: :oops:
Shumihaze
Posts: 6
Joined: Fri Sep 14, 2018 5:15 am

Re: Need help with > IF Dialog THEN SAVEAS

Post by Shumihaze » Tue Sep 25, 2018 12:13 pm

I need to know if what I need to do is at least possible.. Can imacros indentify when a dialog appears, so I can use SAVEAS only when the dialog occurs? Are there any king of workaround to make it happen?

Thanks!
Post Reply