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...
Your Thread has nothing really specific to the 'iMacros for CR' Sub-Forum though, I will move it to the 'General' one...
>>>
Alright, you did "very good" in your Troubleshooting and the different "Things" you tried...
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...
But OK, "why not"..., interesting...!
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...!
- (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...