careca Posted October 28, 2018 Share Posted October 28, 2018 30 minutes ago, oemript said: I would like to know on what to contain inside IEAttach(???) under following case. Did you look at the help file? It with an existing IE window. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
oemript Posted October 28, 2018 Author Share Posted October 28, 2018 The location for error is found, after testing coding, after MsgBox(16, "Main 2", 2) is displayed and going to _GetTradeLog(), the MsgBox(16, "Log 0", 0) does not display at all, which must be something wrong on call _GetTradeLog function after clicking 8 times. For IEAttach, I get no idea on what object should be monitored for error correction process. Based on help file, there is not much related example under my situation. Do you have any suggestions on what object should be used for IEAttach(???)? Thanks, to everyone very much for any suggestions (^v^) Link to comment Share on other sites More sharing options...
Danp2 Posted October 28, 2018 Share Posted October 28, 2018 Look at your usage of _IECreate. You've told it to try to attach to an existing instance of IE before creating a new one. Therefore, it tries to call _IEAttach. This is where that console output is coming from, and it is benign. To eliminate it, change your _IECreate by removing the 2nd parameter. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
oemript Posted October 28, 2018 Author Share Posted October 28, 2018 20 minutes ago, Danp2 said: Look at your usage of _IECreate. You've told it to try to attach to an existing instance of IE before creating a new one. Therefore, it tries to call _IEAttach. This is where that console output is coming from, and it is benign. To eliminate it, change your _IECreate by removing the 2nd parameter. I have tried following cases and receive Error while calling _IEAttach() function. Error: 7 _IEAttach($HWND) _IEAttach("http://www.aastocks.com/en/stocks/analysis/transaction.aspx?symbol=00005") Do you have any suggestions on what wrong it is? Thanks, to everyone very much for any suggestions (^v^) Link to comment Share on other sites More sharing options...
Danp2 Posted October 28, 2018 Share Posted October 28, 2018 Sorry, but your reply makes no sense to me. There isn't an instance of _IEAttach in the code you posted. Therefore, the console output can only be coming from _IECreate. P.S. The default behavior for _IEAttach is to look for the browser's title. If you want to search by a different method, then you need to supply the appropriate value for the 2nd parameter. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
oemript Posted October 28, 2018 Author Share Posted October 28, 2018 (edited) Deleted Edited October 28, 2018 by oemript Link to comment Share on other sites More sharing options...
oemript Posted October 28, 2018 Author Share Posted October 28, 2018 (edited) After clicking 8 times, Error occurs after MsgBox(16, "Main 2", 2). When I insert If @error on following location, I get error message as shown below. If IsObj($oObject.document.getElementById($sID)) Then If IsObj($oObject.document^ ERROR Does anyone have any suggestions? Thanks, to everyone very much for any suggestions (^v^) >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\AutoIT\TradeLog.au3" --> IE.au3 T3.0-2 Warning from function _IEAttach, $_IESTATUS_NoMatch "C:\Program Files (x86)\AutoIt3\Include\IE.au3" (1900) : ==> The requested action with this object has failed.: If IsObj($oObject.document.getElementById($sID)) Then If IsObj($oObject.document^ ERROR expandcollapse popup#include <Array.au3> #include <IE.au3> #include <File.au3> Global $bTradeLog = False, $aTradeLog Global $oIE = _IECreate("http://www.aastocks.com/en/stocks/analysis/transaction.aspx?symbol=00005", 1) $HWND = _IEPropertyGet($oIE, "hwnd") WinSetState($HWND, "", @SW_MAXIMIZE) _IELoadWait($oIE, 5000) Global $otradeLog = _IEGetObjByName($oIE, "charttype") _IEAction($otradeLog, "click") Global $odivlogNext = _IEGetObjById($oIE, "divLogNext") While $odivlogNext.ClassName = "float_r pad0imp rel jshoverwithclass sel" ;$oIE = _IEAttach($title, "Title") ; Continue the execution of the script MsgBox(16, "Main 1", 1) _IEAction($otradeLog, "focus") _IEAction($odivlogNext, "focus") MsgBox(16, "Main 2", 2) ; <<<<<<<<<<<<<<<<< ERROR OCCUR HERE If @error Then ConsoleWrite("Error while calling _IEAttach() function. Error: " & @error & @CRLF) Else _GetTradeLog() EndIf MsgBox(16, "Main 3", 3) Sleep(300) _IEAction($odivlogNext, "click") Sleep(500) WEnd _ArrayDisplay($aTradeLog) ;~ Get the last Transaction Log page. _GetTradeLog() _IEQuit($oIE) _ArrayDisplay($aTradeLog) Local $sFilePath = "D:\stocks.txt" _FileWriteFromArray($sFilePath, $aTradeLog, 1) ; Display the file. ShellExecute($sFilePath) Func _GetTradeLog() Local $sFilePath = "D:\stocks.txt" Local $otradeLog1 = _IEGetObjById($oIE, "tradeLog1") Local $atradeLog1 = _IETableWriteToArray($otradeLog1, True) Local $otradeLog2 = _IEGetObjById($oIE, "tradeLog2") Local $atradeLog2 = _IETableWriteToArray($otradeLog2, True) MsgBox(16, "Log 0", 0) If @error Then ConsoleWrite("Error while calling _IEAttach() function. Error: " & @error & @CRLF) Else ;MsgBox(16, "Log 0", 0) If $bTradeLog = False Then MsgBox(16, "Log 1", 1) $aTradeLog = $atradeLog1 MsgBox(16, "Log 2", 2) _ArrayConcatenate($aTradeLog, $atradeLog2, 1) MsgBox(16, "Log 3", 3) $bTradeLog = True MsgBox(16, "Log 4", 4) Else MsgBox(16, "Log 5", 5) _ArrayConcatenate($aTradeLog, $atradeLog1, 1) MsgBox(16, "Log 6", 6) _ArrayConcatenate($aTradeLog, $atradeLog2, 1) EndIf ;_ArrayDisplay($aTradeLog) MsgBox(16, "Log 7", 7) _FileWriteFromArray($sFilePath, $aTradeLog, 1) MsgBox(16, "Log 8", 8) EndIf EndFunc Edited October 28, 2018 by oemript Link to comment Share on other sites More sharing options...
oemript Posted October 28, 2018 Author Share Posted October 28, 2018 Would it be version issue causing this error? I am using version as shown below Win7 64 bit IE11.0.9600.19129 SciTE-Lite Version 3.5.4 Jan 30 2018 12:08:28 Would above version causing this error issue? Does anyone have any suggestions? Thanks, to everyone very much for any suggestions (^v^) Link to comment Share on other sites More sharing options...
Danp2 Posted October 28, 2018 Share Posted October 28, 2018 You should install the full version of Scite. Also need to figure out the version of Autoit you are running. This will display in the Scite Output panel. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
oemript Posted October 28, 2018 Author Share Posted October 28, 2018 (edited) Would it be correct full version as shown below? if not, please provide a link. Do you have any suggestions? Thanks, to everyone very much for any suggestions (^v^) Edited October 28, 2018 by oemript Link to comment Share on other sites More sharing options...
Danp2 Posted October 28, 2018 Share Posted October 28, 2018 That's the latest Autoit version, which still doesn't get you the full install of Scite. That can be found here. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
oemript Posted October 28, 2018 Author Share Posted October 28, 2018 Could you please tell me exactly on which one I should install for full install of Scite? Thanks, to everyone very much for any suggestions (^v^) Link to comment Share on other sites More sharing options...
Danp2 Posted October 28, 2018 Share Posted October 28, 2018 The first one is the obvious choice. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
oemript Posted October 29, 2018 Author Share Posted October 29, 2018 (edited) SciTE Version 4.1.0 Jun 27 2018 21:46:27 When I run following version as shown below, there is strange char occur, would this version correct? Do you have any suggestions? Thanks, to everyone very much for any suggestions (^v^) Edited October 29, 2018 by oemript Link to comment Share on other sites More sharing options...
oemript Posted October 29, 2018 Author Share Posted October 29, 2018 (edited) 8 hours ago, Danp2 said: That's the latest Autoit version, which still doesn't get you the full install of Scite. That can be found here. Do I have to use full install Scite? console come out strange char and I should be focused on my error issue instead, would the latest Autoit version be enough? Could anyone try using the latest Autoit version to run above given script to see on whether you get the similar issue or not? After clicking 8 times, Error occurs after MsgBox(16, "Main 2", 2). When I insert If @error on following location, I get error message as shown below. If IsObj($oObject.document.getElementById($sID)) Then If IsObj($oObject.document^ ERROR Furthermore, how to debug line by line within AutoIT? so I can see which run is executed and see the result Does anyone have any suggestions? Thanks, to everyone very much for any suggestions (^v^) Edited October 29, 2018 by oemript Link to comment Share on other sites More sharing options...
Subz Posted October 29, 2018 Share Posted October 29, 2018 There is approx 6000 entries in that list, while it's processing you can not interact with the window, you have to wait until its completed, as I mentioned I've run this multiple times and its always returned approx 6000 entries in Array by using the code I posted above. I'm running Autoit 3.3.14.5, on Windows 10 x64 Enterprise 1803 with 32gb ram, maybe try closing some of your other applications and have only IE open as it maybe a resource issue, since you mentioned that the window goes gray than black which could mean IE is hanging which is cause the issue. Link to comment Share on other sites More sharing options...
oemript Posted October 29, 2018 Author Share Posted October 29, 2018 (edited) 11 minutes ago, Subz said: There is approx 6000 entries in that list, while it's processing you can not interact with the window, you have to wait until its completed, as I mentioned I've run this multiple times and its always returned approx 6000 entries in Array by using the code I posted above. I'm running Autoit 3.3.14.5, on Windows 10 x64 Enterprise 1803 with 32gb ram, maybe try closing some of your other applications and have only IE open as it maybe a resource issue, since you mentioned that the window goes gray than black which could mean IE is hanging which is cause the issue. When you run those coding, can your PC finish processing all data until the end of Next button without any error (try a least 3-4 times)? Thanks, to everyone very much for any suggestions (^v^) Edited October 29, 2018 by oemript Link to comment Share on other sites More sharing options...
Subz Posted October 29, 2018 Share Posted October 29, 2018 Yep Link to comment Share on other sites More sharing options...
oemript Posted October 29, 2018 Author Share Posted October 29, 2018 (edited) On my PC, error is always occurred after 8 times within loop, I have setup using msgbox to identify location, but there is no error message and the loop stops. I would like to debug line by line within AutoIT so I can see which code is executed and see the response and result, would it be possible? if yes, do you have any suggestions on how to set up the debug process? Do you have any suggestions? Thanks, to everyone very much for any suggestions (^v^) Edited October 29, 2018 by oemript Link to comment Share on other sites More sharing options...
Subz Posted October 29, 2018 Share Posted October 29, 2018 Place a Autoit Com error handler in your script see following for an example: Link to comment Share on other sites More sharing options...
Recommended Posts