yogendra Posted March 25, 2011 Share Posted March 25, 2011 (edited) Hi, I am fairly new to Autoit. I am creating a simple login script for Gmail. I am facing two problems: 1) When I run the script, two instances of IE8 open up, one remains blank, the other opens the gmail page. 2) After this the script closes itself & I get the error message: C:\Program Files\AutoIt3\Include\IE.au3 (1111) : ==> The requested action with this object has failed.: Local $o_col = $o_object.document.forms.item($s_Name) Local $o_col = $o_object.document^ ERROR Any idea where/what am I doing wrong? Thanks in advancegmail.au3 Edited March 25, 2011 by yogendra Link to comment Share on other sites More sharing options...
bogQ Posted March 25, 2011 Share Posted March 25, 2011 (edited) Hi, 2) After this the script closes itself & I get the error message: C:\Program Files\AutoIt3\Include\IE.au3 (1111) : ==> The requested action with this object has failed.: Local $o_col = $o_object.document.forms.item($s_Name) Local $o_col = $o_object.document^ ERROR Any idea where/what am I doing wrong? Thanks in advance From help file _IEFormGetObjByName ( ByRef $o_object, $s_name [, $i_index = 0] )"gaia_loginform" in your $s_Name is the ID of form and not the name that is why you get that error Why do you use _IECreate("www.gmail.com", 0, 1, 0) ? #include <IE.au3> $oForm = _IEFormGetCollection (_IECreate ("www.gmail.com"), 0) _IEFormElementSetValue (_IEFormElementGetCollection ($oForm, 14), "Username") _IEFormElementSetValue (_IEFormElementGetCollection ($oForm, 15), "Pass") For "two instances of IE8 open up" i dont get that effect (i cant replicate that error) Edited March 25, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
GMK Posted March 25, 2011 Share Posted March 25, 2011 The attachment that you posted works fine (by itself, anyway) for me. Although, it would work faster if you changed a few things: #include <IE.au3> $oIE = _IECreate("www.gmail.com") $oForm = _IEFormGetObjByName($oIE, "gaia_loginform") $oUser = _IEFormElementGetObjByName($oForm, "Email") $oPasswd = _IEFormElementGetObjByName($oForm, "Passwd") $user = "username" $passwd = "password" _IEFormElementSetValue($oUser, $user) _IEFormElementSetValue($oPasswd, $passwd) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now