Unable to create a simple login script. Please HELP

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
bobonew
Posts: 3
Joined: Sat Sep 05, 2015 3:27 am

Unable to create a simple login script. Please HELP

Post by bobonew » Sat Sep 05, 2015 3:50 am

Hi,

I'm trying to create a simple login script. Every time I use the Record feature to create the Macro, I get this same script that is created. When I run, the script, however, I receive the following error: RuntimeError: element INPUT specified by ID:Username was not found, line 6 (Error code: -921). Having looked through the forums, I've also tried to change the script so that it only looks at input, rather than INPUT:TEXT and tried various other Tag combinations to no avail. Any help with this is greatly appreciated.

I've tried this using Firefox 40.0.3 and Google Chrome 45.0.2454.85 m on Windows 7 and get the same error for both.

The website where I'm trying to login is: http://www.princetonreview.com/. Then click Sign In, and then enter values for username and password. It doesn't seem to be able to find the username field box for some reason when rerunning the macro...

The script created from running "Record" is:

Code: Select all

VERSION BUILD=8920312 RECORDER=FX
TAB T=1
URL GOTO=http://www.princetonreview.com/
TAG POS=1 TYPE=SPAN ATTR=TXT:Sign<SP>In
FRAME F=3
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/account/signin?modal=1 ATTR=ID:Username CONTENT=testval
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/account/signin?modal=1 ATTR=ID:Password CONTENT=testval2
Also, yes, the sample macros do work on my system. I checked.

Again, any help is greatly appreciated. Thank you.
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to create a simple login script. Please HELP

Post by chivracq » Sat Sep 05, 2015 1:43 pm

bobonew wrote:Hi,

I'm trying to create a simple login script. Every time I use the Record feature to create the Macro, I get this same script that is created. When I run, the script, however, I receive the following error:

Code: Select all

RuntimeError: element INPUT specified by ID:Username was not found, line 6 (Error code: -921). 
Having looked through the forums, I've also tried to change the script so that it only looks at input, rather than INPUT:TEXT and tried various other Tag combinations to no avail. Any help with this is greatly appreciated.

I've tried this using Firefox 40.0.3 and Google Chrome 45.0.2454.85 m on Windows 7 and get the same error for both.

The website where I'm trying to login is: http://www.princetonreview.com/. Then click Sign In, and then enter values for username and password. It doesn't seem to be able to find the username field box for some reason when rerunning the macro...

The script created from running "Record" is:

Code: Select all

VERSION BUILD=8920312 RECORDER=FX
TAB T=1
URL GOTO=http://www.princetonreview.com/
TAG POS=1 TYPE=SPAN ATTR=TXT:Sign<SP>In
FRAME F=3
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/account/signin?modal=1 ATTR=ID:Username CONTENT=testval
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/account/signin?modal=1 ATTR=ID:Password CONTENT=testval2
Also, yes, the sample macros do work on my system. I checked.

Again, any help is greatly appreciated. Thank you.
Works fine for me if I add a mini-WAIT Statement:

Code: Select all

VERSION BUILD=8920312 RECORDER=FX
TAB T=1
URL GOTO=http://www.princetonreview.com/
TAG POS=1 TYPE=SPAN ATTR=TXT:Sign<SP>In
WAIT SECONDS=3

FRAME F=3
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/account/signin?modal=1 ATTR=ID:Username CONTENT=testval
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/account/signin?modal=1 ATTR=ID:Password CONTENT=testval2
(Tested on iMacros for FF v8.8.2, Pale Moon v24.6.2 (=FF31), Win7-x64.)
- (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...
bobonew
Posts: 3
Joined: Sat Sep 05, 2015 3:27 am

Re: Unable to create a simple login script. Please HELP

Post by bobonew » Sat Sep 05, 2015 9:38 pm

Hi chivracq,

Thank you for your quick response. I had tried using WAIT before, and also tried the code that you posted but it still doesn't seem to work on either Firefox or Google Chrome. I'm using iMacros 8.9.2.1-signed from the mozilla add on site for Firefox and v8.3.4 for Google chrome from the Web Store. I am also on a Windows 7 x64 bit machine.

I get the same error using the code you posted:
RuntimeError: element INPUT specified by ID:Username was not found, line 8 (Error code: -921)
I really don't understand what is going wrong. Is it because you are using older versions? Thanks for your help so far and any further insight would be, of course, greatly appreciated.
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to create a simple login script. Please HELP

Post by chivracq » Sun Sep 06, 2015 12:10 pm

Hum, I manage to get it ("my" Script) to work on both PM and plain FF40, but I notice that the Frame Number sometimes changes between F=2 and F=3, so try this one:

Code: Select all

VERSION BUILD=8920312 RECORDER=FX
SET !ERRORIGNORE YES

TAB T=1
URL GOTO=http://www.princetonreview.com/
TAG POS=1 TYPE=SPAN ATTR=TXT:Sign<SP>In
WAIT SECONDS=3

SET !TIMEOUT_STEP 0
FRAME F=2
'FRAME NAME="*actionFrame*"
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/account/signin?modal=1 ATTR=ID:Username CONTENT=testval
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/account/signin?modal=1 ATTR=ID:Password CONTENT=testval2

FRAME F=3
'FRAME NAME="*actionFrame*"
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/account/signin?modal=1 ATTR=ID:Username CONTENT=testval
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/account/signin?modal=1 ATTR=ID:Password CONTENT=testval2
(Tested on iMacros for FF v8.8.2, Pale Moon v24.6.2 (=FF31), Win7-x64. and iMacros for FF v8.9.4, FF v40.0.3, Win7-x64.)
- (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...
bobonew
Posts: 3
Joined: Sat Sep 05, 2015 3:27 am

Re: Unable to create a simple login script. Please HELP

Post by bobonew » Mon Sep 07, 2015 2:58 am

Hi chivracq,

Yes, the code you posted worked!! Thanks for all of your help!
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to create a simple login script. Please HELP

Post by chivracq » Mon Sep 07, 2015 6:53 am

bobonew wrote:Hi chivracq,

Yes, the code you posted worked!! Thanks for all of your help!
OK, good to hear..., and glad I could help...! :D
- (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...
viking
Posts: 243
Joined: Sun Mar 16, 2008 7:22 am

Re: Unable to create a simple login script. Please HELP

Post by viking » Sun Jun 19, 2016 9:07 pm

@chivracq,
What did you mean by

Code: Select all

'FRAME NAME="*actionFrame*"
It is commented out, so I don't think it would work?
Maybe the new script worked because you changed from
Frame F=3
to
Frame F=2

(I have similar issue where Frame F=4 or Frame F=5.
I solved it crudely by

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
Frame F=4
"some code to set values in a form"
Frame F=5
"some code to set values in a form"
If Frame F=4 is correct, the code that follows will execute, but code below FRAME F=5 is ignored, and vice versa)
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to create a simple login script. Please HELP

Post by chivracq » Mon Jun 20, 2016 3:49 am

viking wrote:@chivracq,
What did you mean by

Code: Select all

'FRAME NAME="*actionFrame*"
It is commented out, so I don't think it would work?
Maybe the new script worked because you changed from
Frame F=3
to
Frame F=2

(I have similar issue where Frame F=4 or Frame F=5.
I solved it crudely by

Code: Select all

SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
Frame F=4
"some code to set values in a form"
Frame F=5
"some code to set values in a form"
If Frame F=4 is correct, the code that follows will execute, but code below FRAME F=5 is ignored, and vice versa)
Yep, exactly what you understood, the ''FRAME NAME="*actionFrame*' (commented out) was what I had recorded, even if 'actionFrame' doesn't look like a Dynamic Frame_Name to me, which I replaced with F=2/3/4 whatever worked for this Case...

But your Solution to try with 'F=4' + 'F=5' or whatever, is indeed the "crude" way to go, with '!ERRORIGNORE' of course..., there is another way, I published a few months ago a very elegant Solution (that against my "Expectations" got completely unnoticed, even if I've re-mentioned it 2x or 3x since..., dunno, there is no "Sorcery" just some little Logical Thinking, very easy Logical Solution, I would think...) to deal with everything which is Dynamic, ID/Name, can very easily be applied to FRAME_NAME/Nb..., search my Posts for "Dynamic + elegant" and you'll find it...
Last edited by chivracq on Mon Jun 20, 2016 4:03 am, edited 1 time in total.
- (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...
chivracq
Posts: 9374
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to create a simple login script. Please HELP

Post by chivracq » Mon Jun 20, 2016 3:59 am

Adding to my previous Reply...:
What did you mean by

Code: Select all

'FRAME NAME="*actionFrame*"
It is commented out, so I don't think it would work?
No, I guess I had tried it but it didn't work...
=> I don't think you can use Wildcards with Frame Names... (At least in Sepb 2015, when I had done some digging for the OP...)
=> There is some EnhReq about using Wildcard with Frame_Names, pfff, not sure if it's been honored by Dev, I think not...!
- (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