Form fill

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
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Form fill

by kingweb on Mon Sep 24, 2018 9:30 am

I am using imacros v8. I know it is a little old, but I have been using it for years, and it serves me well.
I have a little issue which seems almost too easy to not have a solution. There is a form that I need to fill. Lots of inputs, but I only need to automate/fill 1 of the inputs.
The problem is that the input names change to a different random number every time the page loads. Furthermore, the position in the form isn't always the same.

There is a string of text that visually identifies what the input is that comes right before the input.
So far the only way that I have found to identify this input is via image recognition, which works. However, sometimes when the page loads, there already is a value in that input that needs to be changed. I am unable to find any way of changing the value of the input since I am using image recognition to get to the input.
I cannot find a different way of identifying the input.
Is there maybe a way to either do one of the following possible solutions:

1. Keystroke logging. If I click on the input, then click the "end" key, then click the "backspace key" 10 times or CTRL+A and "backspace" to clean out the input, and then input my text.

2. Identify the text string that comes before the input, and use it as a base to start counting input tags that come after that string.

Option 2 would be the best, but I don't know how I can do either.

Any ideas?
kingweb
 
Posts: 6
Joined: Mon Sep 24, 2018 9:16 am

Re: Form fill

by chivracq on Mon Sep 24, 2018 10:06 am

kingweb wrote:I am using imacros v8. I know it is a little old, but I have been using it for years, and it serves me well.
I have a little issue which seems almost too easy to not have a solution. There is a form that I need to fill. Lots of inputs, but I only need to automate/fill 1 of the inputs.
The problem is that the input names change to a different random number every time the page loads. Furthermore, the position in the form isn't always the same.

There is a string of text that visually identifies what the input is that comes right before the input.
So far the only way that I have found to identify this input is via image recognition, which works. However, sometimes when the page loads, there already is a value in that input that needs to be changed. I am unable to find any way of changing the value of the input since I am using image recognition to get to the input.
I cannot find a different way of identifying the input.
Is there maybe a way to either do one of the following possible solutions:

1. Keystroke logging. If I click on the input, then click the "end" key, then click the "backspace key" 10 times or CTRL+A and "backspace" to clean out the input, and then input my text.

2. Identify the text string that comes before the input, and use it as a base to start counting input tags that come after that string.

Option 2 would be the best, but I don't know how I can do either.

Any ideas?

Mention your FCI for me to read, (read my Sig...), "imacros v8" is a bit vague, all 4 Browsers have/had a v8 main Version Line...
=> FCIM...! :mrgreen:

No Script posted, => I will only give you some "generic" Answer... :|
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Form fill

by kingweb on Mon Sep 24, 2018 12:24 pm

Hi,
I have v8 scripting edition. It is the standalone version (not the browser add-on).
Windows 7.
kingweb
 
Posts: 6
Joined: Mon Sep 24, 2018 9:16 am

Re: Form fill

by chivracq on Mon Sep 24, 2018 1:17 pm

kingweb wrote:Hi,
I have v8 scripting edition. It is the standalone version (not the browser add-on).
Windows 7.

Hum, OK, => iMB8 then, still a bit vague as there were 4x iMB8 Versions, => iMB v8.03 I reckon which was the "stable" iMB8 Version...

Is "a bit old" indeed, about 6 years old..., you should be able to answer 95% of the Threads on the Forum by now, I would think, if you've been using iMacros for so long...! :o

So, OK..., to answer your Qt..., yep, Option 1 can be done, but it requires the 'EVENT' Mode, which was implemented in iMB (and IE) "only" from v11.x, so that won't work in iMB8.

And from the Info you provided, Option 2 would indeed be the "way to go", by simply using 'Relative Positioning', with your "text string" as 'Anchor'. 8)
('Relative Positioning' is fairly basic/standard iMacros Functionality, a bit "surprising" if you've been using iMacros for 6 years already, if you still haven't "discovered" it yet... :shock: )

And there are probably a few other "Options", but a bit (long and) difficult to explain without any Script and a concrete Example... But 'R-Pos' is probably the best way to go anyway... :wink:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Form fill

by kingweb on Mon Sep 24, 2018 3:43 pm

Thanks for the reply. Sorry to dissapoint you, but I don't use it on a regular basis, and when I use it, I just do what I have needed with it. I never tried to learn how to do things that I haven't needed.

As for the exact version, it is 8.01.
kingweb
 
Posts: 6
Joined: Mon Sep 24, 2018 9:16 am

Re: Form fill

by chivracq on Mon Sep 24, 2018 4:23 pm

kingweb wrote:Thanks for the reply. Sorry to dissapoint you, but I don't use it on a regular basis, and when I use it, I just do what I have needed with it. I never tried to learn how to do things that I haven't needed.

As for the exact version, it is 8.01.

"I just do what I have needed with it."
=> Applies to me as well..., but a simple look/check on the Command Reference (30 Sec needed) already tells you what all Functionality is available in iMacros, and 'R-Pos' belongs to the 'TAG' Command, and it's nearly impossible that you never had in all those years to check "stg" on the 'TAG' Wiki Page... Wondering what was the point to pay around USD 500 (which I think was the Price for iMB v8.x) for a Software and only use 10% of its Functionality, and not be "curious" about what it can do... :shock: But OK, never mind...

iMB v8.01, OK..., v8.03 was the "stable" Version in the v8.x Line..., but I'm not sure if you can still manage to find/download it, the Support Site changed quite a lot when Ipswitch took over iOpus and iMacros...

Would be "nice" once you've managed to get your Script to work if you could confirm that using 'Relative Positioning' was indeed the/a "correct" Solution..., and maybe share your Final Script if that can be useful for other Users... :wink:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Form fill

by kingweb on Tue Sep 25, 2018 7:56 am

Well relative positioning in theory should work, but it isn't working for me.

This is what I have:
Code: Select all
TAG POS=1 TYPE=DIV FORM=NAME:* ATTR=ID:minimum-quantity
TAG POS=R1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:* CONTENT=5


This is the part of the relevant HTML:
Code: Select all
<div class="row bsefr" id="minimum-quantity"><div class="col-md-12 rowContainer">
   <div class="row">
      <div class="col-md-2 rowTitle">
         Minimum-quantity
      </div>
      <div class="col-md-10 rowContent">
         <input name="F159" id="F159" type="text" value="" size="6" class="form-control">
      </div>
   </div>
</div>


The "F159" in the input is variable and changes every time the page loads.

macros keeps giving me the error that it can't find the input.
kingweb
 
Posts: 6
Joined: Mon Sep 24, 2018 9:16 am

Re: Form fill

by chivracq on Tue Sep 25, 2018 8:08 am

kingweb wrote:Well relative positioning in theory should work, but it isn't working for me.

This is what I have:
Code: Select all
TAG POS=1 TYPE=DIV FORM=NAME:* ATTR=ID:minimum-quantity
TAG POS=R1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:* CONTENT=5


This is the part of the relevant HTML:
Code: Select all
<div class="row bsefr" id="minimum-quantity"><div class="col-md-12 rowContainer">
   <div class="row">
      <div class="col-md-2 rowTitle">
         Minimum-quantity
      </div>
      <div class="col-md-10 rowContent">
         <input name="F159" id="F159" type="text" value="" size="6" class="form-control">
      </div>
   </div>
</div>


The "F159" in the input is variable and changes every time the page loads.

macros keeps giving me the error that it can't find the input.

He-he...!, much easier to help you with a Script posted and the URL or Source of the Page...! :D

But, yep, normal...!
Pb is that your 'INPUT' Field is inside the 'DIV' that you are using as Anchor, and will therefore never be found as iMacros then starts to look after it, but not inside...
=> Solution is to use 'Double Relative Positioning'... :idea:
(I've explained the Concept several times already on the Forum...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Form fill

by kingweb on Tue Sep 25, 2018 12:08 pm

I tried the double method. No matter what I do, that input is not being recongnized. Any ideas? It did work for other inputs.
kingweb
 
Posts: 6
Joined: Mon Sep 24, 2018 9:16 am

Re: Form fill

by chivracq on Tue Sep 25, 2018 12:38 pm

kingweb wrote:I tried the double method. No matter what I do, that input is not being recongnized. Any ideas? It did work for other inputs.

Yeah, then post what you tried, you must have made a mistake..., I can't tell you what you are doing wrong if you don't post your Attempts...! :roll:
(But you must be very close...)

And explain to me what 'Double Relative Positioning' means/is and how it works, like if I'm a "Newbie" and don't know what it is...!?
Which other Thread(s) did you use as Reference...?
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Form fill

by kingweb on Tue Sep 25, 2018 12:51 pm

I figured it out, thanks for your help.
kingweb
 
Posts: 6
Joined: Mon Sep 24, 2018 9:16 am

Re: Form fill

by chivracq on Tue Sep 25, 2018 1:32 pm

kingweb wrote:I figured it out, thanks for your help.

Yeah..., but "I figured it out" is not very helpful for other Users if you don't share the Solution...! :roll:

And I had another simpler Solution for you that "only" required the "Single" 'Relative Positioning' Mechanism, but OK, never mind..., glad you got your Script to work...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Form fill

by thecoder2012 on Fri Nov 02, 2018 10:01 am

chivracq wrote:
kingweb wrote:I figured it out, thanks for your help.

Yeah..., but "I figured it out" is not very helpful for other Users if you don't share the Solution...! :roll:

Magic! :wink:
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me!
User avatar
thecoder2012
 
Posts: 248
Joined: Sat Aug 15, 2015 10:14 am
Location: Internet

Re: Form fill

by chivracq on Fri Nov 02, 2018 12:33 pm

thecoder2012 wrote:
chivracq wrote:
kingweb wrote:I figured it out, thanks for your help.

Yeah..., but "I figured it out" is not very helpful for other Users if you don't share the Solution...! :roll:

Magic! :wink:

Yeah, LOL...! It wasn't Halloween though yet then...!? :?

But I "hate" those "I figured it out" Answers..., I usually help such Users once only..., too bad for "the next time" if they can't share their Solution... :roll:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: Majestic-12 [Bot] and 9 guests

-->