Jump to content

Recommended Posts

Posted

At least the help file for _IELoadWait describes what to do when there are problems with loading  a page.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)
  On 1/19/2016 at 1:36 PM, DavidLago said:

@waterIt seems that the bug for the COM error still happens here. I think that, when IEFormGetCollection doesn't find an expected object (page not fully loaded), it crashes out, it won't loop, won't even set an @error flag, just out.

(OBS: IELoadWait won't work, because the Citrix https blocks it)

Expand  

As I understand you are now using error handler ? (I pointed you to my signature)

What you mean: Citrix https block IELoadWait ? 

I'm using few polish gov portal to automate many task. Each of them usinng HTTPS , and I have no problem with it.

EDIT: Question: Please check if in this webpage there are FRAMES ?

Edited by mLipok

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

Yes. I took the "sleep" idea from there, but let's say its not a reliable way to work around the problem, since I need to clock the time to load the page.

Posted

Then you could only check for the existance of an object that, if it is loaded, tells you that the page has fully loaded.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

In one cases I was need to check each frames , as there was different documents.
Each document is loaded separate.

 

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 1/19/2016 at 2:47 PM, mLipok said:

As I understand you are now using error handler ? (I pointed you to my signature)
 

Expand  

Yes, (_IEErrorHandlerRegister(_User_ErrFunc), If I'm using it correctly - it shows me this in the console:

"C:\Program Files (x86)\AutoIt3\Include\IE.au3" (1784) : ==> The requested action with this object has failed.:
Return SetError($_IESTATUS_Success, 0, $oObject.document)
Return SetError($_IESTATUS_Success, 0, $oObject^ ERROR

 

  On 1/19/2016 at 2:47 PM, mLipok said:

What you mean: Citrix https block IELoadWait ? 

Expand  

This happens: 9 ($_IEStatus_ClientDisconnected) - Client Disconnected

 

  On 1/19/2016 at 2:47 PM, mLipok said:

EDIT: Question: Please check if in this webpage there are FRAMES ?

Expand  

 

There are Frames in this webpage, yes. The initial page looks like this:Screenshot_19_01_2016_13_17_13.png 

  On 1/19/2016 at 3:03 PM, water said:

Then you could only check for the existance of an object that, if it is loaded, tells you that the page has fully loaded.

Expand  

That's a way better idea than what I was doing (getting the IE title bar to export the string to a variable so I could check if it matches). Thanks a lot.
I'll have to find an object with a name first. That's something quite hard to find on Citrix pages.

Posted
; Browser object is destroyed before we try to operate upon it
        Case -2147417848 ; "The object invoked has disconnected from its clients."
            Return $_IESTATUS_ClientDisconnected
        Case -2147023174 ; "RPC server not accessible."
            Return $_IESTATUS_ClientDisconnected
        Case -2147023179 ; "The interface is unknown."
            Return $_IESTATUS_ClientDisconnected

What happend to your Internet Explorer ?

When this happens are you still able to attach to this "Current/Changed" IE object ?

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 (edited)

IE Browser keeps still, same page, the mouse arrow has a loading circle right to it. But it doesn't give me the option to interact with it. Even if the page loads, the function won't reset its state, even if within a loop.

 

Edited by DavidLago
Posted (edited)
  On 1/19/2016 at 3:03 PM, water said:

Then you could only check for the existance of an object that, if it is loaded, tells you that the page has fully loaded.

Expand  

Not working reliably :(

I'm trying to find a way to have WinExist do the trick, but I still haven't found a way to make it match only a word of the title (for some reason, every computer shows it differently..

Local $startOpenPortalTimer = TimerInit()

While $WhileT1 = False ;Enquanto não tiver janela do Citrix aparecendo, incrementa 0.1 seg, até aparecer. Timeout = 30seg.

    If Not (WinExists("Citrix Access Gateway - Windows Internet Explorer", "https://citrix.env.org/index.html") Or WinExists("NetScaler Gateway - Windows Internet Explorer", "https://citrix.env.org/index.html")) Then
        Sleep(100)
        Local $endOpenPortalTimer = TimerDiff($startOpenPortalTimer)
        Local $timeOpenPagePortal = Round($endOpenPortalTimer / 1000, 1)
        If $timeOpenPagePortal > 30 Then 
            _FileAppendToLine($PathtoLogFile, 1, "resultPagePortal=failure;" & "statusPagePortal=Failure: Opening Page Portal timeout reached;" & "timeOpenPagePortal=" & $timeOpenPagePortal & ";" & "resultLogin=failure;" & "statusLogin=Failure: Opening Page Portal timeout reached;" & "timeLogIn=null;")
            _RenameToFinalLog()
            _RunDos($KillIECommand)
            Exit 
        EndIf
    Else
        $WhileT1 = True 
    EndIf
WEnd

"gateway" seems to be a word that comes up in every title while accessing this page. I'll try to understand that RegExp thing.

Edited by DavidLago
Posted
  On 1/19/2016 at 3:26 PM, DavidLago said:

There are Frames in this webpage, yes. The initial page looks like this:Screenshot_19_01_2016_13_17_13.png

Expand  

 

You misunderstood my question.
use this function:

_IEFrameGetCollection(....)

and check  @extended = Frame count.

 

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 1/19/2016 at 4:29 PM, DavidLago said:

"gateway" seems to be a word that comes up in every title while accessing this page. I'll try to understand that RegExp thing.

Expand  
Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

If Not WinExists("Gateway", "https://citrix.env.org/index.html") Then
    ;Blah
EndIf

 

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

Monkey's are, like, natures humans.

Posted
  On 1/19/2016 at 11:03 PM, mLipok said:

You misunderstood my question.
use this function:

_IEFrameGetCollection(....)

and check  @extended = Frame count.

Expand  

Thanks! Nice idea.

 

  On 1/19/2016 at 11:32 PM, JohnOne said:

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase If Not WinExists("Gateway", "https://citrix.env.org/index.html") Then     ;Blah EndIf

Expand  

I've never seen that function before. I'm doing it like this:

If Not WinExists(("[REGEXPTITLE:(?i)(.*Citrix.*|.*Gateway.*)]")) Then
        If @error Then
            _DebugLog("01", "Couldn't find the Citrix Logon Page.")
        EndIf
....
....
...

Which one would be the best?

Posted
  On 1/19/2016 at 3:10 PM, mLipok said:

In one cases I was need to check each frames , as there was different documents.
Each document is loaded separate.

Expand  

 

I made example showing how it should be done:

#include <ie.au3>
#include <Timers.au3>

_Example()

Func _Example()

;~  http://www.aaronpeters.nl/blog/iframe-loading-techniques-performance?%3E

;~  Local $oIE = _IECreate('http://www.aaronpeters.nl/blog/testpages/iframe-dynamic-after-onload.htm', 0, 1, 0)
;~  Local $oIE = _IECreate('http://www.aaronpeters.nl/blog/testpages/iframe-dynamic-asynch.htm', 0, 1, 0)
    Local $oIE = _IECreate('http://stevesouders.com/efws/iframe-onload-nonblocking.php?t=1453416601', 0, 1, 0)
    Local $hStarttime = _Timer_Init()
    _IELoadWait($oIE)
    ConsoleWrite('> 1 = ' & _Timer_Diff($hStarttime) & @CRLF)
    _IELoadWait_ForAllFrames($oIE)
    ConsoleWrite('> 2 = ' & _Timer_Diff($hStarttime) & @CRLF)
    _IEQuit($oIE)
EndFunc   ;==>_Example


Func _IELoadWait_ForAllFrames(ByRef $oObject, $iDelay = 0, $iTimeout = Default)
    _IELoadWait($oObject, $iDelay, $iTimeout)
    If @error Then Return SetError(@error, @extended, -1)

    Local $oFrames_coll = _IEFrameGetCollection($oObject)
    #forceref $oFrames_coll
    Local $iNumFrames = @extended
    Local $oFrame = Null
    For $iFrame_idx = 0 To ($iNumFrames - 1)
        $oFrame = _IEFrameGetCollection($oObject, $iFrame_idx)
        _IEDocGetObj($oFrame)
        If Not @error Then
            _IELoadWait($oFrame, $iDelay, $iTimeout)
            If @error Then Return SetError(@error, @extended, -1)
        EndIf
    Next

    Return SetError($_IESTATUS_Success, 0, 1)

EndFunc   ;==>_IELoadWait_ForAllFrames

 

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 1/23/2016 at 9:44 PM, mLipok said:

I made example showing how it should be done:

 

Expand  

Thanks a lot! It took me a while to understand (since I'm very weak at coding) but I got it. I'm gonna try to reproduce that to my own script.

I've learned a lot from this thread. Thanks to all that helped!

Posted

I'm glad to hear that.

mLipok

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

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