**SOLVED** Website not recognizing data entry

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

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.

**SOLVED** Website not recognizing data entry

by Tang on Thu Feb 01, 2018 10:44 am

Good Afternoon All,

I'm using iMacros V11.0.246.4051 on a PC running Windows 7 Enterprise.

I came across a curious problem that I haven’t encountered before, and I wondered if someone here may have a look? I put together a macro that will complete an online form for a list of objects from Excel. The website recently updated, which in and of itself isn't the problem, but the update did bring with it a feature I haven't seen before.

The “sign in” button on the home page only activates after the username and password have been entered. If you type them manually it works perfectly, however, the data entry from the macro is not recognized. The user name and passwords will both populate just fine, but the “sign in” button fails to operate. Have you seen this before? Any idea what the work around might be?

The site is: https://nmvtisreporting.aamva.org

While I understand you will not have a login, you shouldn't need it to get the macro to successfully attempt a sign in. The code I'm currently using is:

Code: Select all
Sub OpenNMVTIS()
Set objImac = CreateObject("iMacros")

iret = objImac.iimInit("")

 strScript = "CODE:"
 strScript = strScript & "TAB T=1" + vbNewLine
 strScript = strScript & "TAB CLOSEALLOTHERS" + vbNewLine
 strScript = strScript & "SET !ENCRYPTION NO" + vbNewLine
 strScript = strScript & "URL GOTO=https://nmvtisreporting.aamva.org/Login.aspx?ReturnURL=%2fwelcome.aspx"
 iret = objImac.iimPlay(strScript)

 strScript = "CODE:"
 strScript = strScript & "TAB T=1" + vbNewLine
 strScript = strScript & "TAB CLOSEALLOTHERS" + vbNewLine
 iret = objImac.iimPlay(strScript)

End Sub

Sub LogIn()

 strScript = strScript & "TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:ReportingEntityID CONTENT=" & strUser + vbNewLine
 iret = objImac.iimPlay(strScript)

 strScript = strScript & "TAG POS=1 TYPE=INPUT:PASSWORD ATTR=NAME:Password CONTENT=" & strPW + vbNewLine
 iret = objImac.iimPlay(strScript)

 strScript = strScript & "TAG POS=1 TYPE=BUTTON:SUBMIT ATTR=TXT:Sign<SP>in" & vbNewLine
 iret = objImac.iimPlay(strScript)


Thanks in advance!

James
Last edited by Tang on Thu Feb 01, 2018 12:40 pm, edited 1 time in total.
Tang
 
Posts: 4
Joined: Thu Feb 01, 2018 10:35 am

Re: Website not recognizing data entry

by Tang on Thu Feb 01, 2018 11:40 am

Sorry, I'll add the code directly from the iMacros Editor to make it easier.

Code: Select all
VERSION BUILD=11.0.246.4051
TAB T=1
TAB CLOSEALLOTHERS
SET !PLAYBACKDELAY 0.2
URL GOTO=https://nmvtisreporting.aamva.org/Login
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:ReportingEntityID CONTENT=Sample
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD ATTR=NAME:Password CONTENT=Not Real
TAG POS=1 TYPE=BUTTON:SUBMIT ATTR=TXT:Sign<SP>in


While the username and passwords are obviously not real, they'll work for what I'm attempting to show you. If you typed those words in the fields the sign in button would allow a click. If you run the macro it won't. They'll update, but it's like the site didn't recognize it. Hopefully I'm explaining this ok.

James
Tang
 
Posts: 4
Joined: Thu Feb 01, 2018 10:35 am

Re: Website not recognizing data entry

by chivracq on Thu Feb 01, 2018 11:54 am

Tang wrote:Good Afternoon All,

I'm using
Code: Select all
iMacros V11.0.246.4051 on a PC running Windows 7 Enterprise.


I came across a curious problem that I haven’t encountered before, and I wondered if someone here may have a look? I put together a macro that will complete an online form for a list of objects from Excel. The website recently updated, which in and of itself isn't the problem, but the update did bring with it a feature I haven't seen before.

The “sign in” button on the home page only activates after the username and password have been entered. If you type them manually it works perfectly, however, the data entry from the macro is not recognized. The user name and passwords will both populate just fine, but the “sign in” button fails to operate. Have you seen this before? Any idea what the work around might be?

The site is: https://nmvtisreporting.aamva.org

While I understand you will not have a login, you shouldn't need it to get the macro to successfully attempt a sign in. The code I'm currently using is:

Code: Select all
Sub OpenNMVTIS()
Set objImac = CreateObject("iMacros")

iret = objImac.iimInit("")

 strScript = "CODE:"
 strScript = strScript & "TAB T=1" + vbNewLine
 strScript = strScript & "TAB CLOSEALLOTHERS" + vbNewLine
 strScript = strScript & "SET !ENCRYPTION NO" + vbNewLine
 strScript = strScript & "URL GOTO=https://nmvtisreporting.aamva.org/Login.aspx?ReturnURL=%2fwelcome.aspx"
 iret = objImac.iimPlay(strScript)

 strScript = "CODE:"
 strScript = strScript & "TAB T=1" + vbNewLine
 strScript = strScript & "TAB CLOSEALLOTHERS" + vbNewLine
 iret = objImac.iimPlay(strScript)

End Sub

Sub LogIn()

 strScript = strScript & "TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:ReportingEntityID CONTENT=" & strUser + vbNewLine
 iret = objImac.iimPlay(strScript)

 strScript = strScript & "TAG POS=1 TYPE=INPUT:PASSWORD ATTR=NAME:Password CONTENT=" & strPW + vbNewLine
 iret = objImac.iimPlay(strScript)

 strScript = strScript & "TAG POS=1 TYPE=BUTTON:SUBMIT ATTR=TXT:Sign<SP>in" & vbNewLine
 iret = objImac.iimPlay(strScript)


Thanks in advance!

James

Hum..., I can't really have a look at your Site as I don't come any further than some "Loading Single VIN Reporting Service" being displayed and the Site keeps "trying" to load further forever... (Tried in 2 Browsers, PM v26.3.3 + FF v55.0.3, same Results...)

But OK, this Site looks like it is completely being retrieved/generated on the fly from JavaScript, I would suggest you try filling in the 2 Login & Password Fields using the 'EVENT' Mode which usually gets more easily "perceived" as "Human" by Web-Sites like your Page and that 'Login' Button that will wait before activating until it has recognized some "manual"/"human" Entry in those 2 Fields.

Your Script looks a bit strange to me btw, you've split it into 3 parts but when playing Part_3, you replay Part_2 with it...
It's not a big deal, as Part_2 only contains a 'TABCLOSEALLOTHERS' (which was already contained in Part_1 btw...), but that means that the 'TABCLOSEALLOTHERS' Command gets fired 3x times in total, ah-ah...!

>>>

EDIT: Fouff...!, the Page finally managed to load after maybe 10 min, ah-ah...! :shock:

And indeed, the 'EVENT' Mode works fine then:
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'URL GOTO=https://nmvtisreporting.aamva.org/Login

'Fill in Login & Password with 'TAG' Mode. (Doesn't work...!):
'TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:txtReportingEntityID CONTENT=ert
'SET !ENCRYPTION NO
'TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:NoFormName ATTR=ID:txtPassword CONTENT=fgh

'Fill in Login& Password with 'EVENT' Mode. (Works OK...!):
'EVENT TYPE=CLICK SELECTOR="#txtReportingEntityID" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#txtReportingEntityID" CHARS="hjk"
'EVENT TYPE=CLICK SELECTOR="#txtPassword" BUTTON=0
SET !ENCRYPTION NO
EVENTS TYPE=KEYPRESS SELECTOR="#txtPassword" CHARS="hjkh"
(Tested on iMacros for FF v8.8.2, PM v26.3.3 (=FF47), Win10_x64.)

You will probably need to escape the Double Quotes of the 'SELECTOR' for the on-the-fly Macro in your '.vbs' Script, or you can probably simply remove them as I think they are not needed...
- (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: 6957
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Website not recognizing data entry

by Tang on Thu Feb 01, 2018 12:39 pm

chivracq, I owe you for this one! I hadn't recorded a macro using the event mode, worked like a charm!
Tang
 
Posts: 4
Joined: Thu Feb 01, 2018 10:35 am

Re: Website not recognizing data entry

by chivracq on Thu Feb 01, 2018 1:42 pm

Tang wrote:chivracq, I owe you for this one! I hadn't recorded a macro using the event mode, worked like a charm!

OK, good to hear... (that it works!)... :D

And, yep, the 'EVENT' Mode (now supported on all Browsers) is usually one of the first "things" to try, especially with Ajaxy and on-the-fly from JS generated Sites like this one..., which is a bit "extreme" btw as the whole Site is completely dynamically generated from JS... This seems to become the Tendency more and more in Web-Development, but I'm not sure it's a "good" Evolution as it forces a completely new "Cat & Mouse" Game between Web-Developers and Users who want to know/check what those Pages actually do, hidden in the background...

Hum..., and I hope you noticed my Remark about how you build your Script for the on-the-fly '.iim' Macro(s)... It might still work correctly and you probably don't notice any Difference, but it's currently not completely "neat and clean"... :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: 6957
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Website not recognizing data entry

by Tang on Thu Feb 01, 2018 2:27 pm

chivracq wrote:
Tang wrote:chivracq, I owe you for this one! I hadn't recorded a macro using the event mode, worked like a charm!

OK, good to hear... (that it works!)... :D

And, yep, the 'EVENT' Mode (now supported on all Browsers) is usually one of the first "things" to try, especially with Ajaxy and on-the-fly from JS generated Sites like this one..., which is a bit "extreme" btw as the whole Site is completely dynamically generated from JS... This seems to become the Tendency more and more in Web-Development, but I'm not sure it's a "good" Evolution as it forces a completely new "Cat & Mouse" Game between Web-Developers and Users who want to know/check what those Pages actually do, hidden in the background...

Hum..., and I hope you noticed my Remark about how you build your Script for the on-the-fly '.iim' Macro(s)... It might still work correctly and you probably don't notice any Difference, but it's currently not completely "neat and clean"... :wink:


This is all great information!

I definitely noticed the comment about my coding redundancies. I still have a lot to learn about adapting macros to work in vba, but tips like yours make me better each time. I did get rid of the triple run command in my vba code, and was able to use the same tip to clean up some other areas as well :D
Tang
 
Posts: 4
Joined: Thu Feb 01, 2018 10:35 am

Re: Website not recognizing data entry

by chivracq on Thu Feb 01, 2018 2:50 pm

Tang wrote:This is all great information!

I definitely noticed the comment about my coding redundancies. I still have a lot to learn about adapting macros to work in vba, but tips like yours make me better each time. I did get rid of the triple run command in my vba code, and was able to use the same tip to clean up some other areas as well :D

:D
- (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: 6957
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: Google [Bot] and 8 guests

-->