AutoITPimp Posted September 27, 2005 Share Posted September 27, 2005 (edited) Lol, now I have another problem, and I can't seem to figure out why it doesn't recognize it. Here is my code. After the 6th submit button is clicked, it triggers a javascript which pops up a confirmation box. The script does not recognize the window exists, and so it does not click the "OK" button. If I click "Cancel" and then manually click the 6th submit button, then the script recognizes the pop-up confirmation screen and proceeds. I tried putting a sleep() statement in before the WinWaitActive() statment, and nothing happens. I tried doing a WinExists() statement and it still does nothing. It is almost as if the script stops or "gets hung up" after the '$o_all.item("action", 5).click' statement. Is there something I'm missing, or is this potentially a defect? ; get pointers to all of the tag elements $o_all = _IETagNameAllGetCollection ($oIE) $o_all.item("allbox").click $o_all.item("action", 5).click ; clicks OK Button to confirmation screens WinWaitActive( "Microsoft Internet Explorer", "") ControlClick( "Microsoft Internet Explorer", "", 1 ) ; wait for page to load to proceed _IELoadWait($oIE, 500) ; sets HTML to a variable $o_HTML = _IEBodyReadHTML($oIE) Edited September 27, 2005 by AutoITPimp Link to comment Share on other sites More sharing options...
Mr. Crimson Posted September 28, 2005 Share Posted September 28, 2005 Lol, now I have another problem, and I can't seem to figure out why it doesn't recognize it. Here is my code. After the 6th submit button is clicked, it triggers a javascript which pops up a confirmation box. The script does not recognize the window exists, and so it does not click the "OK" button. If I click "Cancel" and then manually click the 6th submit button, then the script recognizes the pop-up confirmation screen and proceeds.I tried putting a sleep() statement in before the WinWaitActive() statment, and nothing happens. I tried doing a WinExists() statement and it still does nothing. It is almost as if the script stops or "gets hung up" after the '$o_all.item("action", 5).click' statement. Is there something I'm missing, or is this potentially a defect?; get pointers to all of the tag elements $o_all = _IETagNameAllGetCollection ($oIE) $o_all.item("allbox").click $o_all.item("action", 5).click ; clicks OK Button to confirmation screens WinWaitActive( "Microsoft Internet Explorer", "") ControlClick( "Microsoft Internet Explorer", "", 1 ) ; wait for page to load to proceed _IELoadWait($oIE, 500) ; sets HTML to a variable $o_HTML = _IEBodyReadHTML($oIE)Hmmm.... I've had a few issues with timing myself, maybe you should go back and do a traditional WinWait for the javascript window and have it click the button using keystrokes... I could be wrong about this, you might still be on the right track...-Crim Link to comment Share on other sites More sharing options...
DaleHohm Posted September 28, 2005 Author Share Posted September 28, 2005 Unfortunately, I don't really follow what you are seeing. Is the popup an IE dialog (HTML-based) or a windows dialog (Win32)? If it is an IE dialog, then ControlClick will not work for you since the controls inside the window are not accessible via the Win32 interface. You can send TAB and ENTER etc to those windows and control them however.I'd recommend using some ConsoleWrite commands or MsgBox commands to put in some debugging code just to verify where thens are hanging... (in SciTe you can use the Tools -> Trace: Add Trace Lines command to send information to the SciTe console).If you are able to provide some reproducer code and HTML or point to an external site that has the same behavior I'll be happy to take a look.DaleLol, now I have another problem, and I can't seem to figure out why it doesn't recognize it. Here is my code. After the 6th submit button is clicked, it triggers a javascript which pops up a confirmation box. The script does not recognize the window exists, and so it does not click the "OK" button. If I click "Cancel" and then manually click the 6th submit button, then the script recognizes the pop-up confirmation screen and proceeds.I tried putting a sleep() statement in before the WinWaitActive() statment, and nothing happens. I tried doing a WinExists() statement and it still does nothing. It is almost as if the script stops or "gets hung up" after the '$o_all.item("action", 5).click' statement. Is there something I'm missing, or is this potentially a defect?; get pointers to all of the tag elements $o_all = _IETagNameAllGetCollection ($oIE) $o_all.item("allbox").click $o_all.item("action", 5).click ; clicks OK Button to confirmation screens WinWaitActive( "Microsoft Internet Explorer", "") ControlClick( "Microsoft Internet Explorer", "", 1 ) ; wait for page to load to proceed _IELoadWait($oIE, 500) ; sets HTML to a variable $o_HTML = _IEBodyReadHTML($oIE) 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...
AutoITPimp Posted September 28, 2005 Share Posted September 28, 2005 Unfortunately, I don't really follow what you are seeing. Is the popup an IE dialog (HTML-based) or a windows dialog (Win32)? If it is an IE dialog, then ControlClick will not work for you since the controls inside the window are not accessible via the Win32 interface. You can send TAB and ENTER etc to those windows and control them however.I'd recommend using some ConsoleWrite commands or MsgBox commands to put in some debugging code just to verify where thens are hanging... (in SciTe you can use the Tools -> Trace: Add Trace Lines command to send information to the SciTe console).If you are able to provide some reproducer code and HTML or point to an external site that has the same behavior I'll be happy to take a look.DaleIt is a Win32 window. It's a message box dialog created by javascript, just the same as AutoIT creates a messagebox with the MsgBox() function. I have used the WinWaitActive() and ControlClick() functions to detect those message boxes on other pages, but they only had one "submit" button not 6.I'll try to get you a sample code with an external site I have. Link to comment Share on other sites More sharing options...
AutoITPimp Posted September 28, 2005 Share Posted September 28, 2005 (edited) OK, in trying to create a public test page for you, I seem to be having this problem every time now. It now does not detect the messagebox at all from script execution. However, my other scripts where it does work, continue to work. I don't get it. Here is my script. When the javascript message box appears, the script will likely now detect it, so if you click the 'Cancel' button, and then click submit buttons on the web page manually, the javascript message box will appear again and then the script will recognize it and click the 'OK' button. It's really weird that it doesn't detect it when it does now. Feel free to practice with this webpage, I'll leave it up as long as needed to figure out the issue. expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <IE.au3> ; Sets ESC key as a hot key HotKeySet("{Esc}", "EscButton") Func EscButton() Exit EndFunc $oIE = _IECreate() _IENavigate($oIE, "http://www.mviwebdesign.com/AutoIT/") _IELoadWait("stuff", 500) ; this isn't necessary ;WinSetState("AutoIT IE.au3 Test - Microsoft Internet Explorer provided by Verizon Online", "", @SW_MAXIMIZE) ; click the Submit 0 button in the Form Pass section $o_all = _IETagNameAllGetCollection ($oIE) $o_all.item("submit0").click ; wait 1 sec to allow user to see message box sleep ( 1000 ) ; clicks OK Button to confirmation screens WinWaitActive( "Microsoft Internet Explorer", "") ControlClick( "Microsoft Internet Explorer", "", 1 ) ; wait for page to load to proceed _IELoadWait($oIE, 500) ; navigate back to previous page _IENavigate($oIE, "http://www.mviwebdesign.com/AutoIT/") _IELoadWait($oIE, 500) ; click the Submit 5 button in the Form Fail section $o_all = _IETagNameAllGetCollection ($oIE) $o_all.item("submit", 4).click ; wait 1 sec to allow user to see message box sleep ( 1000 ) ; clicks OK Button to confirmation screens WinWaitActive( "Microsoft Internet Explorer", "") ControlClick( "Microsoft Internet Explorer", "", 1 ) ; wait for page to load to proceed _IELoadWait($oIE, 500) MsgBox( 0, "Complete", "Script has finished excution." ) Edited September 28, 2005 by AutoITPimp Link to comment Share on other sites More sharing options...
DaleHohm Posted September 28, 2005 Author Share Posted September 28, 2005 (edited) Thanks for making the code available on the internet. The trouble you are having is not related to IE.au3 or to AutoIt. The problem is that the Confirm box your webpage puts up is suspending script execution until it is dismissed. Not, AutoIt script execution (directly) but Javascript execution that is preventing the .click event from completing and returning control back to AutoIt. Two ideas come to mind -- one clunky, one complex. Clunky: spawn off (Run) another AutoIt script just prior to the .click that does the WinWaitActive and the ControlClick. Complex: it is possible to get the coordinates of the element from the browser and then use the standard AutoIt MouseClick to click the button instead of the .click event. There are pixel[bottom|Left|Right|Top] attributes of the element style (e.g. $oAll.item("submit0").style.pixelLeft), but the pixel position returned is relative to the parent block content container. You can actually figure this out by looping through all of the parents and adding up the offsets. Here is some Javascript code that could potentially be adapted to get the values:function getRealLeft(el) { if (arguments.length==0) el = this; xPos = el.offsetLeft; tempEl = el.offsetParent; while (tempEl != null) { xPos += tempEl.offsetLeft; tempEl = tempEl.offsetParent; } return xPos; } function getRealTop(el) { if (arguments.length==0) el = this; yPos = el.offsetTop; tempEl = el.offsetParent; while (tempEl != null) { yPos += tempEl.offsetTop; tempEl = tempEl.offsetParent; } return yPos; } That should reveal coordinates relative to the body element of the HTML page... then that needs to be turned into coordinates relative to the screen or to the IE Browser window so that you can use MouseClick... I have not tested, but this should be available with the $oIE.screenLeft and $oIE.screenTop properties. Untested and complicated. If the logic of this complex solution is sound, it could readily be turned into a function call, but it is not something I can tackle at the moment. Good work so far -- it is nice to see people doing some useful things with this code. Dale Edited September 28, 2005 by DaleHohm 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...
Kapz Posted September 29, 2005 Share Posted September 29, 2005 Is there some simple way to determine if a particular line/string of text exists on a webpage, say the word "hello", maybe a for loop that pulls everything in the body and searches for the word? Link to comment Share on other sites More sharing options...
DaleHohm Posted September 29, 2005 Author Share Posted September 29, 2005 (edited) Sure! I just added an example for you to reply 3 to this post that does this and will also replace the text searched upon with another string and write it back to the webpage. See the examples...DaleIs there some simple way to determine if a particular line/string of text exists on a webpage, say the word "hello", maybe a for loop that pulls everything in the body and searches for the word? Edited September 29, 2005 by DaleHohm 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...
Kapz Posted September 29, 2005 Share Posted September 29, 2005 Sure! I just added an example for you to reply 3 to this post that does this and will also replace the text searched upon with another string and write it back to the webpage. See the examples...DaleAwesome, thanks!One other question, I am calling an IE navigation function when I press a button on my GUI and I have another button on my GUI that will exit the navigation function when pressed, which works, except when the internet explorer function calls _IELoadWait() (I've tried it without any _IELoadWait() calls). If I press the button a hundred times in one second, then there is usually a chance that it will catch this little piece of code: $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $new3 Then ExitLoopwhich will tell it to exit the loop, but even that occurence is rare, is there some way around this, maybe something have to do with my GUI setup? I have to have the _IELoadWait() function in my script in order for it to properly function. Link to comment Share on other sites More sharing options...
DaleHohm Posted September 29, 2005 Author Share Posted September 29, 2005 You only need to use _IELoadWait if your script relies on having the page fully loaded before it performs its next action. _IELoadWait is called automatically by several functions (including _IENavigate), but each one that does this also has a parameter to request taht the wait not be performed. Please see the function descriptions or headers.DaleAwesome, thanks!One other question, I am calling an IE navigation function when I press a button on my GUI and I have another button on my GUI that will exit the navigation function when pressed, which works, except when the internet explorer function calls _IELoadWait() (I've tried it without any _IELoadWait() calls). If I press the button a hundred times in one second, then there is usually a chance that it will catch this little piece of code: $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $new3 Then ExitLoopwhich will tell it to exit the loop, but even that occurence is rare, is there some way around this, maybe something have to do with my GUI setup? I have to have the _IELoadWait() function in my script in order for it to properly function. 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...
Kapz Posted September 29, 2005 Share Posted September 29, 2005 You only need to use _IELoadWait if your script relies on having the page fully loaded before it performs its next action. _IELoadWait is called automatically by several functions (including _IENavigate), but each one that does this also has a parameter to request taht the wait not be performed. Please see the function descriptions or headers.DaleWell, to be more specific, my script clicks on a radio button which will send it to another page and if it doesnt have time to laod that next page, then the loop will continue to click radio buttons (2-3 clicks/second) forever and never move on to the next page since it isn't given time to load. I tried replacing it with a sleep() but it still seems to have the same problem. Also, is there a way to count how many instances of a particular string (such as "hello") exist in the body?Thanks a lot for your help, I really appreciate it. Link to comment Share on other sites More sharing options...
DaleHohm Posted September 29, 2005 Author Share Posted September 29, 2005 First, regarding the string match/counting question, take a look at StringReplace (and the @extended return value) and if you are not able to figure that out, please take it to the Support Forum rather than here because it is a basic AutoIt/Programming question. Regarding the load question, I need more detail. The "and if it doesnt have time to laod that next page" piece doesn't make sense to me. That is what _IELoadWait does... it waits until the browser status changes to state that it is completely done loading the page before it returns control. 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...
Kapz Posted September 29, 2005 Share Posted September 29, 2005 (edited) That is what _IELoadWait does... it waits until the browser status changes to state that it is completely done loading the page before it returns control.DaleRight, I understand perfectly what it does, my script works perfectly with it, but if I don't use _IELoadWait, then my function cannot operate properly. If, however, I do use it, the script works perfectly, except that I cannot call any other function from the GUI while it is in this state of waiting. Edited September 29, 2005 by Kapz Link to comment Share on other sites More sharing options...
AutoITPimp Posted September 29, 2005 Share Posted September 29, 2005 (edited) I tried the following as hopefully an "easy workaround" and it does not seem any better. <snippet in pertinent part> $inputs = _IETagNameGetCollection ($oIE.document, "input") $inputs.item("submit", 4).fireEvent("onclick") ; wait 1 sec to allow user to see message box sleep ( 1000 ) ; clicks OK Button to confirmation screens WinWaitActive( "Microsoft Internet Explorer", "") ControlClick( "Microsoft Internet Explorer", "", 1 ) </snippet> It seems the javascript still causes this to hang/pause on the fireEvent statement. I need to distribute this script to multiple users to assist in our QA environment, so using the "clunky" workaround is out of the question, and I cannot seem to get the "complex" workaround to work. It keeps telling me I need to use a 'With' statement to call the .style attribute, and when I use 'With' it tells me it can only be used with an object. Talk about a cath 22. ***EDIT: I tried doing MsgBox( 1, "Pixel Info", $inputs.item("submit", 4).style.pixelLeft ) and got a value of '0', which is probably because of an error. Edited September 29, 2005 by AutoITPimp Link to comment Share on other sites More sharing options...
Kapz Posted September 29, 2005 Share Posted September 29, 2005 I posted an example bit of code to give you an idea of the problem that I am having with command _IELoadWait(), which prevents the Stop button from working unless I click it a hundred times. Any ideas on what I'm doing wrong? Thanks expandcollapse popup#include <IE.au3> #include <GuiConstants.au3> ;Draw the window GuiCreate("Test", 214, 520) ;Draw Buttons $go = GuiCtrlCreateButton("Go!", 61, 255, 100, 30) GUICtrlSetColor(-1,0xFFFFFF) $stop = GuiCtrlCreateButton("Stop", 61, 298, 100, 30) GUICtrlSetColor(-1,0xFFFFFF) ;Button Actions GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $go Go() Case $msg = $stop ExitLoop EndSelect WEnd Func Go() While 1 ;;;;;Determine if button has been pressed $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $stop Then ExitLoop Sleep(50) $oIE = _IECreate() _IENavigate($oIE, "http://www.autoitscript.com/forum/index.php?act=Search&f=") _IELoadWait($oIE) $oFrom = _IEFormGetObjByName($oIE, "sForm") $oRelevant = _IEFormElementGetObjByName($oFrom, "sortby", 0) $oRecent = _IEFormElementGetObjByName($oFrom, "sortby", 1) For $i = 1 to 5 $oRelevant.checked = True Sleep(1000) $oRecent.checked = True Sleep(1000) Next WEnd EndFunc Link to comment Share on other sites More sharing options...
DaleHohm Posted September 29, 2005 Author Share Posted September 29, 2005 @Kapz -- Ah, OK. For you there is a workaround. _IELoadWait() loops checking the status of document readystate and returns when it changes to "complete" or 4. You can simply check the status of _IEGetProperty($oIE, "readystate") on your own and not use _IELoadWait()DaleRight, I understand perfectly what it does, my script works perfectly with it, but if I don't use _IELoadWait, then my function cannot operate properly. If, however, I do use it, the script works perfectly, except that I cannot call any other function from the GUI while it is in this state of waiting.@AutoITPimp -- yes, the fireEvent is synchronous as well, so no joy.I'd like to see what you've tried with the "complex" solution and I'll try to help clean it up. If we can make it work I'll add it to the library. Feel free to post here or PM me.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...
AutoITPimp Posted September 29, 2005 Share Posted September 29, 2005 (edited) Dale, thanks for all your help. I found my workaround which I wouldn't have thought of, if it wasn't for your .style.pixelLeft idea. Thanks for all your help, and your IE.au3 file is really coming in handy for me. I have a ton of things I am automating with it, which is faster than trying to get it put into Mercury Quick Test Pro/Quality Center/Test Director around here. Unless, of course, they'd let me program myself, but, alas, they will not right now. Here is the workaround. I think you can spot it easily. Some things, are so obvious it takes you 2 days to think of it. lol expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <IE.au3> ; Sets ESC key as a hot key HotKeySet("{Esc}", "EscButton") Func EscButton() Exit EndFunc $oIE = _IECreate() _IENavigate($oIE, "http://www.mviwebdesign.com/AutoIT/") _IELoadWait("stuff", 500) ; not important ;WinSetState("AutoIT IE.au3 Test - Microsoft Internet Explorer provided by Verizon Online", "", @SW_MAXIMIZE) ; place focus on the Submit 5 button in the Form Fail section $o_all = _IETagNameAllGetCollection ($oIE) $o_all.item("submit", 4).focus() ; press Enter key Send ( "{ENTER}" ) ; wait 1 sec to allow user to see message box sleep ( 1000 ) ; clicks OK Button to confirmation screens WinWaitActive( "Microsoft Internet Explorer", "") ControlClick( "Microsoft Internet Explorer", "", 1 ) ; wait for page to load to proceed _IELoadWait($oIE, 500) MsgBox( 0, "Complete", "Script has finished excution." ) Edited September 29, 2005 by AutoITPimp Link to comment Share on other sites More sharing options...
DaleHohm Posted October 8, 2005 Author Share Posted October 8, 2005 (edited) A couple of notes about the code in the previous post...First, I've taken the idea of using an item().focus() command followed by an AutoIt send of the Enter key and worked it into an example using the Google search page and put it in reply 3 of this post. Very good, creative workaround -- thanks.The example above uses _IELoadWait after an _IENavigate command -- this should not be necessary because a call to _IELoadWait is built into _IENavigate (although it can be disabled with an optional parameter).The example above uses the optional "delay" parameter of _IELoadWait forcing, in this case, a 500 millisecond delay before checking the webpage load status. The delay parameter was added primarily for debugging (if you're concerned about correct operation serialization). In my experience, this delay has not been needed and I don't expect it often, if ever, to be used.DaleDale, thanks for all your help. I found my workaround which I wouldn't have thought of, if it wasn't for your .style.pixelLeft idea. Thanks for all your help, and your IE.au3 file is really coming in handy for me. I have a ton of things I am automating with it, which is faster than trying to get it put into Mercury Quick Test Pro/Quality Center/Test Director around here. Unless, of course, they'd let me program myself, but, alas, they will not right now.Here is the workaround. I think you can spot it easily. Some things, are so obvious it takes you 2 days to think of it. lol Edited October 8, 2005 by DaleHohm 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...
Developers Jos Posted October 8, 2005 Developers Share Posted October 8, 2005 What about adding these UDF's to the standard UDF library included with AutoIt3 ? SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DaleHohm Posted October 8, 2005 Author Share Posted October 8, 2005 (edited) That has always been my intent, but I'm afraid I've created a monster It's very daunting to think of creating the full documentation and required examples for each of the existing functions.What I'm thinking of doing is splitting the library into two parts: IE.au3 and IEPlus.au3 IE.au3 would contain the core functions and would be fully documented and as bullet-proof as possible. IE.au3 would then be submitted to the core UDF library. Care would be taken to ensure that these functions would always be backward compatible in future versions.IEPlus.au3 would contain functions that were not yet fully documented or tested (and IEPlus.au3 would require #include of IE.au3). These functions might change dramatically over time and some would deprecate. Functions would move from IEPlus.au3 to IE.au3 as they matured. DaleWhat about adding these UDF's to the standard UDF library included with AutoIt3 ? Edited October 9, 2005 by DaleHohm 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