EVENT TYPE=CLICK doesn't work

Discussions and Tech Support specific to the iMacros for Chrome extension.
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
futanarink
Posts: 2
Joined: Thu Jan 20, 2022 9:34 am

EVENT TYPE=CLICK doesn't work

Post by futanarink » Thu Jan 20, 2022 11:40 am

Code: Select all

iMacros Chrome Extension 10.1.1 'PE'
Chrome Version 97.0.4692.71
PC Windows 11 English
I'm using the following code:

Code: Select all

VERSION BUILD=1011 RECORDER=CR
WAIT SECONDS=2
TAG POS=2 TYPE=DIV ATTR=TXT:Allocate<SP>Funds
WAIT SECONDS=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" BUTTON=0
WAIT SECONDS=2
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" CHAR="5"
I'm trying to select the input field in a modal container and than insert "5"(because that's how form data are validated). But when 5th line runs, it just make modal container disappear like it clicked outside of the modal. I tried some of these alternatives by changing code below line 4:
1. Directly giving input

Code: Select all

TAG POS=3 TYPE=INPUT:TEXT FORM=ACTION:https://payout.[i]somesite[/i].in/cards/dashboard-cards ATTR=* CONTENT=5
See result1.png
2. Pressed 'TAB' key to select input field

Code: Select all

EVENT TYPE=KEYDOWN SELECTOR="HTML>BODY>MODAL-CONTAINER" KEY=9
EVENT TYPE=KEYUP SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" KEY=9
WAIT SECONDS=3
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" CHAR="5"
Result: Nothing happens, no error, no data in input field
3. I removed 5th line code and manually selected input field while macro was waiting, than it worked perfectly.
But I don't want to do this manual task, that's why I'm using iMacros. Please help.

Additional info: I cannot provide web link since it will require login first. I inspected code and found that, website is made using node js, jquery and ajax(can see some basic functions), when I used the first alternative, here is the change in input field code:
No action taken

Code: Select all

<input _ngcontent-yxu-c34="" class="fund-input ng-untouched ng-pristine ng-invalid" formcontrolname="fund" placeholder="Enter Amount">
Inputs value manually

Code: Select all

<input _ngcontent-yxu-c34="" class="fund-input ng-dirty ng-valid ng-touched" formcontrolname="fund" placeholder="Enter Amount">
Input value using macro

Code: Select all

<input _ngcontent-yxu-c34="" class="fund-input ng-pristine ng-invalid ng-touched" formcontrolname="fund" placeholder="Enter Amount">
Attachments
result1.png
result1.png
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: EVENT TYPE=CLICK doesn't work

Post by chivracq » Thu Jan 20, 2022 12:46 pm

futanarink wrote:
Thu Jan 20, 2022 11:40 am

Code: Select all

iMacros Chrome Extension 10.1.1 'PE'
Chrome Version 97.0.4692.71
PC Windows 11 English
I'm using the following code:

Code: Select all

VERSION BUILD=1011 RECORDER=CR
WAIT SECONDS=2
TAG POS=2 TYPE=DIV ATTR=TXT:Allocate<SP>Funds
WAIT SECONDS=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" BUTTON=0
WAIT SECONDS=2
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" CHAR="5"
I'm trying to select the input field in a modal container and than insert "5"(because that's how form data are validated). But when 5th line runs, it just make modal container disappear like it clicked outside of the modal. I tried some of these alternatives by changing code below line 4:
1. Directly giving input

Code: Select all

TAG POS=3 TYPE=INPUT:TEXT FORM=ACTION:https://payout.[i]somesite[/i].in/cards/dashboard-cards ATTR=* CONTENT=5
See result1.png
2. Pressed 'TAB' key to select input field

Code: Select all

EVENT TYPE=KEYDOWN SELECTOR="HTML>BODY>MODAL-CONTAINER" KEY=9
EVENT TYPE=KEYUP SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" KEY=9
WAIT SECONDS=3
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>MODAL-CONTAINER>DIV>DIV>APP-ALLOCATE-FUNDS>DIV>DIV>FORM>DIV>DIV>INPUT" CHAR="5"
Result: Nothing happens, no error, no data in input field
3. I removed 5th line code and manually selected input field while macro was waiting, than it worked perfectly.
But I don't want to do this manual task, that's why I'm using iMacros. Please help.

Additional info: I cannot provide web link since it will require login first. I inspected code and found that, website is made using node js, jquery and ajax(can see some basic functions), when I used the first alternative, here is the change in input field code:
No action taken

Code: Select all

<input _ngcontent-yxu-c34="" class="fund-input ng-untouched ng-pristine ng-invalid" formcontrolname="fund" placeholder="Enter Amount">
Inputs value manually

Code: Select all

<input _ngcontent-yxu-c34="" class="fund-input ng-dirty ng-valid ng-touched" formcontrolname="fund" placeholder="Enter Amount">
Input value using macro

Code: Select all

<input _ngcontent-yxu-c34="" class="fund-input ng-pristine ng-invalid ng-touched" formcontrolname="fund" placeholder="Enter Amount">

Mini-Compliment on the good Quality of your Post/Thread... :D

Your Thread has nothing really specific to the 'iMacros for CR' Sub-Forum though, I will move it to the 'General' one... :wink:

>>>

Alright, you did "very good" in your Troubleshooting and the different "Things" you tried... :D
So, if I understand correctly, but from your '1.' Results/Section, the 'TAG' Mode is able to fill in the "5" in the 'INPUT' Field, but the Pb is then that the "Allocate Funds" Button does not get "activated"..., hence you tried (logically) to switch to the 'EVENT' Mode...

Then OK, a few other "Things" to try...
When recording using the 'EVENT' Mode, yep indeed, iMacros will first record the 'CLICK' Statement when clicking with the Mouse inside the 'INPUT' Field, and then a 2nd Statement ('KEYPRESS') with the "actual" Input Value, but "usually", the 'CLICK' Statement is actually not needed, => so you can try commenting it out, a bit like you did in Section '3.', but without even clicking manually in/on the 'INPUT' Field.

Your Section/Attempt '2.' by using 'TAB' Navigation is very good, trying also adding tabbing out of the 'INPUT' Field once the Value has been input..., and Statement could be applied/combined to both inputting the Value with the EVENT' and/or 'TAG' Mode(s)..., => the "Goal" is to activate the "Allocate Funds" Button.
=> I mention "and/or", if the 'TAG' Mode was able to fill in the "5", there is "no harm" to "double" the input Action using both Modes, ... if you make sure that you don't end up with "55" being filled in instead of just "5", ah-ah...!
But then if that's "the Case" (getting "55" instead of "5"), you could let the 'TAG' Mode do the Filling in, and "only use the 'EVENT' Mode to activate the 'INPUT' Field + the Button, => not by inputting any Value/Content into the Field, but with Keyboard Arrows/Keys, like 'End'/'Arrow_Right'/'Arrow_Right', or even adding a Space after the "5" and directly deleting it...

Some Mouse Actions you can try to use: Instead of the 'CLICK' Statement, if you record clicking "slowly" in the 'INPUT' Field, while still moving by a few Pixels inside the 'INPUT' Field, iMacros will record 3 Statements for that "Action", => with a 'MOUSEDOWN' + a 'MOUSEMOVE' + a 'MOUSEUP' Statements, that could work better than the single 'CLICK' Statement that you currently have...

What you tried with 'TAB' Navigation was very correct, except try to use only 1 'TAB' Statement, because those are not completely/exactly "Relative" for iMacros, as it will each time (re-)record the "Starting Point/Element" from which the 'TAB' is being done to 'jump" to the next Element in the TAB-Sequence on the Page...
... Oh...!, but you actually have only 1 'TAB' Statement (or "Action" I should say), I realize, but instead of 1 'KEYPRESS' (+ 'KEY' Param) Statement (on the Start Element), the 'KEYPRESS' Statement got "split" between 1 'KEYDOWN' + 1 'KEYUP' Statements on the Start + End Elements... Hum, this could be specific Syntax to your v10.1.x Version for CR, I don't think I had ever noticed/used that Syntax before/myself... :o
But OK, "why not"..., interesting...! :twisted:

But with the same Idea, you could also try clicking on 1 or 2 Element(s)/"Place(s)" on that Modal Popup, before and maybe after also handling the 'INPUT' Field, like on the "Allocate Funds" Header (not the Button), or anywhere on that Modal on some Element/'DIV' that is not "clickable"... (But the 'EVENT' Mode will record "everything", ah-ah...!)

And I find your 'WAIT' Statements "a bit long", you could shorten them to "0.5" Sec, and they shouldn't be needed at all, "normally"...

Alright, those are a few "Things" to try, I would probably "come further" if I could "play" with the Page/Site myself, but I understand your "I cannot provide web link since it will require login first." of course... OK, "Good Luck", that's all I can say right now...! :P
- (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...
futanarink
Posts: 2
Joined: Thu Jan 20, 2022 9:34 am

Re: EVENT TYPE=CLICK doesn't work

Post by futanarink » Thu Jan 20, 2022 3:37 pm

chivracq wrote:
Thu Jan 20, 2022 12:46 pm
Then OK, a few other "Things" to try...
When recording using the 'EVENT' Mode, yep indeed, iMacros will first record the 'CLICK' Statement when clicking with the Mouse inside the 'INPUT' Field, and then a 2nd Statement ('KEYPRESS') with the "actual" Input Value, but "usually", the 'CLICK' Statement is actually not needed, => so you can try commenting it out, a bit like you did in Section '3.', but without even clicking manually in/on the 'INPUT' Field.
When I use without CLICK, modal container disappears, and when I comment out the CLICK statement, nothing happens.
chivracq wrote:
Thu Jan 20, 2022 12:46 pm
Your Section/Attempt '2.' by using 'TAB' Navigation is very good, trying also adding tabbing out of the 'INPUT' Field once the Value has been input..., and Statement could be applied/combined to both inputting the Value with the EVENT' and/or 'TAG' Mode(s)..., => the "Goal" is to activate the "Allocate Funds" Button.
=> I mention "and/or", if the 'TAG' Mode was able to fill in the "5", there is "no harm" to "double" the input Action using both Modes, ... if you make sure that you don't end up with "55" being filled in instead of just "5", ah-ah...!
When I use TAG only, data gets filled in INPUT field but using EVENT KEYPRESS does nothing. Means not getting "55" if I use both of the statement. Tried adding "5 " using event, nothings happens at all.
chivracq wrote:
Thu Jan 20, 2022 12:46 pm
Some Mouse Actions you can try to use: Instead of the 'CLICK' Statement, if you record clicking "slowly" in the 'INPUT' Field, while still moving by a few Pixels inside the 'INPUT' Field, iMacros will record 3 Statements for that "Action", => with a 'MOUSEDOWN' + a 'MOUSEMOVE' + a 'MOUSEUP' Statements, that could work better than the single 'CLICK' Statement that you currently have...
Again, modal container disappear.
chivracq wrote:
Thu Jan 20, 2022 12:46 pm
What you tried with 'TAB' Navigation was very correct, except try to use only 1 'TAB' Statement, because those are not completely/exactly "Relative" for iMacros, as it will each time (re-)record the "Starting Point/Element" from which the 'TAB' is being done to 'jump" to the next Element in the TAB-Sequence on the Page...
... Oh...!, but you actually have only 1 'TAB' Statement (or "Action" I should say), I realize, but instead of 1 'KEYPRESS' (+ 'KEY' Param) Statement (on the Start Element), the 'KEYPRESS' Statement got "split" between 1 'KEYDOWN' + 1 'KEYUP' Statements on the Start + End Elements... Hum, this could be specific Syntax to your v10.1.x Version for CR, I don't think I had ever noticed/used that Syntax before/myself... :o
I tried using 2 tab statement but nothing happens. While doing it manually, I get input field error "Required".
chivracq wrote:
Thu Jan 20, 2022 12:46 pm
But with the same Idea, you could also try clicking on 1 or 2 Element(s)/"Place(s)" on that Modal Popup, before and maybe after also handling the 'INPUT' Field, like on the "Allocate Funds" Header (not the Button), or anywhere on that Modal on some Element/'DIV' that is not "clickable"... (But the 'EVENT' Mode will record "everything", ah-ah...!)
Tried selecting header of modal, but it selects text in input field i.e placeholder text but activating the input.

Conclusion: EVENT statement don't work for me. My solution will be activating input field cause, in any working scenario cursor don't activate in input field, macro fills data in background only which will never activate form submit button. Also, if you have time, you can try yourself on google meet.
Post Reply