anunes Posted February 12, 2009 Share Posted February 12, 2009 Hi, i'm new in AutoIt and i've some doubts... When i tried to use the _IE functions, i found some problems... on my computer, even the help examples of _IEFormElementSetValue and other ones doesn't works... --------------------------------------------------------------- _IEFormElementSetValue examples that doesn't work: Example 2 and 3 --------------------------------------------------------------- What kind of problem can be it? Thanks Link to comment Share on other sites More sharing options...
Bert Posted February 12, 2009 Share Posted February 12, 2009 Please post your code. What you provided does not tell us anything. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 (edited) Please post your code. What you provided does not tell us anything. here's my code #include <IE.au3> #include <IE_V1Compatibility_T2.0_4.au3> $oIE = _IECreate("www.gmail.com") _IELoadWait($oIE) $oForm = _IEFormElementGetObjByName($oIE, "gaia_loginform") $oUser = _IEFormElementGetObjByName($oForm, "Email") $oPasswd = _IEFormElementGetObjByName($oForm, "Passwd") $user = "username" $passwd = "password" _IEFormElementSetValue($oUser, $user) _IEFormElementSetValue($oPasswd, $passwd) it should work, doesn't it? Edited February 13, 2009 by anunes Link to comment Share on other sites More sharing options...
weirddave Posted February 13, 2009 Share Posted February 13, 2009 I'm new to the _IE functions myself, couldn't get your code to work.I added a debug line after you get the login form:msgbox(0,"",$oForm)It came up with "0", so it looks like it can't find the form.That gmail link redirects me to here:https://www.google.com/accounts/ServiceLogi...mp;ltmplcache=2So it could be that they've changed gmail login since that code was devised. Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 I'm new to the _IE functions myself, couldn't get your code to work. I added a debug line after you get the login form: msgbox(0,"",$oForm) It came up with "0", so it looks like it can't find the form. That gmail link redirects me to here: https://www.google.com/accounts/ServiceLogi...mp;ltmplcache=2 So it could be that they've changed gmail login since that code was devised. Sorry weirddave, the code was write wrong... i changed somethings... and the gmail doesn't changed the login because i wrote this code today morning! Here's the new code, line five rewrote... #include <IE.au3> #include <IE_V1Compatibility_T2.0_4.au3> $oIE = _IECreate("www.gmail.com", 0, 1, 0) $oForm = _IEFormGetObjByName($oIE, "gaia_loginform") MsgBox(0, "", $oForm) $oUser = _IEFormElementGetObjByName($oForm, "Email") $oPasswd = _IEFormElementGetObjByName($oForm, "Passwd") $user = "username" $passwd = "password" _IEFormElementSetValue($oUser, $user) _IEFormElementSetValue($oPasswd, $passwd) But my problem is when i execute the script, a AutoIt Error MsgBox returns the follow msg: "Line 1247 (File "C:\Program Files (x86)\AutoIt3\Beta\Include\IE.au3"): $o_col = $o_object.document.forms.item($s_Name) $o_col = $o_object.document^ERROR Error: The requested action with this object has failed." I though "Ohhh, it happens because I tried _IECreate $f_wait = 0", so I let it by default, wait about 5 minutes and the error happend again. The line 7 "MsgBox" don't appear... What I supouse to do? Link to comment Share on other sites More sharing options...
weirddave Posted February 13, 2009 Share Posted February 13, 2009 I got the same error, so I added another debug line: after the _IECreate MsgBox(0, "", $oIE) Error no longer appears! Still does't work though. Right, looking at the help file: $oIE = _IECreate("www.gmail.com", 0, 1, 0) The last digit: 0 = Return immediately, not waiting for page to load This is what you thought might be the problem. Well, I set it to 1, works completely, removed debug msgboxes, no problems. 1 note, I did remove: #include <IE_V1Compatibility_T2.0_4.au3> as I don't seem to have it Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 I got the same error, so I added another debug line:after the _IECreateMsgBox(0, "", $oIE)Error no longer appears!Still does't work though.Right, looking at the help file:$oIE = _IECreate("www.gmail.com", 0, 1, 0)The last digit:0 = Return immediately, not waiting for page to loadThis is what you thought might be the problem. Well, I set it to 1, works completely, removed debug msgboxes, no problems.1 note, I did remove:#include <IE_V1Compatibility_T2.0_4.au3>as I don't seem to have itI set _IECreate defaults, removed #include that you said, but I let the MsgBox and include the MsgBox(0, "", $oIE), start the script and let it run about 5 minutes whitout returns, then it returns a blank MsgBox and the AutoIt Error again...my default browser is FireFox, maybe it could causes the problem? Link to comment Share on other sites More sharing options...
BrettF Posted February 13, 2009 Share Posted February 13, 2009 Hi please run this using SciTE. expandcollapse popup#include <IE.au3> _IEErrorHandlerRegister ("MyErrFunc") $oIE = _IECreate("www.gmail.com", 0, 1, 0) _IELoadWait ($oIE) $oForm = _IEFormGetObjByName($oIE, "gaia_loginform") $oUser = _IEFormElementGetObjByName($oForm, "Email") $oPasswd = _IEFormElementGetObjByName($oForm, "Passwd") $user = "username" $passwd = "password" _IEFormElementSetValue($oUser, $user) _IEFormElementSetValue($oPasswd, $passwd) Func MyErrFunc() ; Important: the error object variable MUST be named $oIEErrorHandler $ErrorScriptline = $oIEErrorHandler.scriptline $ErrorNumber = $oIEErrorHandler.number $ErrorNumberHex = Hex($oIEErrorHandler.number, 8) $ErrorDescription = StringStripWS($oIEErrorHandler.description, 2) $ErrorWinDescription = StringStripWS($oIEErrorHandler.WinDescription, 2) $ErrorSource = $oIEErrorHandler.Source $ErrorHelpFile = $oIEErrorHandler.HelpFile $ErrorHelpContext = $oIEErrorHandler.HelpContext $ErrorLastDllError = $oIEErrorHandler.LastDllError $ErrorOutput = "" $ErrorOutput &= "--> COM Error Encountered in " & @ScriptName & @CR $ErrorOutput &= "----> $ErrorScriptline = " & $ErrorScriptline & @CR $ErrorOutput &= "----> $ErrorNumberHex = " & $ErrorNumberHex & @CR $ErrorOutput &= "----> $ErrorNumber = " & $ErrorNumber & @CR $ErrorOutput &= "----> $ErrorWinDescription = " & $ErrorWinDescription & @CR $ErrorOutput &= "----> $ErrorDescription = " & $ErrorDescription & @CR $ErrorOutput &= "----> $ErrorSource = " & $ErrorSource & @CR $ErrorOutput &= "----> $ErrorHelpFile = " & $ErrorHelpFile & @CR $ErrorOutput &= "----> $ErrorHelpContext = " & $ErrorHelpContext & @CR $ErrorOutput &= "----> $ErrorLastDllError = " & $ErrorLastDllError MsgBox(0,"COM Error", $ErrorOutput) SetError(1) Return EndFunc ;==>MyErrFunc I am unable to test at the moment as I'm behind a firewall thats blocked gmail. Beats me why... Also, please post the contents of SciTE when you run it. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
weirddave Posted February 13, 2009 Share Posted February 13, 2009 my default browser is FireFox, maybe it could causes the problem?It shouldn't be a problem, I assume the script actually loads IE and not FF? The whole thing works fine here. If it's loading FF, then that could be a mahoosive problem... Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 (edited) I ran the script that you post, it returns: "COM Error COM Error Encountered in gmail_error.au3 $ErrorScriptline = 1247 $ErrorNumberHex = 80020009 $ErrorNumber = -2147352567 $ErrorWinDescription = Erro não especificado (Not specified error) $ErrorDescription = $ErrorSource = $ErrorHelpFile = $ErrorHelpContext = 0 $ErrorLastDllError = 0" "COM Error COM Error Encountered in gmail_error.au3 $ErrorScriptline = 1262 $ErrorNumberHex = 80020009 $ErrorNumber = -2147352567 $ErrorWinDescription = Erro não especificado (Not specified error) $ErrorDescription = $ErrorSource = $ErrorHelpFile = $ErrorHelpContext = 0 $ErrorLastDllError = 0" This two msg appears after 5 minutes of script running! What it means? And more one question, when I execute any _IECreate("...") it opens two IE windows, its normal? weirddave: It opens the IE, I just though the FF could be the problem, but I don't think so! Edited February 13, 2009 by anunes Link to comment Share on other sites More sharing options...
weirddave Posted February 13, 2009 Share Posted February 13, 2009 I ran the script that you post, it returns:...error stuff...This two msg appears after 5 minutes of script running!What it means?And more one question, when I execute any _IECreate("...") it opens two IE windows, its normal?_IECreate makes one window, there should not be two.Does this make one window for you?#include <IE.au3>$oIE = _IECreate("www.intel.com", 0, 1, 1)Can you give us the names of any other windows created by either script. Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 (edited) I ran the script Brett again, now it shows: ""COM Error COM Error Encountered in gmail_error.au3 $ErrorScriptline = 1247 $ErrorNumberHex = 800706BA $ErrorNumber = -2147023174 $ErrorWinDescription = O servidor RPC não está disponível. (RPC server doesn't ready to use) $ErrorDescription = $ErrorSource = $ErrorHelpFile = $ErrorHelpContext = $ErrorLastDllError = 0" "COM Error COM Error Encountered in gmail_error.au3 $ErrorScriptline = 1262 $ErrorNumberHex = 800706BA $ErrorNumber = -2147023174 $ErrorWinDescription = O servidor RPC não está disponível. (RPC server doesn't ready to use) $ErrorDescription = $ErrorSource = $ErrorHelpFile = $ErrorHelpContext = $ErrorLastDllError = 0" And SciTe Warnings are: ">"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "E:\Artur\AutoIt\gmail_error.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3\beta" /UserParams +>01:16:20 Starting AutoIt3Wrapper v.1.10.1.14 Environment(Language:0416 Keyboard:00000416 OS:WIN_VISTA/Service Pack 1 CPU:X64 ANSI) >Running AU3Check (1.54.14.0) from:C:\Program Files (x86)\AutoIt3\beta +>01:16:20 AU3Check ended.rc:0 >Running:(3.2.13.13):C:\Program Files (x86)\AutoIt3\beta\autoit3.exe "E:\Artur\AutoIt\gmail_error.au3" --> IE.au3 V2.4-0 Warning from function _IELoadWait, $_IEStatus_LoadWaitTimeout --> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch --> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType +>01:27:59 AutoIT3.exe ended.rc:0 +>01:28:00 AutoIt3Wrapper Finished >Exit code: 0 Time: 699.877" weirddave: This script opens two windows, the intel site, and another blank window saying "Connecting..." on the tab description. There's a PS of the two windows! Edited February 13, 2009 by anunes Link to comment Share on other sites More sharing options...
weirddave Posted February 13, 2009 Share Posted February 13, 2009 I'm starting to suspect there's an issue on your system. I assume going to gmail, intel or whatever via normal menu/surfing clicks is fine, you don't get extra windows appearing? FF would not seem to be an issue by the shots posted. All a bit odd.... Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 I'm starting to suspect there's an issue on your system. I assume going to gmail, intel or whatever via normal menu/surfing clicks is fine, you don't get extra windows appearing?FF would not seem to be an issue by the shots posted. All a bit odd....When I go Start -> All Programs -> Internet Explorer 64-bits, just one window open and I navigate normal in gmail or intel... Maybe there's some adware or something like that... In FF there's no one problem too... This _IECreate problem happens since the begin, because that I though it's normal...I have no fucking idea what is going on in my PC! Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 I install a Virtual Machine on my computer and try to execute the script... it's working fine, i'll try to format my pc this weekend and try to run the script again... Thanks for the help... Link to comment Share on other sites More sharing options...
BrettF Posted February 13, 2009 Share Posted February 13, 2009 Works correctly on my machine (XP 64bit) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
weirddave Posted February 13, 2009 Share Posted February 13, 2009 Instead of reinstalling windows, why not fix the problem and understand what went wrong so it doesn't happen again? I suggest looking for a dodgy process running to start with. Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 Instead of reinstalling windows, why not fix the problem and understand what went wrong so it doesn't happen again? I suggest looking for a dodgy process running to start with.Alright, I'll try to install some anti-spy and adware... gonna to remove all them, reinstall autoit... look for any other problem on process running... and now try again...Brett, my machine is Vista - 64 bits... Link to comment Share on other sites More sharing options...
anunes Posted February 13, 2009 Author Share Posted February 13, 2009 I found the problem, autoit _IE doesn't works fine on Win Vista - 64 bits... I tried to execute this script on another machine with the win vista - 64 bits and occours the same thing... but on my virtual machine win xp 64 bits it's works fine... Link to comment Share on other sites More sharing options...
DaleHohm Posted February 13, 2009 Share Posted February 13, 2009 Please read the comments about Vista in the helpfile for _IECreate() - there are suggested workarounds for trouble caused by the UAC security measures instituted in Vista. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble 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