Jump to content

Recommended Posts

Posted

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?

 

  • Moderators
Posted
I just added a tab create feature for IE here:
 
_IEJS_TabCreate()

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.

Posted

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.

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
  • Recently Browsing   0 members

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