jisevereid Posted January 12, 2017 Posted January 12, 2017 I have two simple script that get the active Internet Explorer window and changes the url. The scripts are identical except for the links that they redirect IE to. The problem that I have is that when I have IE in full-screen mode and alternate webpages with the two scripts more than 3 times I get this error "Error: The requested action with this object has failed". I would like the scripts to continue functioning without errors no matter how many times they are used. Script # 1 #include <IE.au3> #AutoIt3Wrapper_run_debug_mode=Y Local $title = WinGetTitle ("[CLASS:IEFrame]") Local $trimTitle = StringTrimRight($title, 20) Local $oIE = _IEAttach($trimTitle) _IENavigate($oIE, "https://www.google.com/maps/d/viewer?mid=1itdKt_5_qG_pIxM5N49qNK55rkM&ll=43.84185846009771%2C-91.24873084573369&z=9") _IELoadWait($oIE) Exit Script # 2 #include <IE.au3> #AutoIt3Wrapper_run_debug_mode=Y Local $title = WinGetTitle ("[CLASS:IEFrame]") Local $trimTitle = StringTrimRight($title, 20) Local $oIE = _IEAttach($trimTitle) _IENavigate($oIE, "http://www.explorelacrosse.com/") _IELoadWait($oIE) Exit IE_Navigate_Map.au3 IE_Navigate_Web.au3
anthonyjr2 Posted January 12, 2017 Posted January 12, 2017 What line does the error happen on? I just downloaded both and ran them alternating 10 times each, and I never received an error. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=
jisevereid Posted January 12, 2017 Author Posted January 12, 2017 Did you make sure that you are using internet explore in full-screen(F11)? I only get the error when it's in fullscreen.
anthonyjr2 Posted January 12, 2017 Posted January 12, 2017 (edited) Originally I didn't, but I just did and still I'm not receiving an error. Can you run this in full screen and let me know if you get it? #include "IE_Navigate_Web.au3" #include "IE_Navigate_Map.au3" HotKeySet("{END}", "alternate") Func alternate() For $i = 0 to 6 Step + 1 Sleep(200) IE_Navigate_Web() Sleep(300) IE_Navigate_Map() Sleep(200) Next Exit EndFunc while 1 WEnd I just modified your script slightly to be put into functions, but I'll reupload them here for you. IE_Navigate_Map.au3 IE_Navigate_Web.au3 EDIT: Also, what is your AutoIt version and OS? Edited January 12, 2017 by anthonyjr2 UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=
jisevereid Posted January 12, 2017 Author Posted January 12, 2017 I'm currently using AutoIt v3.3.14.2 and I'm on Windows 10. Also I ran your script and I was able to alternate the webpages once and then on the second time I got this error $oObject.navigate($sUrl) $oObject^ ERROR
jisevereid Posted January 12, 2017 Author Posted January 12, 2017 3 minutes ago, jisevereid said: I'm currently using AutoIt v3.3.14.2 and I'm on Windows 10. Also I ran your script and I was able to alternate the webpages once and then on the second time I got this error $oObject.navigate($sUrl) $oObject^ ERROR Woops I didn't copy the whole error code. Here it is . "C:\Program Files (x86)\AutoIt3\Include\IE.au3" (272) : ==> The requested action with this object has failed.: $oObject.navigate($sUrl) $oObject^ ERROR
anthonyjr2 Posted January 12, 2017 Posted January 12, 2017 Try putting _IEErrorHandlerRegister() near the top of your scripts and see if it helps. It won't remove the error but should at least not make it terminate the program. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=
jisevereid Posted January 19, 2017 Author Posted January 19, 2017 I did a fresh install of windows and everything seemed to function perfectly well. The error must have been caused by something on my computer.
jdelaney Posted January 20, 2017 Posted January 20, 2017 The dom object isn't accessible while the window is 'thinking'...such as if the window is in a ghost state. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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