Jump to content
Sign in to follow this  
DarkOnyx

Logging into multiple windows

Recommended Posts

Hi all,

I saw this example here and it works pretty well:

http://stackoverflow.com/questions/15052540/autoit-how-can-i-write-in-an-input-field-on-a-browser

I've played with this for hours.  I can't seem to open a new window (in a new tab) and have it do the same thing.  I am drawing a total blank.  

What I am trying to do is open several windows in new tabs and enter the userID and password in the given field without it giving me errors.  Simple delays are too clumsy.

Any ideas?

 

Share this post


Link to post
Share on other sites

Sure, the code is the one from the link I referenced:

#include<IE.au3>
$sUsername = "Username"
$sPassword = "Password"
$sUrl = "https://yoururl.com"
$oIE = _IECreate($sUrl, 0, 1, 0, 1)
Sleep(2000)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, 'login') ; change name !
$oPassword = _IEFormElementGetObjByName($oForm, "password") ; change name !
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEFormSubmit($oForm)

 

Thanks for the function Smoke, I'll play around with it.

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...