Jump to content

YouriKamps

Members
  • Posts

    5
  • Joined

  • Last visited

YouriKamps's Achievements

  1. Hello all, For some strange reason #AutoIt3Wrapper_run_debug_mode=Y is only working in some of my scripts... Reinstalled both Autoit and Scite4autoit3 but it's still not working yet it used to work some time ago. The script that doesn't work gives me this output (after this output it continues running the script without debug): >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\LSD Scripts\LSD Scripts 1\LSD Scripts 1.au3" /UserParams +>14:41:41 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0413) +> SciTEDir => C:\Program Files\AutoIt3\SciTE UserDir => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:C:\Program Files\AutoIt3 input:G:\LSD Scripts\LSD Scripts 1\LSD Scripts 1.au3 +>14:41:41 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files\AutoIt3\autoit3.exe "G:\LSD Scripts\LSD Scripts 1\LSD Scripts 1.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop !> Starting in DebugMode.. Line: @error-@extended: Line syntax +>14:41:43 AutoIt3.exe ended.rc:0 +>14:41:43 AutoIt3Wrapper Finished. >Exit code: 0 Time: 1.807 Another script (same Scite, different tab) gives me this: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\LSD Scripts\Mousemover\mousemover.au3" /UserParams +>14:48:14 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0413) +> SciTEDir => C:\Program Files\AutoIt3\SciTE UserDir => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\kamps495\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:C:\Program Files\AutoIt3 input:G:\LSD Scripts\Mousemover\mousemover.au3 +>14:48:15 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files\AutoIt3\autoit3.exe "G:\LSD Scripts\Mousemover\mousemover.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop !> Starting in DebugMode.. Line: @error-@extended: Line syntax 0001: 0-0: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** 0002: 0-0: #AutoIt3Wrapper_run_debug_mode=Y ;y = debug aan, n = debug uit 0003: 0-0: #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** 0004: 0-0: Opt("WinWaitDelay", 1000) and gives me line-by-line debug. Both have the same directives at the top: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_run_debug_mode=Y ;y = debug aan, n = debug uit #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** I can't figure it out for the life of me... EDIT: It seems that adding #RequireAdmin ANYWHERE near the beginning of the script (before or after the #Region-part) breaks the debug. I really need #RequireAdmin (without it Internet Explorer crashes on me), but I cannot debug. When adding #RequireAdmin I can run my script, but I cannot debug it...
  2. Ok, I found a way around the problem. The problem was getting a non-existing hwnd, so instead of Local $hWndpopup = _IEPropertyGet($oIEpopup, "hwnd") I used WinGetHandle. i will mark this as solved
  3. Func ats_idactionpopup does attach to the correct dialogbox (I commented out the MsgBox, but this shows the correct url used in the dialogbox). The dialogbox is structured in the exact same way as the main jsp with the same name frame (AppWindow), but ControlSend doesn't send the {enter} to Button1. Console output: --> IE.au3 T3.0-1 Error from function _IEPropertyGet, $_IESTATUS_InvalidObjectType Complete code: #include <IE.au3> #include <MsgBoxConstants.au3> #RequireAdmin Global $oIE = _IECreate("url_to_webpage") Func ats_idactionmain($ats_id, $ats_action) Local $oFrame = _IEFrameGetObjByName($oIE, "AppWindow") Local $oSubmit = _IEGetObjByName($oFrame, $ats_id) Local $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($oSubmit, "focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $ats_action) EndFunc Func ats_idactionpopup($ats_popup, $ats_idpopup, $ats_actionpopup) Local $oIEpopup = _IEAttach($ats_popup, "dialogbox") ;MsgBox($MB_SYSTEMMODAL, "The URL", _IEPropertyGet($oIEpopup, "locationurl")) Local $oFramepopup = _IEFrameGetObjByName($oIEpopup, "AppWindow") Local $oSubmitpopup = _IEGetObjByName($oFramepopup, $ats_idpopup) Local $hWndpopup = _IEPropertyGet($oIEpopup, "hwnd") _IEAction($oSubmitpopup, "focus") ControlSend($hWndpopup, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $ats_actionpopup) EndFunc _IELoadWait($oIE) ats_idactionmain("GEBRUIKER1", "username") ats_idactionmain("WACHTWOORD1", "password") ats_idactionmain("Pb_inloggen", "{enter}") Sleep(4000) ats_idactionpopup("afdelingskeuze", "Button1", "{enter}") EDIT: It is driving me nuts... Using the following I found out for sure that it is attaching to the correct dialogbox: Local $oFrames = _IEFrameGetCollection($oIEpopup) Local $iNumFrames = @extended Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF Local $oFramepopup = 0 For $i = 0 To ($iNumFrames - 1) $oFramepopup = _IEFrameGetCollection($oIEpopup, $i) $sTxt &= _IEPropertyGet($oFramepopup, "innertext") & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Frames Info", $sTxt) It even gives me the text in the correct frame (name AppWindow). Switched to debug-output and found the line it chokes on: 0047: 0-0: ats_idactionpopup("afdelingskeuze", "Button1", "{enter}") 0017: 0-0: Local $oIEpopup = _IEAttach($ats_popup, "dialogbox") 0018: 0-0: Local $oFramepopup = _IEFrameGetObjByName($oIEpopup, "AppWindow") 0019: 0-0: Local $oSubmitpopup = _IEGetObjByName($oIEpopup, $ats_idpopup) --> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: Button1, Index: 0) 0020: 7-0: Local $hWndpopup = _IEPropertyGet($oFramepopup, "hwnd") --> IE.au3 T3.0-1 Error from function _IEPropertyGet, $_IESTATUS_InvalidObjectType 0021: 4-1: _IEAction($oSubmitpopup, "focus") --> IE.au3 T3.0-1 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType 0022: 3-1: ControlSend($hWndpopup, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $ats_actionpopup) 0023: 0-0: EndFunc but when looking at the source, using debugbar AND firebug, this should be the correct button... Since the dialogbox and the main window have the exact same html (it just loads a different .html in a frame with the same name as the main frame in the main window) I figured I could use almost the same code (but with the addition of Local $oIEpopup = _IEAttach($ats_popup, "dialogbox")). Does _IEGetObjByName behave differently inside a dialogbox perhaps?
  4. Ok, it's not a cross domain frame (luckily), and using _IEFrameGetObjByName I can use ControlSend to fields and buttons, but now it's throwing popups (dialogwindows) using the exact same jsp and frames. Using _IEAttach("title of window", "dialogbox") I can find the URL (it attaches to the dialogwindow, I checked the url), but using the same method of _IEFrameGetObjByName to get to the frame inside of the dialogbox for sending a ControlSend won't work... Anything special I need to do to use ControlSend to a button on the attached dialogbox with frames? I tried it in the exact same way as getting to the fields and buttons inside the first frame after finding out that the dialogbox is structured the same as the first frame. Is Local $hWnd = _IEPropertyGet($oIE, "hwnd") different for working inside a dialogbox?
  5. Hello all, I've read a lot the couple of last weeks, learned a lot, tried a lot, but now I'm actually stuck... I have a webpage which I try to control and I already figured out that the buttons nee to be clicked using ControlSend (other methods didn't work). The page is a JSP with frames, my code does fill in the first field, but not the second and it keeps throwing the following error: --> IE.au3 T3.0-1 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (GEBRUIKER1) --> IE.au3 T3.0-1 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType --> IE.au3 T3.0-1 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (WACHTWOORD1) --> IE.au3 T3.0-1 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType I started with the login page, and because of the structure of the whole website (actually a ticketing system for tech support) if this works than I can control everything. My code for testing thus far is this (removed proprietary urls, they only work on our intranet): #include <IE.au3> #RequireAdmin Global $oIE = _IECreate("link_to_application") Func ats_idaction($ats_id, $ats_action) Local $oSubmit = _IEGetObjById($oIE, $ats_id) Local $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($oSubmit, "focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $ats_action) EndFunc _IELoadWait($oIE) ats_idaction("GEBRUIKER1", "my_username") ats_idaction("WACHTWOORD1", "my_password") The html for the first (and any) field: <input id="GEBRUIKER1" class="DFGUISLE" type="TEXT" style="position: absolute; left: 400px; top: 176px; width: 78px; height: 22px; text-decoration: none; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" maxlength="8" name="GEBRUIKER1" autocomplete="off"> Tried both IEGetObjById and IEGetObjByName but now I'm just stuck... Any tips or help?
×
×
  • Create New...