Jump to content

Recommended Posts

Posted (edited)

Hi I have a script that continously checks all tabs open in IE, checks if its on a specific site, that has a specific form open and after some time presses a button on that form. It also works if this specific site is open multiple times, via an array. Anyway here is the code:

EDIT: Removed my code as I narrowed the problem down to the _IEFrameGetObjByName Function.T his code returns the same error with any ie site open, can someone else try if this works for them?:

#include <ie.au3>


Local $oIE = _IEAttach("","instance")

While 1
    Local $oFrame = _IEFrameGetObjByName($oIE,"anything")

    WEnd

I dont have much experience with AutoIT, so the code could probably be improved. But it works as intended up until some point the IE funcitons throw these "random" errors:

Without _IEErrorHandlerRegister

  Reveal hidden contents

With _IEErrorHandlerRegister

  Reveal hidden contents

In those example I have the sites open but not the forms and dont touch them for the time the script runs, but regardless what I do it crashes after some seemingly random time.

I found something  similar, but that was a bug that is supposed to be already fixed: https://www.autoitscript.com/trac/autoit/ticket/2541

I have no idea why this happens it seems like its a bug, I tried some different stuff like to "reattach" the IE Objects when it finds the new tabs with this line:

$Tabs[$ArrayIndex] = $Tab

But with no success, so it seems this is a issue with the IE Functions that have some kind of leak or something after some time. 

Also I changed some code and error message due to privacy and my AutoIt version is v3.3.14.2, my Internet Explorer Version is 11.0.30 and I use Windows 7  Version  6.1.7601 Service Pack 1 Build 7601.

Anyone got any idea or is it a bug?
 

Edited by ixam
Posted

Can you provide a working example? Without that, it is difficult for us to guess at the cause of your issue.

  Quote

Also I changed some code and error message due to privacy

Expand  

Maybe I'm just suspicious by nature, but this type of statement sets off warning bells. Are you sure that your usage doesn't violate the forum rules? If not, what type of websites are you trying to interact with?

Posted (edited)
  On 9/9/2016 at 10:44 AM, Danp2 said:

Can you provide a working example? Without that, it is difficult for us to guess at the cause of your issue.

Maybe I'm just suspicious by nature, but this type of statement sets off warning bells. Are you sure that your usage doesn't violate the forum rules? If not, what type of websites are you trying to interact with?

Expand  

Its just some folders that contain my name and stuff, I literally just want to press a button on a site, what is suspicous about that lol

Anyway I narrowed it down you dont even need my code anymore. Its the _IEFrameGetObjByName Function that throws an error after continious calls. Run this code on any site:

#include <ie.au3>


Local $oIE = _IEAttach("","instance")

While 1

    Local $oFrame = _IEFrameGetObjByName($oIE,"anything")

    WEnd

It will throw the same error that I get with my script after some time:

  Reveal hidden contents

This seems definitely like a bug. Maybe there is a memory leak in the function? Anyone else try this please (you have to have one tab on IE open), hopefully its not just me that gets this error.

 

Edit: Lol now the edit button appeared it wasnt there before...

Edited by ixam
Posted (edited)
  On 9/9/2016 at 11:51 AM, ixam said:

definitely like a bug. Maybe there is a memory leak in the function? Anyone else try this please (you have to have one tab on IE open), hopefully its not just me that gets this error.

 

Expand  

Did you read my reply/edit or is this not a short runable script ?

#include <ie.au3>


Local $oIE = _IEAttach("","instance")

While 1

    Local $oFrame = _IEFrameGetObjByName($oIE,"anything")

    WEnd

Did you try this? If not please do, so I can confirm its not just me that gets an error.

Edited by ixam
Posted (edited)

This script is runable but without any sence:

  1. there a errors, but you don't handle them.    
  2. the cpu will overhead, because you aren't using any sleep in the never ending loop. So there are hardware caused error possible.

If you don't know how to use _IEFrameGetObjByName, hav a look in helpfile and run also the example.

Edited by AutoBert
Posted

@ixam

Give some info

  • AutoIt Version 
  • Windows Version
  • IE Version


and read this tickets:

https://www.autoitscript.com/trac/autoit/ticket/3167
https://www.autoitscript.com/trac/autoit/ticket/3097

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 9/10/2016 at 7:25 AM, mLipok said:

@ixam

Give some info

  • AutoIt Version 
  • Windows Version
  • IE Version


and read this tickets:

https://www.autoitscript.com/trac/autoit/ticket/3167
https://www.autoitscript.com/trac/autoit/ticket/3097

 

Expand  

Please read my posts:

  On 9/8/2016 at 10:37 AM, ixam said:

... and my AutoIt version is v3.3.14.2, my Internet Explorer Version is 11.0.30 and I use Windows 7  64 bit Version  6.1.7601 Service Pack 1 Build 7601.

Expand  

Anyway the second ticket looks very similar, but that was opened 14 months ago, so I is this ever going to be fixed?

 

 

  On 9/10/2016 at 7:03 AM, AutoBert said:

This script is runable but without any sence:

  1. there a errors, but you don't handle them.    
  2. the cpu will overhead, because you aren't using any sleep in the never ending loop. So there are hardware caused error possible.

If you don't know how to use _IEFrameGetObjByName, hav a look in helpfile and run also the example.

Expand  

Obviously the script doesnt make sense, its just an example. I know there are errors because _IEFrameGetObjByName never finds anything, but those dont matter, does the script ever stop for you by itself, which it shouldnt but it does for me? Btw I also get a fatal error if I use Sleep, its just comes slower.

Posted
  On 9/10/2016 at 8:38 AM, ixam said:

Please read my posts:

Expand  

I overlooked this.

  On 9/10/2016 at 8:38 AM, ixam said:

that was opened 14 months ago, so I is this ever going to be fixed?

Expand  

I hope so.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 9/10/2016 at 8:38 AM, ixam said:

Obviously the script doesnt make sense, its just an example.

Expand  

Than it's a example without sence, there is no need to search the same frame >1, if it isn't found 1. time it never will be found.

But test this (also nonsence script):

#include <ie.au3>


Local $oIE = _IE_Example("iframe")
Local $oFrame
Local $i=0
Local $tdStart=TimerInit()
While 1
    Local $oFrame = _IEFrameGetObjByName($oIE, "iFrameTwo")
    $i+=1
    If Not Mod($i,10) Then  Sleep(10)
    If $i>10000 Then ExitLoop
WEnd
ConsoleWrite(TimerDiff($tdStart)&@TAB&$i& ' Times looped'&@CRLF)
_IEQuit($oIE)

if you don't close IE while running it wouldn't crash or throw any error.

Posted
  On 9/10/2016 at 9:00 AM, AutoBert said:

Than it's a example without sence, there is no need to search the same frame >1, if it isn't found 1. time it never will be found.

But test this (also nonsence script):

Expand  

Thanks for that script, but unfortunately I cant test that for another week as I´m away from home. I´m on my phone right now, but I´d suspect it will throw the same error, because it essentially does the same thing (If you didnt understand my script crashed after 10 seconds, it also crashed with sleep it just took longer). Also it does make sense to search for the frame more then one time, because you know you can actually navigate the site.

Anyway this ticket from mLipok https://www.autoitscript.com/trac/autoit/ticket/3097 seems to be basically the same thing. Its 14 months old so I can only hope it will ever get fixed. Thanks for your help regardless.

Posted
  On 9/10/2016 at 8:38 AM, ixam said:

Please read my posts:

  On 9/8/2016 at 10:37 AM, ixam said:

... and my AutoIt version is v3.3.14.2, my Internet Explorer Version is 11.0.30 and I use Windows 7  64 bit Version  6.1.7601 Service Pack 1 Build 7601.

Expand  

 

Expand  

 

Please make your tests on Winodws 10 with latest upgrades and latest IE version.
This would be interesting.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I'm having the same problem- I use _IEQuit in the loop as I thought this would free up the resources used before it is called again, but watching the running processes in Task Manager I can see the amount of memory used by the IE processes increases steadily until no more instances of IE can be created and script crashes.

Posted

I was able to work around the problem by re-using the same instances of IE by using _IENavigate instead of _IEQuit and then _IECreate at the new URL. So now the memory leak problem seems to have been solved (if you start IE in non-visible mode then be sure the IE instances have been terminated in Task Manager, if not end the process before restarting the script).

Now I have the Recusion level has been exceeded error :lol:

Posted (edited)

@AutoBert @Dent @mLipok

I have made further progress in narrowing the bug down. It is still the function _IEFrameGetObjByName, that causes the script to crash after to many calls in a while loop. Here the example script from AutoBert to test it:

#include <ie.au3>


Local $oIE = _IE_Example("iframe")
Local $oFrame
Local $i=0
Local $tdStart=TimerInit()
While 1
    Local $oFrame = _IEFrameGetObjByName($oIE, "iFrameTwo")
    $i+=1
    If Not Mod($i,10) Then  Sleep(10)
    If $i>10000 Then ExitLoop
WEnd
ConsoleWrite(TimerDiff($tdStart)&@TAB&$i& ' Times looped'&@CRLF)
_IEQuit($oIE)

So I tested this on two Windows 7 PCs and one Windows 10 PC (all with up to date IEs) and the script crashes on both W7s, but works on the W10. So it might be a problem with Windows 7, but I cant say for sure.

I also discovered that this problem only occurs with newest version of AutoIt v3.3.14.2, I was able to run the script no problem compiled with AutoIt Version v3.3.12.0 on the Windows 7 PCs, so this seems to be the work around for the time being.

Anyway is anyone able to test and confirm my findings? Also should I make a ticket for this, the last AutoIt update was almost exactly 1 year ago, are the developers active anymore?

Edited by ixam
Posted
  On 9/20/2016 at 12:42 PM, ixam said:

Anyway is anyone able to test and confirm my findings? Also should I make a ticket for this, the last AutoIt update was almost exactly 1 year ago, are the developers active anymore?

Expand  

I have no win7. I suggest test with newest beta on win7. Change this 

If Not Mod($i,10) Then  Sleep(10)
;to
If Not Mod($i,10) Then  
    ConsoleWrite($i&@CRLF)
    Sleep(10)
EndIf

and if also crashes you should make a ticket.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...