DavidLago

Doubt about a variable's source

38 posts in this topic

It's easier to see than to explain:

1. I IECreate a webpage,

$oIE = _IECreate("https://somewebsite.somewhere.net", 1, 1, 0)

Local $oImg = _IEImgGetCollection($oIE, 1)
If @error Then
    FileWriteLine(@ScriptDir & "\ObjError.log", "Error ImgCollection - " & @HOUR & ":" & @MIN)
    Sleep(250)
EndIf

Sleep(250)

Local $sInfo = $oImg.src
If @error Then
    FileWriteLine(@ScriptDir & "\ObjError.log", "Error Img.src - " & @HOUR & ":" & @MIN)
    Sleep(250)
EndIf

First @error returns something for sure, because its listed in the help file.

Second @error, not sure.

Is there a way to figure out if setting a variable to a variable.src is causing my script to eventually show this?

Screenshot_15_01_2016_17_05_17.png


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites



If $oImg is not an object, you will have an error with $oImg.src. Add a Else to you first condition

Try this instead :

$oIE = _IECreate("https://somewebsite.somewhere.net", 1, 1, 0)

Local $oImg = _IEImgGetCollection($oIE, 1)
If @error Then
    FileWriteLine(@ScriptDir & "\ObjError.log", "Error ImgCollection - " & @HOUR & ":" & @MIN)
    Sleep(250)
    ; exit the script ?
Else
    Local $sInfo = $oImg.src
    ....
    ....
    ....
EndIf

 

Share this post


Link to post
Share on other sites

You can also use IsObj.  

$oIE = _IECreate("https://somewebsite.somewhere.net", 1, 1, 0)

Local $oImg = _IEImgGetCollection($oIE, 1)
If @error Then
    FileWriteLine(@ScriptDir & "\ObjError.log", "Error ImgCollection - " & @HOUR & ":" & @MIN)
    Sleep(250)
EndIf

Sleep(250)

If IsObj($oImg) Then
    Local $sInfo = $oImg.src
    If @error Then
        FileWriteLine(@ScriptDir & "\ObjError.log", "Error Img.src - " & @HOUR & ":" & @MIN)
        Sleep(250)
    EndIf
EndIf

 

Adam

 

Share this post


Link to post
Share on other sites

jguinch, that way I wouldn't know if there is an issue with $oImg.src or not. I'm thinking there is, because sometimes the page takes a while to load. And since the script measures the time it takes to load, its already inside a loop.

Adam, your suggestion might be exactly what I need!


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites

Guys,

It seems that the error is happening inside 

Local $oImg = _IEImgGetCollection($oIE, 1)

I'll try to circle around and have an @error looping on it for 30 sec. I'll post it here if it solved the problem.


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites

Which AutoIt version you are using ?


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@mLipok v3.3.14.2, Windows 7*

Edited by DavidLago

Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites

I think this is a known bug reported on Track.
The only thing you can do is wait for the solution to the problem - new beta or release.

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Do you know exactly what is this bug? The description? Is it on collecting the info from the IE?


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

EDIT:

After further reflection, I have to say that this problem is therefore only if you are using the error handler, and yet still have this problem.

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

@mLipok OK, help me understand that:

I saw that the bug reported is from a COM error that happens within some versions. But is this related somehow to the collecting of properties from IE with the function I mentioned above? (I'm asking because I really don't know).

Maybe the way that _IEImgGetCollection collects the info it needs uses this function with the COM error?


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites

First question is do you use ErrorHandler ?

Btw.
Yes this this is realted to _IEImgGetCollection ...
This UDF should be rewriten ... and is WorkInProgress.
 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

I do not use the Error Handler. Never used, too.

What I'm thinking in order to get around the error problem is something like this:

$aWhileT2 = False

Local $startLoginTimer = TimerInit() ;Time it

While $aWhileT2 = False
    Local $sInfo = ""
    Local $oImg = ""
    Sleep(100)
    Local $oImg = _IEImgGetCollection($oIE, 1)
    Sleep(500 ; Give it some time to get the info and sort it in memory
    If @error Then
        Sleep(50)
        ;_ErrorDebug() ; Create a function to write a debug log         
    EndIf
    Local $sInfo = $oImg.src    
    If $sInfo <> "https://Citrix.somewhere.com/Citrix/Apps/Store/media/DownArrow.png" Then 
        Local $endLoginTimer = TimerDiff($startLoginTimer)
        $timeLogIn = Round($endLoginTimer / 1000, 1)
        If $timeLogIn > 30 Then ; Caso exceda 30seg, os usuários podem estar tendo problemas para autenticar.
            _FileAppendToLine($PathtoLogFile, 1, "resultLogin=failure;" & "statusLogin=Failure: Users might be having problems to authenticate;" & "timeLogIn=Null;")
            _RenameToFinalLog()
            _RunDos($KillIECommand) ; KILL IE
            Exit
        EndIf
    Else
        _FileAppendToLine($PathtoLogFile, 1, "resultLogin=success;" & "statusLogin=Success;" & "timeLogIn=" & $timeLogIn & ";")
        _RenameToFinalLog()
        $aWhileT2 = True
    EndIf
WEnd

 


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites

But now I think I get what that error is...

Correct me if I'm wrong:

When this error right here happens: 

Local $oImg = _IEImgGetCollection($oIE, 1)
    Sleep(500) ; Give it some time to get the info and sort it in memory
    If @error Then
        Sleep(50)
        ;_ErrorDebug() ; Create a function to write a debug log         
    EndIf

It crashes, before setting the @error flag to non-zero.

amirite?


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites
1 hour ago, DavidLago said:

I do not use the Error Handler. Never used, too.

So you should start to use it (look in my signature).

1 hour ago, DavidLago said:

 

Local $oImg = _IEImgGetCollection($oIE, 1)
    Sleep(500) ; Give it some time to get the info and sort it in memory
    If @error Then
        Sleep(50)
        ;_ErrorDebug() ; Create a function to write a debug log         
    EndIf

 

Why you are testing for  Error from Sleep() ( this second line reset Error macro )

 

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Does the Example 2 in _IEImgGetCollection work for you ?

Also, variables should be declaced once, not every time. Can you try with that kind of code ?

$aWhileT2 = False

Local $startLoginTimer = TimerInit(), $endLoginTimer
Local $sInfo, $oImg

While $aWhileT2 = False
    $oImg = _IEImgGetCollection($oIE, 1)
    If @error Then
        Sleep(500)
    Else
        $sInfo = $oImg.src    
        
        If $sInfo <> "https://Citrix.somewhere.com/Citrix/Apps/Store/media/DownArrow.png" Then 
            $endLoginTimer = TimerDiff($startLoginTimer)
            $timeLogIn = Round($endLoginTimer / 1000, 1)
            If $timeLogIn > 30 Then ; Caso exceda 30seg, os usuários podem estar tendo problemas para autenticar.
                _FileAppendToLine($PathtoLogFile, 1, "resultLogin=failure;" & "statusLogin=Failure: Users might be having problems to authenticate;" & "timeLogIn=Null;")
                _RenameToFinalLog()
                _RunDos($KillIECommand) ; KILL IE
                _IEQuit()
                Exit
            EndIf
        Else
            _FileAppendToLine($PathtoLogFile, 1, "resultLogin=success;" & "statusLogin=Success;" & "timeLogIn=" & $timeLogIn & ";")
            _RenameToFinalLog()
            $aWhileT2 = True
        EndIf
    EndIf
WEnd

 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

With AutoIt 3.3.14.x you need to implement a COM error handler. Else your script will always crash in case of a COM error.

The bug in Trak describes a problem when multiple objects/properties are accessed in a single statement. When an error occurres the script crashes even when a COM error handler is defined.
Lets assume the following statement:

$vResult = $oIE.Collection.Object.Property

If Object does not exist then a COM error is raised. But the next processing step is to access Property before the COM error can be returned to the calling script.
Only solution at the moment: Split the Statement into pieces and check for errors after each step.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
1 hour ago, mLipok said:

Why you are testing for  Error from Sleep() ( this second line reset Error macro )

Right? That was stupid. Haha. I didn't even try (I'm far away from the testing computer now) I'm gonna fix it later.

@water Your explanation made it clear to me, thanks a lot for that.

@jguinch I'll test that code. It really makes sense to use it like this.

If it doesn't work, I'll try to split every property.

  


Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
Share on other sites

Or use Version 3.3.12.0 of AutoIt. Handles COM Errors without the need for a COM error handler and without any bugs ;) 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

@water Something weird happens when I run this version. Let me try to explain:

I am in Brazil, and I have a computer in the US running this script, to access a citrix environment and perform a lot of tests, running apps, clocking them, and some more things related to user experience.

When I run it from Chile, Colombia and other places nearby, they mostly work. When its far away, such as the US, China, Germany, and a bunch of other countries overseas, eventually the problem happens.

After heaps of testing, I figured out that the problem happens here:
 

$oIE = _IECreate("https://citrix.env.net", 1, 1, 0)
If @error Then
        MsgBox(0, "", "error IE CREATE") ; never shows any error
EndIf

; If I put a sleep(3000) here, it works most of the plays. If I change to 8000, works everytime.

Local $IELoadFlag = False
While $IELoadFlag = False
    $oForms = _IEFormGetCollection($oIE) ; it gets stuck here, it doesn't change the error flag, also never showed the MsgBox
    If @error Then
        MsgBox(0, "", "error get collection") 
    Else
        MsgBox(0, "", "Pass")
        $IELoadFlag = True
    EndIf
WEnd

I put the comments after the lines. 

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

The behavior looks very much alike the newer versions. 

 

Edited by DavidLago

Just a server analyst that has never been into programming that much. So, small fish here :)

Share this post


Link to post
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