burger Posted August 14, 2006 Share Posted August 14, 2006 I'm attempting to run a file with the Beta version 3.1.1.133. The first line of the file is: #include <IE.au3> An error message come up: Line 311 (File "C:\Program Files\AutoIt3\Include\IE.au3"): Case "0" Error: "Case" statement with no matching "Select" statement What am I doing wrong? Link to comment Share on other sites More sharing options...
DaleHohm Posted August 14, 2006 Share Posted August 14, 2006 I'm attempting to run a file with the Beta version 3.1.1.133. The first line of the file is: #include <IE.au3>An error message come up: Line 311 (File "C:\Program Files\AutoIt3\Include\IE.au3"):Case "0"Error: "Case" statement with no matching "Select" statementWhat am I doing wrong?Even though you think you are running the beta, you are in fact running the previous productions version (this is caused by the use of a SWITCH statement that the old production version does not understand).I actually suggest taht you upgrade to the new 3.2(.1) version and this should not be an issue for you.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...
burger Posted August 14, 2006 Author Share Posted August 14, 2006 (edited) Even though you think you are running the beta, you are in fact running the previous productions version (this is caused by the use of a SWITCH statement that the old production version does not understand).I actually suggest taht you upgrade to the new 3.2(.1) version and this should not be an issue for you.DaleThanks. Edited August 14, 2006 by burger Link to comment Share on other sites More sharing options...
burger Posted August 15, 2006 Author Share Posted August 15, 2006 Thanks.I did as you suggested, I even uninstalled all betas. I'm still having the same issue. Is there there a way to confirm the version I'm running? Link to comment Share on other sites More sharing options...
burger Posted August 15, 2006 Author Share Posted August 15, 2006 I did as you suggested, I even uninstalled all betas. I'm still having the same issue. Is there there a way to confirm the version I'm running?I apologize, the error now refer to a line in my file which comes from an old example. The line it has a problem with is .fo Link to comment Share on other sites More sharing options...
vim Posted August 15, 2006 Share Posted August 15, 2006 Put this in your code:ConsoleWrite("AutoIt Version --> " & @AutoItVersion & @CR)Give us some of your code so we can have a look see.I did as you suggested, I even uninstalled all betas. I'm still having the same issue. Is there there a way to confirm the version I'm running? Link to comment Share on other sites More sharing options...
burger Posted August 15, 2006 Author Share Posted August 15, 2006 Put this in your code: ConsoleWrite("AutoIt Version --> " & @AutoItVersion & @CR) Give us some of your code so we can have a look see.#include <IE.au3> ; Create a browser window and navigate to hotmail $oIE = _IECreate ("http://mywebpage") ; get pointers to the login form and username, password and signin fields $o_form = _IEFormGetObjByName ($oIE, "f1") $o_login = _IEFormElementGetObjByName ($o_form, "login") $o_password = _IEFormElementGetObjByName ($o_form, "passwd") $o_signin = _IEFormElementGetObjByName ($o_form, "SI") $username = "mylogin" $password = "mypasswrd" ; Set field values and submit the form _IEFormElementSetValue ($o_login, $username) _IEFormElementSetValue ($o_password, $password) _IEAction ($o_signin, "click") This code is working fine now however, the page takes too long to load so the inputs never get entered. How can I delay the input until the page loads? Thanks Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 15, 2006 Moderators Share Posted August 15, 2006 This code is working fine now however, the page takes too long to load so the inputs never get entered. How can I delay the input until the page loads? ThanksI doubt that it is the page taking too long, instead that the page never finishes loading. Your current script will create the browser, navigate to the webpage, and wait till the page is finished loading before moving on. Link to comment Share on other sites More sharing options...
burger Posted August 15, 2006 Author Share Posted August 15, 2006 I doubt that it is the page taking too long, instead that the page never finishes loading. Your current script will create the browser, navigate to the webpage, and wait till the page is finished loading before moving on.You are correct. I got it to work by using Send("login{TAB}password{ENTER}") instead of FormElementSetValue. Thanks. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 15, 2006 Moderators Share Posted August 15, 2006 You are correct. I got it to work by using Send("login{TAB}password{ENTER}") instead of FormElementSetValue. Thanks.That may work most of the time, but it would be more error proof getting the FormElementSetValue working. It you could provide a link I will take a look at it and see what I can figure out. Link to comment Share on other sites More sharing options...
vim Posted August 15, 2006 Share Posted August 15, 2006 #include <IE.au3> ; Create a browser window and navigate to hotmail $oIE = _IECreate ("http://mywebpage") ; get pointers to the login form and username, password and signin fields $o_form = _IEFormGetObjByName ($oIE, "f1") $o_login = _IEFormElementGetObjByName ($o_form, "login") $o_password = _IEFormElementGetObjByName ($o_form, "passwd") $o_signin = _IEFormElementGetObjByName ($o_form, "SI") $username = "mylogin" $password = "mypasswrd" ; Set field values and submit the form _IEFormElementSetValue ($o_login, $username) _IEFormElementSetValue ($o_password, $password) _IEAction ($o_signin, "click") The code above is exactly what I use to log into Hotmail. Is this script for "http://www.hotmail.com" or something similar and not "http://mywebpage" on line 3. This script as is has never failed me yet. And that was one of the things that surprised me, was how fast it loaded and logged in. vim Link to comment Share on other sites More sharing options...
burger Posted August 15, 2006 Author Share Posted August 15, 2006 Here is the link. If you can get the Form method to work I'd be greatful.http://lifecalc.com/cgi-bin/openwebmail/openwebmail.pl Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 15, 2006 Moderators Share Posted August 15, 2006 Here is the link. If you can get the Form method to work I'd be greatful. http://lifecalc.com/cgi-bin/openwebmail/openwebmail.plHere you go... #include <IE.au3> _IEErrorHandlerRegister() $sUserName = "Your Username" $sPassword = "Your Password" $sURL = "http://lifecalc.com/cgi-bin/openwebmail/openwebmail.pl" $oIE = _IECreate($sURL) $oForm = _IEFormGetObjByName($oIE, "login") $oUserName = _IEFormElementGetObjByName($oForm, "loginname") $oPassword = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oUserName, $sUserName) _IEFormElementSetValue($oPassword, $sPassword) _IEFormSubmit($oForm) Link to comment Share on other sites More sharing options...
vim Posted August 15, 2006 Share Posted August 15, 2006 Here you go... #include <IE.au3> _IEErrorHandlerRegister() $sUserName = "Your Username" $sPassword = "Your Password" $sURL = "http://lifecalc.com/cgi-bin/openwebmail/openwebmail.pl" $oIE = _IECreate($sURL) $oForm = _IEFormGetObjByName($oIE, "login") $oUserName = _IEFormElementGetObjByName($oForm, "loginname") $oPassword = _IEFormElementGetObjByName($oForm, "password") _IEFormElementSetValue($oUserName, $sUserName) _IEFormElementSetValue($oPassword, $sPassword) _IEFormSubmit($oForm) I know your code is correct and I used a previous snippet of yours: =================================================== #include <IE.au3> $oIE = _IECreate("http://lifecalc.com/cgi-bin/openwebmail/openwebmail.pl") $oForms = _IEFormGetCollection($oIE) MsgBox(0, "Form(s) Info", "There are " & @extended & " form(s) on this page") $i = 0 For $oForm In $oForms MsgBox(0, "HTML for Form " & $i, $oForm.innerHTML) $i += 1 Next =================================================== But how do you know to get the correct values for IEFormElementGetObjByName on "loginname"/"password"? I see the "loginname"/"password" inside that HTML mess, but what line is the the key? Thanks! vim Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 15, 2006 Moderators Share Posted August 15, 2006 But how do you know to get the correct values for IEFormElementGetObjByName on "loginname"/"password"?I see the "loginname"/"password" inside that HTML mess, but what line is the the key?Thanks!vimThis line gives you the name of the form:<form method="post" action="/cgi-bin/openwebmail/openwebmail.pl" enctype="application/x-www-form-urlencoded" name="login">This these two lines give you the input names:<input type="text" name="loginname" size="14" onchange="" /><input type="password" name="password" size="14" onchange="" /> Link to comment Share on other sites More sharing options...
vim Posted August 15, 2006 Share Posted August 15, 2006 This line gives you the name of the form:This these two lines give you the input names:Thank you, that's a big help. Now I know what to look for.vim Link to comment Share on other sites More sharing options...
burger Posted August 15, 2006 Author Share Posted August 15, 2006 Thank you, that's a big help. Now I know what to look for.vimThank you Big Daddy! Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 15, 2006 Moderators Share Posted August 15, 2006 Thank you Big Daddy!No problem, glad I could help! Link to comment Share on other sites More sharing options...
burger Posted August 16, 2006 Author Share Posted August 16, 2006 No problem, glad I could help!What about a message box login like this?http://www.investnbest.com/members/Inside_InTouch.htm Link to comment Share on other sites More sharing options...
DaleHohm Posted August 16, 2006 Share Posted August 16, 2006 Created by the browser, but not a window with a browser control -- use standard AutoIt window and control commands to manipulate it. 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