Can't submit form, input not detected

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 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
Franckich33
Posts: 5
Joined: Mon Jun 22, 2020 8:48 pm

Can't submit form, input not detected

Post by Franckich33 » Tue Jun 23, 2020 9:45 am

Hello,

I'm new to iMacros, I was using UiVision before and first of all, I'd like to say iMacros is much better ;)

I have an issue with iMacros for Firefox (same issue with Chrome), when I fill an input, it is filled but it seems that the form cannot detect it, there is an error message saying that the input is mandatory but I can see it filled ... the URL of

When I try manually (for exemple by adding a space after the input value then delete it), the error message disappear.
70086fb3-6171-421e-ae44-6c429b83a05c.png
70086fb3-6171-421e-ae44-6c429b83a05c.png (5.15 KiB) Viewed 847 times
We can also see that the placeholder doesn't disappear like if the form doesn't detect that there is something in the field Do you know where can this come from ? I think it's because the form is a js included (you can see below the URL and check the source).

Thank you very much :).

VERSION BUILD=10021450
Firefox 77.0.1 64 bits
OS Windows 10
URL : https://esta.cbp.dhs.gov/, click on Create New Application, then Individual Application, then "Yes, I have read etc..", then "Yes, I have read etc..", then Next. The form I'm trying to submit is the one with Family Name, First Name, Gender, etc.

Macro :

Code: Select all

VERSION BUILD=10021450

URL GOTO=https://esta.cbp.dhs.gov/
TAG POS=1 TYPE=A ATTR=ID:lang-fr
TAG XPATH=/html/body/app-root/div/app-header/div/nav/div/div[2]/ul/li[2]/ul/li[1]

'Sometimes, a popup appears
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 1
TAG POS=1 TYPE=BUTTON ATTR=ID:confirmBtn
SET !ERRORIGNORE NO

TAG XPATH=/html/body/app-root/div/div[1]/app-disclaimer/div/div[1]/div[1]/div[2]/div/div/div[1]/label/span[4]
TAG XPATH=/html/body/app-root/div/div[1]/app-disclaimer/div/div[1]/div[2]/div[2]/div/div/div[1]/label/span[4]
TAG XPATH=/html/body/app-root/div/div[1]/app-disclaimer/div/app-form-nav/div/div[4]/button


''''''''''''''''''''''''''''''''''''''''''''''''''''''' #PAGE 1

'''''' DEMANDEUR / DONNEES PASSEPORT 

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:applicantLastName CONTENT="LAST"
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:applicantFirstName CONTENT="FIRST"
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:gender CONTENT=%M

TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:day_birthday CONTENT=%17
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:month_birthday CONTENT=%2
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:year_birthday CONTENT=%1994

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:birthCity CONTENT="PARIS"
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:birthCountry CONTENT=%FR
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:passportNum CONTENT="AACC11111"
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:citizenshipCountry CONTENT=%FR

'''' DATES PASSEPORT
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:day_issueDate CONTENT=%27
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:month_issueDate CONTENT=%9
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:year_issueDate CONTENT=%2018
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:day_expDate CONTENT=%26
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:month_expDate CONTENT=%9
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:year_expDate CONTENT=%2028

TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:issueCountry CONTENT=%FR

' Êtes-vous à présent citoyen ou ressortissant d'un autre pays ?
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:currentCitizenshipSwitch CONTENT=%N
' Avez-vous été citoyen ou ressortissant d'un autre pays ?
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:pastCitizenshipSwitch CONTENT=%N




TAG POS=1 TYPE=INPUT ATTR=NAME:contactEmail CONTENT="mail@mail.com"
TAG POS=1 TYPE=INPUT ATTR=NAME:contactEmailConfirm CONTENT="mail@mail.com"

TAG XPATH=/html/body/app-root/div/div[1]/app-applicant-info/div[1]/div/form/app-form-nav/div/div[4]/button
Franckich33
Posts: 5
Joined: Mon Jun 22, 2020 8:48 pm

Re: Can't submit form, input not detected

Post by Franckich33 » Mon Jun 29, 2020 11:58 am

Anyone ? I’m really stuck with this issue :(
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't submit form, input not detected

Post by chivracq » Mon Jun 29, 2020 3:30 pm

Franckich33 wrote:
Tue Jun 23, 2020 9:45 am
Hello,

I'm new to iMacros, I was using UiVision before and first of all, I'd like to say iMacros is much better ;)

I have an issue with iMacros for Firefox (same issue with Chrome), when I fill an input, it is filled but it seems that the form cannot detect it, there is an error message saying that the input is mandatory but I can see it filled ... the URL of

When I try manually (for exemple by adding a space after the input value then delete it), the error message disappear.

70086fb3-6171-421e-ae44-6c429b83a05c.png

We can also see that the placeholder doesn't disappear like if the form doesn't detect that there is something in the field Do you know where can this come from ? I think it's because the form is a js included (you can see below the URL and check the source).

Thank you very much :).

Code: Select all

VERSION BUILD=10021450
Firefox 77.0.1 64 bits
OS Windows 10
URL : https://esta.cbp.dhs.gov/, click on Create New Application, then Individual Application, then "Yes, I have read etc..", then "Yes, I have read etc..", then Next. The form I'm trying to submit is the one with Family Name, First Name, Gender, etc.

Macro :

Code: Select all

VERSION BUILD=10021450

URL GOTO=https://esta.cbp.dhs.gov/
TAG POS=1 TYPE=A ATTR=ID:lang-fr
TAG XPATH=/html/body/app-root/div/app-header/div/nav/div/div[2]/ul/li[2]/ul/li[1]

'Sometimes, a popup appears
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 1
TAG POS=1 TYPE=BUTTON ATTR=ID:confirmBtn
SET !ERRORIGNORE NO

TAG XPATH=/html/body/app-root/div/div[1]/app-disclaimer/div/div[1]/div[1]/div[2]/div/div/div[1]/label/span[4]
TAG XPATH=/html/body/app-root/div/div[1]/app-disclaimer/div/div[1]/div[2]/div[2]/div/div/div[1]/label/span[4]
TAG XPATH=/html/body/app-root/div/div[1]/app-disclaimer/div/app-form-nav/div/div[4]/button


''''''''''''''''''''''''''''''''''''''''''''''''''''''' #PAGE 1

'''''' DEMANDEUR / DONNEES PASSEPORT 

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:applicantLastName CONTENT="LAST"
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:applicantFirstName CONTENT="FIRST"
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:gender CONTENT=%M

TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:day_birthday CONTENT=%17
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:month_birthday CONTENT=%2
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:year_birthday CONTENT=%1994

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:birthCity CONTENT="PARIS"
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:birthCountry CONTENT=%FR
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:passportNum CONTENT="AACC11111"
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:citizenshipCountry CONTENT=%FR

'''' DATES PASSEPORT
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:day_issueDate CONTENT=%27
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:month_issueDate CONTENT=%9
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:year_issueDate CONTENT=%2018
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:day_expDate CONTENT=%26
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:month_expDate CONTENT=%9
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:year_expDate CONTENT=%2028

TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:issueCountry CONTENT=%FR

' Êtes-vous à présent citoyen ou ressortissant d'un autre pays ?
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:currentCitizenshipSwitch CONTENT=%N
' Avez-vous été citoyen ou ressortissant d'un autre pays ?
TAG POS=1 TYPE=SELECT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:pastCitizenshipSwitch CONTENT=%N

TAG POS=1 TYPE=INPUT ATTR=NAME:contactEmail CONTENT="mail@mail.com"
TAG POS=1 TYPE=INPUT ATTR=NAME:contactEmailConfirm CONTENT="mail@mail.com"

TAG XPATH=/html/body/app-root/div/div[1]/app-applicant-info/div[1]/div/form/app-form-nav/div/div[4]/button
Franckich33 wrote:
Mon Jun 29, 2020 11:58 am
Anyone ? I’m really stuck with this issue :(

Oh yep, sorry...!, I had seen your Thread (when I had approved it), but I have very "difficult" Access to Internet since about 10 days, so I "forgot" a bit about your Thread..., and hum, I had quickly tried to have a look at the Site, ... which refused to load (in PM v26.3.3) because I'm "allergic" to Captcha and I apparently have blocked their Captcha Script, so I quickly "gave up"... :twisted:

Hum, FCI mentioned, perfect..., but 'Free'/'PE is still missing...(?), and I see you've hard-coded all Input Values to fill in the Form, but I would think you'll probably want to use some '.CSV' DataSource, but that Functionality is only supported in the 'PE' Version...

>>>

But OK, even without being able to check this Site, it looks like all Content gets dynamically generated from some Background JS Scripts, with a lot of Background/Real-Time JS Validation, and for that kind of Sites/HTML Elements, the 'EVENT' Mode is often the easiest or only Mode that can handle those Elements... :idea:

But the 'EVENT' Mode is not supported/implemented (anymore/yet...?) in v10.0.2 for FF that you are using... :(
=> Any Chance you can try on CR using iMacros for CR v10.0.5 ('Free'/'PE') using the 'EVENT' Mode for the "difficult" Field(s)...?, as I see you've mentioned CR in your Thread in the 'Consultants' Sub-Forum... (Correct Spelling is "iMacros" btw, and you may want to include some "Way" to contact you, PM is not enabled on this Forum...)
(And if you have the 'PE' Version for v10.0.2 for FF, the same 'PE' License is also valid for v10.0.5 for CR, so you will also automatically have the 'PE' Version for CR...)
- (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...
Franckich33
Posts: 5
Joined: Mon Jun 22, 2020 8:48 pm

Re: Can't submit form, input not detected

Post by Franckich33 » Mon Jun 29, 2020 5:05 pm

Hello,

Thank you for your answer. I tried with event, and it seems to work. I'm gonna have to watch tuto about event with iMacros because I don't really know how that works.

Just so I know I'm on a good path, is this right if I replace

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:applicantLastName CONTENT="LAST"
'

With

Code: Select all

EVENT TYPE=CLICK SELECTOR="#applicantLastName" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#applicantLastName" CHARS="LAST"
'

This seems to work, but if I remove "EVENT TYPE=CLICK SELECTOR="#applicantLastName" BUTTON=0", this does not work anymore.

Well, thank you very much, I can now look deeper into this :)
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't submit form, input not detected

Post by chivracq » Mon Jun 29, 2020 5:38 pm

Franckich33 wrote:
Mon Jun 29, 2020 5:05 pm
Hello,

Thank you for your answer. I tried with event, and it seems to work. I'm gonna have to watch tuto about event with iMacros because I don't really know how that works.

Just so I know I'm on a good path, is this right if I replace

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://esta.cbp.dhs.gov/applicantInfo ATTR=ID:applicantLastName CONTENT="LAST"
'

With

Code: Select all

EVENT TYPE=CLICK SELECTOR="#applicantLastName" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#applicantLastName" CHARS="LAST"
'

This seems to work, but if I remove "EVENT TYPE=CLICK SELECTOR="#applicantLastName" BUTTON=0", this does not work anymore.

Well, thank you very much, I can now look deeper into this :)

Alright, good to hear..., and, yep-yep, your 2nd mini-Script with the 2 'EVENT' Statements looks fine to me..., well, this is what iMacros must have recorded itself for that Action... :wink:

And "funny", but I was indeed going to mention that the 'CLICK' Statement is probably not needed (even if it gets recorded), but apparently this Site has "a lot" of Real-Time JS Validation, and needs the "manual" Click in the Input Field to kind of "activate" it... Fair enough... :|
- (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...
Franckich33
Posts: 5
Joined: Mon Jun 22, 2020 8:48 pm

Re: Can't submit form, input not detected

Post by Franckich33 » Tue Jun 30, 2020 2:37 pm

Well, after some tests, it looks like using EVENT / EVENTS will be a bit complicated, some issues / bug appears.

For example, this code :

Code: Select all

EVENT TYPE=CLICK SELECTOR="#applicantLastName" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#applicantLastName" CHARS="LAST"

EVENT TYPE=CLICK SELECTOR="#applicantFirstName" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#applicantFirstName" CHARS="FIRST"
Generate a bug :
Capture.JPG
And it is the same for other input ...

Is there any way to use TAG instead ? That's why I was looking for a consultant, as it seems a bit tricky.

Thank you :)
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't submit form, input not detected

Post by chivracq » Tue Jun 30, 2020 10:05 pm

Franckich33 wrote:
Tue Jun 30, 2020 2:37 pm
Well, after some tests, it looks like using EVENT / EVENTS will be a bit complicated, some issues / bug appears.

For example, this code :

Code: Select all

EVENT TYPE=CLICK SELECTOR="#applicantLastName" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#applicantLastName" CHARS="LAST"

EVENT TYPE=CLICK SELECTOR="#applicantFirstName" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#applicantFirstName" CHARS="FIRST"
Generate a bug :

Capture.JPG

And it is the same for other input ...

Is there any way to use TAG instead ? That's why I was looking for a consultant, as it seems a bit tricky.

Thank you :)

Yep, not surprised..., but hum, if you call that a "Bug", then you have to complain to the Web-Site itself, it's a bit clear that iMacros only tries to input the "correct" LastName/FirstName in the corresponding Input Fields..., if stg else happens, it comes from the Site... :|

This Site is a bit "paranoid" against Web-Automation, like I had mentioned, I couldn't even just load their Home Page without already having to fill in a Captcha..., which I could easily circumvent, but tja, that already says "stg" about this Site not willing to be "automated"... :shock:

But hum, you could still add a mini-'WAIT' Statement between the 2 Fields, that might give the Site a bit more time "to accept and validate" the Content for the first Field... :idea:
- (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...
Tom, Tech Support
Posts: 3601
Joined: Mon May 31, 2010 4:59 pm

Re: Can't submit form, input not detected

Post by Tom, Tech Support » Thu Jul 02, 2020 2:47 pm

chivracq wrote:
Tue Jun 30, 2020 10:05 pm
But hum, you could still add a mini-'WAIT' Statement between the 2 Fields, that might give the Site a bit more time "to accept and validate" the Content for the first Field... :idea:

I found that these two fields are filled correctly and consistently for me even when playing back without any delays.

But yes, it is most likely a timing issue and I would agree that you may need to insert a WAIT statement between the EVENT TYPE=CLICK and EVENTS TYPE=KEYPRESS commands, so that the CLICK command has enough time to "activate" the field before attempting to enter the data.

You can also try adding SET !PLAYBACKDELAY 0.5 to the beginning of the macro to slow the whole thing down a bit.
Regards,

Tom, iMacros Support
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't submit form, input not detected

Post by chivracq » Thu Jul 02, 2020 3:14 pm

Tom, Tech Support wrote:
Thu Jul 02, 2020 2:47 pm
chivracq wrote:
Tue Jun 30, 2020 10:05 pm
But hum, you could still add a mini-'WAIT' Statement between the 2 Fields, that might give the Site a bit more time "to accept and validate" the Content for the first Field... :idea:

I found that these two fields are filled correctly and consistently for me even when playing back without any delays.

But yes, it is most likely a timing issue and I would agree that you may need to insert a WAIT statement between the EVENT TYPE=CLICK and EVENTS TYPE=KEYPRESS commands, so that the CLICK command has enough time to "activate" the field before attempting to enter the data.

You can also try adding SET !PLAYBACKDELAY 0.5 to the beginning of the macro to slow the whole thing down a bit.

Oh..., yep, you're right...! I "only" mentioned a mini-'WAIT' between the 2 Fields, but for each Field another mini-'WAIT' between the 'CLICK' and the 'KEYPRESS' would also indeed allow more time for the 'CLICK' to "activate" the Field, as for this Site the 'CLICK' seems to be needed, which is quite unusual, for most Sites, the 'CLICK' Statement recorded by iMacros is usually not necessary...

Or use indeed the '!PLAYBACKDELAY' Command, which is "New" in the v10.0.x Versions for CR & FF, + v12.6 for IE and iMB... (and that I've never used, so I never think about it, ah-ah...!). 8)
- (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...
Post Reply