How do I deal with a form with changing POS?

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
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
dopplegl
Posts: 1
Joined: Thu Sep 22, 2016 7:11 pm

How do I deal with a form with changing POS?

Post by dopplegl » Thu Sep 22, 2016 7:30 pm

iMacros Extension for Chrome 8.4.4
Chrome Version 53.0.2785.116 (64-bit)
macOS Sierra 10.12

I am very new to this (started today in fact), but despite forum searching, couldn't find the answer to my question.

A part of my job involves tedious repetitive entry of numerical values in to a form on Chrome and I was thrilled when I got iMarcros to work in my favor today. The problem was, when I navigated to a different part of the application (but to the same form), I found that info was being entered in the wrong place. It seems that because any time I change instances, the POS numbers change. I recorded doing the same things in different places (and in some cases--the same place), and every time I get a different POS # for the same fields. Is there any way to have it ignore POS but somehow still find the right field? Some examples are below of what I mean.

Recording 1:
TAG POS=18 TYPE=INPUT:TEXT ATTR=* CONTENT=10.4
TAG POS=1 TYPE=SELECT ATTR=TXT:NormalHighLowAbnormalCritical<SP>HighCritical<SP>LowVery* CONTENT=%Normal
TAG POS=20 TYPE=INPUT:TEXT ATTR=* CONTENT=3.8
TAG POS=21 TYPE=INPUT:TEXT ATTR=* CONTENT=10.8
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next

Recording 2:
TAG POS=16 TYPE=INPUT:TEXT ATTR=* CONTENT=10.4
TAG POS=1 TYPE=SELECT ATTR=TXT:NormalHighLowAbnormalCritical<SP>HighCritical<SP>LowVery* CONTENT=%Normal
TAG POS=18 TYPE=INPUT:TEXT ATTR=* CONTENT=3.8
TAG POS=19 TYPE=INPUT:TEXT ATTR=* CONTENT=10.8
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next

Recording 3:
TAG POS=14 TYPE=INPUT:TEXT ATTR=* CONTENT=10.4
TAG POS=1 TYPE=SELECT ATTR=TXT:NormalHighLowAbnormalCritical<SP>HighCritical<SP>LowVery* CONTENT=%Normal
TAG POS=16 TYPE=INPUT:TEXT ATTR=* CONTENT=3.8
TAG POS=17 TYPE=INPUT:TEXT ATTR=* CONTENT=10.8
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next

As you can see, despite the fact that I keep typing the data in to what is visually the same field, the position number keeps changing, thus making using this on a consistent basis (without having to recode the POS every time) impossible.

I'd really appreciate any help you can give me in this matter.
Last edited by dopplegl on Thu Sep 22, 2016 10:21 pm, edited 1 time in total.
chivracq
Posts: 8874
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: New user question--How to deal with a form with changing

Post by chivracq » Thu Sep 22, 2016 10:11 pm

dopplegl wrote:

Code: Select all

iMacros Extension for Chrome 8.4.4
Chrome Version 53.0.2785.116 (64-bit)
macOS Sierra 10.12
I am very new to this (started today in fact), but despite forum searching, couldn't find the answer to my question.

A part of my job involves tedious repetitive entry of numerical values in to a form on Chrome and I was thrilled when I got iMarcros to work in my favor today. The problem was, when I navigated to a different part of the application (but to the same form), I found that info was being entered in the wrong place. It seems that because any time I change instances, the POS numbers change. I recorded doing the same things in different places (and in some cases--the same place), and every time I get a different POS # for the same fields. Is there any way to have it ignore POS but somehow still find the right field? Some examples are below of what I mean.

Recording 1:

Code: Select all

TAG POS=18 TYPE=INPUT:TEXT ATTR=* CONTENT=10.4
TAG POS=1 TYPE=SELECT ATTR=TXT:NormalHighLowAbnormalCritical<SP>HighCritical<SP>LowVery* CONTENT=%Normal
TAG POS=20 TYPE=INPUT:TEXT ATTR=* CONTENT=3.8
TAG POS=21 TYPE=INPUT:TEXT ATTR=* CONTENT=10.8
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next
Recording 2:

Code: Select all

TAG POS=16 TYPE=INPUT:TEXT ATTR=* CONTENT=10.4
TAG POS=1 TYPE=SELECT ATTR=TXT:NormalHighLowAbnormalCritical<SP>HighCritical<SP>LowVery* CONTENT=%Normal
TAG POS=18 TYPE=INPUT:TEXT ATTR=* CONTENT=3.8
TAG POS=19 TYPE=INPUT:TEXT ATTR=* CONTENT=10.8
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next
Recording 3:

Code: Select all

TAG POS=14 TYPE=INPUT:TEXT ATTR=* CONTENT=10.4
TAG POS=1 TYPE=SELECT ATTR=TXT:NormalHighLowAbnormalCritical<SP>HighCritical<SP>LowVery* CONTENT=%Normal
TAG POS=16 TYPE=INPUT:TEXT ATTR=* CONTENT=3.8
TAG POS=17 TYPE=INPUT:TEXT ATTR=* CONTENT=10.8
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next
As you can see, despite the fact that I keep typing the data in to what is visually the same field, the position number keeps changing, thus making using this on a consistent basis (without having to recode the POS every time) impossible.

I'd really appreciate any help you can give me in this matter.
The "New user question" part in your Thread Title doesn't bring any "added Value" and will probably cause your Thread Title to get truncated in Replies... And you could add a Question Mark, you are asking a Qt and not providing a "How to" Tutorial...

For your Pb, yep, use "Relative Positioning" by first tagging the Label to use as an "Anchor" corresponding to your first INPUT Field for which "POS=R1" will then probably remain constant.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: How do I deal with a form with changing POS?

Post by iimfun » Fri Sep 23, 2016 8:11 am

It would be better if you provided this post with the html code of your form.

As to "Relative Positioning" suggested above, for instance you can try something like this

Code: Select all

SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next EXTRACT=TXT
TAG POS=R-4 TYPE=INPUT:TEXT ATTR=* CONTENT=10.4
TAG POS=R2 TYPE=INPUT:TEXT ATTR=* CONTENT=3.8
TAG POS=R1 TYPE=INPUT:TEXT ATTR=* CONTENT=10.8
TAG POS=1 TYPE=SELECT ATTR=TXT:NormalHighLowAbnormalCritical<SP>HighCritical<SP>LowVery* CONTENT=%Normal
TAG POS=1 TYPE=BUTTON ATTR=TXT:Next
Post Reply