Sign in to follow this  
Followers 0
DarkOnyx

Logging into multiple windows

5 posts in this topic

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



Any ideas?

Yes... post your code. o:)

Share this post


Link to post
Share on other sites
I just added a tab create feature for IE here:
 
_IEJS_TabCreate()
1 person likes this

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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

Smoke, THANK YOU SO MUCH FOR YOUR LIBRARY!

Just what the doctor ordered.  I made some tweaks on my code and now it works fantastically. 

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  
Followers 0