Jump to content

Ie Pop Up Username Password Box


Recommended Posts

Im making a script to naviagte to a website and enter username and password.

The problem im having is it will navigate to website but when the IE box pops up asking for username and pass it doesnt do anything.

here is my code.

#include <ie.au3>

$username = "username"

$password = "pass"

BlockInput (1)

$oIE = _IECreate()

WinSetState("about:blank - Microsoft Internet Explorer", "", @SW_MAXIMIZE)

_IENavigate($oIE, "https://website.com")

WinWaitActive ( "Connect to website.com", "&User name" )

ControlSetText ( "Connect to website.com", "&User name", "Edit2", $username )

ControlSetText ( "Connect to website.com", "&User name", "Edit3", $password )

ControlClick ( "Connect to website.com", "&User name", "Button2" )

BlockInput(0)

Exit

Link to comment
Share on other sites

Instead of trying the Control...() Functions, try _IEForm...()

_IEFormGetObjByIndex()
    Obtain an object variable reference to a form by 0-based index
    
    _IEFormGetObjByName()
    Obtain an object variable reference to a form by name
    
    _IEFormElementGetObjByIndex()
    Obtain a object reference to a form element within a form by 0-based index
    
    _IEFormElementGetObjByName()
    Obtain a object reference to a form element within a form by name

    _IEFormElementGetValue()
    Get the value of a specifid form element
    
    _IEFormElementSetValue()
    Set the value of a specified form element
    
    _IEFormSubmit()
    Submit a specified form

Those should work for you. IE.au3 is a wonderful file.

Sparkes.

Edited by Andrew Sparkes

---Sparkes.

Link to comment
Share on other sites

I am not sure. I have never used it for .htaccess pages... If your code isn't working, double and triple check that you have the right params for the Control...() functions. Perhaps your could try ControlSend() ... That may work...

Other than that, I'm afraid I can't help you...

It would be a nice feature of the new build of IE.au3 to see it able to fix your problem...

Sparkes.

EDIT: Typo

Edited by Andrew Sparkes

---Sparkes.

Link to comment
Share on other sites

just to let everyone who doesnt know already this is what i found out.

The _IENavigate function is set to wait till page loads completly before going to next line in script?

$f_wait - 1 = wait for page load to complete before returning

; - 0 = return immediately

well on the _IENavigate line i just set it this way

_IENavigate($oIE, "https://website.com", 0)

and after it went to webpage it automatically went to the winwaitactive line which was next in the script.

Link to comment
Share on other sites

just to let everyone who doesnt know already this is what i found out.

The _IENavigate function is set to wait till page loads completly before going to next line in script?

$f_wait - 1 = wait for page load to complete before returning

; - 0 = return immediately

well on the _IENavigate line i just set it this way

_IENavigate($oIE, "https://website.com", 0)

and after it went to webpage it automatically went to the winwaitactive line which was next in the script.

good idea. thanks for posting the workaround.
Link to comment
Share on other sites

  • 11 months later...

I am working on the same script as ANYDAY.

But I am facing a problem.

The website opens and the Username field is getting populated.

But the password box is not getting populated.

I have copy-pasted the exact code as suggested by ANYDAY and just modified the site parameters.

Any suggestions where should I look for problems.

No errors in sciTE editor.

Pls help.

thx

vai

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...