Jump to content

ie.au3 Compatibility with Internet Explorer


Recommended Posts

I am creating a Autoit script for my boss and have developed and tested the script from my end but when I try to run it on my boss' computer it gives some errors. I know it works a couple of steps like opening IE then going to a website and selecting buttons and textboxes but somewhere along the lines it gives me a "variable must be an object" or something like that so that means one of my variables aren't being recognized when the script is running on another PC.

I made sure to compile the script in 64-bit as we both have 64-bit PC, the only difference is he's running IE11 while I have IE8. Do I need to downgrade his IE version?

Link to comment
Share on other sites

  • Moderators

IE11 had a bad update in december, make sure you either remove that update or have the latest update that is said to have fixed the issues.

Safer to run in 32 bit by the way... this way you don't have to worry about conflicting dll's etc between OS's and your scripts.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks Smoke. The reason I'm asking this is because I read in the past that newer versions of IE won't work well with IE.au3 or Autoit and that you have to choose lower versions of IE. I couldn't find that topic anymore on the internet.

I thought it was the case since the AI I created works perfect on my end but not on boss' end. Running in 32-bit would work? I tried running a 64-bit AI once in a 32-bit laptop and I got an error saying I should run the correct bit so I used a 32-bit to make it work so I thought they had to be exact. If you say IE11 shouldn't be the problem then I'll continue with it and do a new update just to be sure. I'll try to troubleshoot there to see where the error is coming from.

Link to comment
Share on other sites

  • Moderators

64bit exe on 32bit OS = No

32bit exe on 64bit OS = Yes

64bit OS can run both 32bit/64bit executables.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Wolfiesaxah,

 I'll try to troubleshoot there to see where the error is coming from.

 

You might want to consider adding a COM error handler, if you have not done so already.  See ObjEvent in the Help file.  Checking for errors, as Danp2 has alluded to, is always a good idea.  The doc for each function defines return and error values.

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Hi Guys, sorry for the delay in returning to this topic but I tested and did more research, placed error handlers per lines and have determined that the issue occurs randomly but occurs often, they happen when IE calls for loadwait function. I tried removing the loadwaits and replaced them with sleep() but for some reasons I keep getting that error at the "wend" line of the IE.au3 loadwait function so I'm assuming some of the other IE functions I used may be calling the loadwait function too. It's as if the loadwait function fails often and couldn't really check if the IE Browser is ready or still loading.

Link to comment
Share on other sites

Just sharing. I couldn't exactly identify why it was failing on _IELoadWait as it sometimes fail and sometimes work so I decided to construct my own function for load wait since it is where the error usually occurs.

This has been working for me without errors so far. My customized function does not have the necessary error handlers but it works and I am crossing my finger hoping that this function doesn't cause trouble on my PC.

Func CustomIELoadWait($TheIEObject)
   While ($TheIEObject.Busy and $TheIEObject.StatusText <> "Done")
      Sleep(100)
   WEnd
EndFunc

The error specifically occurs on $TheIEObject.document.readystate on IE.au3 so I excluded that.

Edited by Wolfiesaxah
Link to comment
Share on other sites

I take it you are still using WIN XP if you are on IE 8?

If not them just update to IE 11.

IE.au3 works fine with IE 11

Also, what doe "error handlers per lines" mean? have you added a COM error handler?

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Haha those were the old times but no, I'm using Win7 64bit. I saw other AU3 users having problems with the Wend part of the IELoadWait as well so I though I'd share. It couldn't have been the IE version though, I mean I do have IE8 but I'm running and testing the script on IE9 and IE11 on my workmates' computers as I am developing this script for them. By Error handlers I meant the COM error handlers from the function _IELoadWait().:)

Link to comment
Share on other sites

Ah it looks like I still haven't found the solution to this yet.

So far the script for checking if IE has finished loading the page isn't accurately working. Even the readystate. There seem to be no solution to this.:s What do we need to use to halt the next lines of scripts until the IE page finished loading?

Link to comment
Share on other sites

WolfieSaxah,

Just taking a S.W.A.G., is it possible for the status to be "done" and the page still be "busy", or vice versa?

Yeah but I have done a combination of while $ie.busy and $ie.statustext <> "Done" and $ie.readystate < 4 and still it sometimes works it sometimes doesn't. And when it doesn't, the call for controls on that expected next page is called to soon and gives me an error because the objects doesn't exist yet.

I tried making a loop that checks if an object exist on the page yet then proceeds if it does but that doesn't work either. Why wouldn't these functions work lol

Link to comment
Share on other sites

I tried making a loop that checks if an object exist on the page yet then proceeds if it does but that doesn't work either. Why wouldn't these functions work lol

 

That is a good way to go about it, perhaps there is something not right with your code.

Are you prepared to show your code, or the function at least.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I thought I already posted a repro.:/

Here's what I've been using so far

  While 1
      Sleep(2000)
      if $oIE.readystate = 4 then ExitLoop
  WEnd

I gave it 2 seconds each while so as to add time for the browser to load up. I tried reusing readystate but instead of using the (readystate <> 4), I changed it to (readystate = 4) if-statement. Also, I have added this in the main code instead of a function-to-call. So far so good.

Link to comment
Share on other sites

But that code is not testing if some element is an object yet, it's just testing the readystate of $oIe.

Show the code you made for..

I tried making a loop that checks if an object exist on the page yet then proceeds if it does but that doesn't work either. Why wouldn't these functions work lol
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

 

But that code is not testing if some element is an object yet, it's just testing the readystate of $oIe.

Show the code you made for..

I tried making a loop that checks if an object exist on the page yet then proceeds if it does but that doesn't work either. Why wouldn't these functions work lol

Oh that, the code is below.

While 1
  Sleep(1000)
  If IsObj($oIE.document.getElementById("Submit All Pages")) Then ExitLoop
WEnd
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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