taxon_dev wrote: ↑Wed Apr 21, 2021 1:04 pm
Hi,
I'm using:
Code: Select all
Imacros 12.6.505.4525
on WIndows 10 OS, and Explorer 20H2, and the Imacros for IE ofcourse.
The thing is I've two identical input elements, and the Imacros don't know how to access it.
I attach my code to this message below:
Code: Select all
VERSION BUILD=12.6.505.4525
TAB T=1
TAB CLOSEALLOTHERS
'SET !PLAYBACKDELAY 1.00
URL GOTO=https://*************
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 10
SET !EXTRACT_TEST_POPUP NO
SET !DATASOURCE "{some csv path}"
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:yeshut CONTENT={{!COL1}}
TAG POS=1 TYPE=BUTTON ATTR=TXT:continue
WAIT SECONDS=2
TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:k-input CONTENT={{!COL2}}
TAG POS=2 TYPE=INPUT:RADIO ATTR=NAME:rbDarconRishayonTz
WAIT SECONDS=2
'The element below is the element the Imacros software cannot access
TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:"ng-untouched ng-valid ng-isolate-scope ng-valid-maxlength ng-dirty ng-valid-parse" CONTENT={{!COL3}}
WAIT SECONDS=2
TAG POS=1 TYPE=BUTTON ATTR=TXT:continue
WAIT SECONDS=2
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=CLASS:"checkbox style-2 pull-right ng-untouched ng-valid ng-isolate-scope ng-dirty ng-valid-parse" CONTENT=YES
TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:"ng-untouched ng-valid ng-isolate-scope ng-valid-maxlength ng-dirty ng-valid-parse" CONTENT={{!COL1}}
WAIT SECONDS=2
TAG POS=1 TYPE=SPAN ATTR=CLASS:k-select
TAG POS=6 TYPE=LI ATTR=TXT:primary
TAG POS=3 TYPE=BUTTON ATTR=TXT:approve
WAIT SECONDS=2
TAG POS=4 TYPE=BUTTON ATTR=TXT:approve
TAG POS=1 TYPE=SPAN ATTR=CLASS:"k-icon k-i-arrow-60-down"
TAG POS=3 TYPE=LI ATTR=TXT:{{!COL5}}
WAIT SECONDS=2
TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:"ng-untouched ng-valid ng-isolate-scope ng-valid-maxlength ng-dirty ng-valid-parse" CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:mail CONTENT={{!COL6}}
WAIT SECONDS=2
TAG POS=1 TYPE=BUTTON ATTR=TXT:approve
'New tab opened
TAB T=2
I already tried to change the POS attribute to another absolute value (tried to change it to 2-5), and I've already tried to use the relative position but no success in this attempt as well (tried to write R0. R1, R2, R3 even tried R-1 since the element is from the left side and not the right side from the checkbox).
If someone have an insight about this, or solved something similar, it would be great.
Thanks a lot!
Can you correct the Typo in your Thread Title...?
(I've corrected already in my Reply...)
EDIT: OK, done, Thanks...
>>>
Hum, OK, your Script looks "correct" to me..., then hum, concerning this TEXT 'INPUT' Field for '{{!COL3'}}', what "happens" at that Line...?
=> Do you get any Runtime Error that the Element cannot be found...?, or does your Script continue further...?
Or does maybe only the first Char of your '!COL3' String get input into the Field, as there seems to be some Validation on that Field...?
You need to deactivate '!ERRORIGNORE' for that Line, of course...:
Code: Select all
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:yeshut CONTENT={{!COL1}}
TAG POS=1 TYPE=BUTTON ATTR=TXT:continue
WAIT SECONDS=2
TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:k-input CONTENT={{!COL2}}
TAG POS=2 TYPE=INPUT:RADIO ATTR=NAME:rbDarconRishayonTz
WAIT SECONDS=2
'>
'The element below is the element the Imacros software cannot access
'Debug:
SET !ERRORIGNORE NO
TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:"ng-untouched ng-valid ng-isolate-scope ng-valid-maxlength ng-dirty ng-valid-parse" CONTENT={{!COL3}}
SET !ERRORIGNORE YES
WAIT SECONDS=2
PAUSE
'>
TAG POS=1 TYPE=BUTTON ATTR=TXT:continue
WAIT SECONDS=2
For "Element not found" or "the Script continues", then yep indeed, that will be related to finding the "correct" 'POS=n' or using 'Relative Positioning' like you mention and already tried...
But hum, I'm not "convinced" you tried to use 'R-POS' "correctly", as without specifying an 'Anchor', iMacros will use the previous 'TAG' Statement as 'Anchor' which will be on the "rbDarconRishayonTz" 'RadioButton' while you mention a "CheckBox" and I do see indeed some 'TAG' Statement on a 'CB' in your Script, but that Line is
after the Line about the 'INPUT' Field... (And that is not correct...)
Maybe more reliable anyway for 'R-POS' would be to use the 'LABEL' Element corresponding to the 'INPUT' Element.
>
Then for "only 1 Char being input + Validation on the Field", then hum-hum..., maybe worth trying the 'EVENT' Mode then for that Field, as the 'EVENT' Mode is slower than the 'TAG' Mode and will hopefully allow for enough time for the Validation to run Char by Char...
What also sometimes happens is that the 'INPUT' Element will (dynamically) "change" after typing the 1st Char, you'll need to inspect the Source to find out if that could be the Case... (Then the 'EVENT' Mode also usually works "better" with that kind of HTML Structure/Design...)
>
Then, hum..., not much more I can tell you without being able to "play" with the Page myself to test and analyze how it "behaves"...
Oh...!, and "R0" is not a valid Value for 'R-POS'...
(But with '!ERRORIGNORE', that Line will simply do nothing..., same with "TAG POS=0" also...)
- (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...