Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

_IEGetObjByName warnings and code tweaking

$
0
0
With the help of a number of people on here I’ve managed to get my first script into a working state. Basically it reads a csv file of variables, pastes them one at a time to a web page whilst clicking a few buttons to process them through a sequence/loop of pages.

One of the issues I ran in to was that whilst the HTML on one page refreshes the browser and tab titles do not change, meaning I could not use WinWaitActive which is what I’ve used for the other pages.
I coded this instead, ‘SUB’ being the button name:


Sleep(500)

Local $oContinue = _IEGetObjByName($oIEconfirm, "SUB")

While @error

Sleep(250)

Local $oContinue = _IEGetObjByName($oIEconfirm, "SUB")

WEnd

_IEAction($oContinue, "click")


Whilst this works, is there a better way of achieving this button click?


Before I moved the Sleep(500) to where it is and introduced the Sleep(250) I was getting a lot of timeouts for _IEGetObjByName, e.g.:
--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: SUB, Index: 0)
Once that got to around 100 triggers things get a bit unstable. Script execution hung and I was seeing a 10 or more minitiure AutoIt icons on the status area of the Windows Start bar, where there is nornally one whils the script runs. Is there a limit to the number of warnings that can be encountered/handled? This is slightly academic, as the Sleep statements have reduced the occurance of the warnings but it would be nice to be aware of  any limitations that might be re-exposed if/when the latency/cycle time of the transactions increased.

One final newbie question, is it possible to have the script and windows run in the background/independent of focus?

Thanks in advance!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>