Jump to content

_IELoadWait Timeout Does not Work With _IEAction


AFC
 Share

Go to solution Solved by bogQ,

Recommended Posts

....
_IELoadWaitTimeout(2)
    While($sayac < 500)  
        $oChannel = _objectAra($oIE, $object, $search, $property)
        $sayac = $sayac + 1
        _IEAction($oChannel, "click")
        _IELoadWait($oIE)
        If @error = 6 Then
            MsgBox(0,"","timeout")
        ExitLoop
        EndIf
    WEnd
....

So my problem is I set my timeout parameter even 2 miliseconds, page stil continues to clicking it does check timeout value, neither it leaves the While function or prints MsgBox for @error = 6 parameter, If I use it without _IEAction it works, it stops after timeout. So where is my fault ?

(inside _IEAction, it clicks a "span" object)

* If page is not refreshing, just load more objects like pinterest.com, does IE changes ? I mean, is it loading ?

Edited by AFC
Link to comment
Share on other sites

your parametar isnt to wait 2 m/seconds, its to return after 2 m/seconds

 

#include <IE.au3>
#include <MsgBoxConstants.au3>
MsgBox($MB_SYSTEMMODAL, "_IELoadWaitTimeout", _IELoadWaitTimeout(-1) / 1000 & " sec")
_IELoadWaitTimeout(300)
MsgBox($MB_SYSTEMMODAL, "_IELoadWaitTimeout", _IELoadWaitTimeout(-1) / 1000 & " sec")

$oIE = _IECreate('www.google.rs', 0, 1, 0 )
_IELoadWait($oIE)
If @error = 6 Then
    MsgBox(0, "", "timeout")
EndIf
MsgBox($MB_SYSTEMMODAL, "_IELoadWaitTimeout", _IELoadWaitTimeout(-1) / 1000 & " sec")
if you need to wait before checking then set $i_delay parametar on _IELoadWait or did i misunderstud your problem? Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

but still your checking only if error is 6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout

did you check if any other error turned up on _IELoadWait?

If @error Then MsgBox(0, "error", "error number: "&@error)

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Yes there is but it continues after that error, my staff is so-->

1) click until there is nothing to load ( so load button disappears), when it is disappears and cant find button _IELoadWait retruns Invalid Data Type ( or sometimes page does not load completely and it gives same error, but I dont want to return when this error returns, because there may be still load button if it returns because page did not load completely and tried to click button)

2) When page loads completely and there is no more load button, IE will try to load more and try to click, it will return Invalid Data Type but also there is nothing to load, so I want this time return out while loop, so I want to check timeout.

Link to comment
Share on other sites

your getting one error and disregarding it expecting some other error that cant b shown coz your getting all the time other error...

so what is that error and why are you disregarding it?

just a quick note that _IELoadWait do have 2x Sleep(100) on its loops and i dnot know how fast is readyState returned :P

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

lets say it gets an Invalid Data Type error when it is 325th loop, but I dont check  Invalid Data Type  error, I just want to skip this error

then it starts 326th loop, I want to see that it times out, not it finds Invalid Data Type, how can I do that ?

I may check only Invalid Data Type error, because I want to click "load" button until there is no load button, but I can't because sometimes IE tries to click button that was not completely ready and my program thinnks that it finished to end of the loading and gives Invalid Data Type error 

Link to comment
Share on other sites

  • Solution

well wait for it to b ready. trying to do clicks and checks while page isnt ready will not help.

if you have Invalid Data Type error try to set $i_delay to lets say 500ms and $i_timeout to something reasnoble like 5 seconds, if needed put 2 times _IELoadWait if page reload it self after first load.

if and after second _IELoadWait and first _IELoadWait fail, redirect it to knwon starting url to try one more time.

After correct page loading check if you have your button still there, use _IEFormElementGetObjByName (or similar command that your using) and check if it returned any error. If page is loaded correctly and button returns error your problem is solwed, you will know that your button is or not there.

all i see from your code is trying to click something that might or maynot be there depending only on errors where you expect specific error that mignt not b there coz of the main question, is even your clickable object is there.

If you dont want your code to be posted publicly but the site is publicly available you can pm me with original code to try to find some workaround, the way you're doing it now, i just dont see your original code working in my mind at the curent state that its in.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Thanks for your interest, Icant refresh or cant go new url because of my page backs its orginal station(I loaded 5 times, but still in the same page, I thinks it uses AJAX or something like that, so If I refresh page It goes back its first sitiation which is loaded 1 time, but same URL).  Looks like I cant do it myself or I cant explain my problem well. I  Can you check your pm

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...