Jump to content

Jonah

Members
  • Posts

    10
  • Joined

  • Last visited

Jonah's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Sorry to bump, but... Would it be possible to link me a code example of debugging with IsObj() or _IEErrorHandlerRegister()?
  2. Did you have an IE up and running with that URL loaded? This does work on my XP setup. So if I use IsObj() after my test fails (on my other platform which does not work, of course....) what will that tell me? Does it do more than just tell me it passed or failed? Thanks, sorry for the trouble ...
  3. Would this help for Firefox? Func FF_Create($url = "www.mozilla.com", $firefox_exe = "C:\Program Files\Mozilla Firefox\firefox.exe") Local $pid = Run($firefox_exe) Sleep(2500) Send("^l") Sleep(1000) Send($url) Send("{ENTER}") return $pid EndFunc Func FF_GetText($windowtitle = "Mozilla Firefox", $windowtext = "") Local $count = 0 While (WinActive($windowtitle, $windowtext) = 0 AND $count < 10) WinActivate($windowtitle, $windowtext) $count = $count + 1 WEnd If ($count <> 10) Then Send("^a") Sleep(500) Send("^c") Sleep(1000) $text = ClipGet() return $text Else return 0 EndIf EndFunc Func FF_Close ($windowtitle = "Mozilla Firefox", $windowtext = "") If (WinActivate($windowtitle, $windowtext) = 1 ) Then Send("!{F4}") EndIf EndFunc
  4. I can't even get this to fail on my XP laptop, have yet to try it on my Vista Ultimate machine...how could I use the debugging tools to investigate this further? Here is a debugging script: #include "IE.au3" Debug() Func Debug() Local $page = "http://www.jonahgregory.com/" Sleep(5000) Local $oIE = _IEAttach($page, "URL") If $oIE == 0 Then MsgBox(0,"Result", "The _IEAttach result is: 0, couldn't find it...") Else MsgBox(0,"Result", "The _IEAttach was successful, found the window.") EndIf ;Local $linktext = GetCFGArgument("C:\rats\rats.cfg", "LinkDistLinkText") ;_IELinkClickByText($oIE, $linktext) ;WriteToLog("Functrace", "IEAttach returns " & $oIE & ", @error = " & @error) ;_IEAction( $oIE, "saveas") ; The DOM API for the saveas action will not return control to the script until the save box is gone. Try something else. #cs IEClickSaveAs($oIE) Local $target = GetCFGArgument("C:\rats\rats.cfg", "FileCheckTarget") If $target == 0 Then WriteToLog("error", "Could not get parameter FileCheckTarget from cfg file.") Return 0 EndIf Sleep(1000) _SaveAs("Save Web", $target) _IEQuit($oIE) WriteToLog("info", "RemediateLib::Remediate has succeeded with case " & $ReqtDescription) Return 1 #ce EndFunc
  5. ; Parameter(s): $s_string - [b]String to search for[/b] (for "embedded" or "dialogbox", use Title sub-string or HWND of window) ; $s_mode - Optional: specifies search mode ; Title = (Default) browser title ; URL = url of the current page ; Text = text from the body of the current page ; HTML = html from the body of the current page ; HWND = hwnd of the browser window ; Embedded = title sub-string or hwnd of the window embedding the control ; DialogBox = title sub-string or hwnd of modal/modeless dialogbox "String to search for"... doesn't that imply use a string? The "embedded" or "dialogbox" clause should not apply here, since I am not using those, so that leaves me with "String to search for", and "http://10.86.21.44/" is a string... ??
  6. I thought when using IEAttach in "URL" mode, it was looking for an instance of IE with the URL as listed in the first parameter?
  7. The UDF simply opens a file, looks for a certain string, and returns a string. In this case, it returns the string "http://10.86.21.44/". This string is then input into Local $oIE = _IEAttach($page, "URL") , which is failing. Is there a way to further debug?
  8. Sorry, I added more code than was necessary - that is the next phase of the alogrithm, after the IE is attached, this is a separate routine to click a link. This link, the text of which is pulled via the GetCFG function, is fed to _IELinkClickByText($oIE, $linktext), but I do not assign the result of this function to the var $oIE, so the result of $oIE should still be the 0 from the _IEAttach() call. In other words, the link clicking is failing because of the IEAttach fail - I think. Thanks!
  9. You should be able to change the registry keys and have that work, but check and make sure that no reboot is needed - although I seriously doubt that it will. As always, though, make sure you back up your registry before testing (or even better, perform the testing on a VM). \jonah
  10. Hi, I'm having some difficulty with IEAttach. I did search the forum for like posts, but didn't have any luck. The problem here is that the _IEAttach call fails with an error code "3" for only one of the 5 platforms I run this on. For Windows 2k, XP SP2 (with IE6), XP SP3 (with IE7), Vista Home Premium, _IEAttach succeeds. For my Vista Ulimate machine, IEAttach returns 0 with @error = 3. That error code is not even listed in the IEAttach function description! Can anyone help me to figure out why only this instance is failing, and how I can fix the script operation? Thanks! \jonah Case "LinkDistFileCheckMandatoryManual" ClickDownload() Local $page = GetCFGArgument("C:\rats\rats.cfg", "LinkDistPageURL") If $page == 0 Then WriteToLog("error", "Could not get parameter LinkDistPageURL from cfg file.") Return 0 EndIf Sleep(5000) Local $oIE = _IEAttach($page, "URL") Local $linktext = GetCFGArgument("C:\rats\rats.cfg", "LinkDistLinkText") If $linktext == 0 Then WriteToLog("error", "Could not get parameter LinkDistLinkText from cfg file.") Return 0 EndIf _IELinkClickByText($oIE, $linktext) WriteToLog("Functrace", "IEAttach returns " & $oIE & ", @error = " & @error) ;_IEAction( $oIE, "saveas") ; The DOM API for the saveas action will not return control to the script until the save box is gone. Try something else. IEClickSaveAs($oIE) Local $target = GetCFGArgument("C:\rats\rats.cfg", "FileCheckTarget") If $target == 0 Then WriteToLog("error", "Could not get parameter FileCheckTarget from cfg file.") Return 0 EndIf Sleep(1000) _SaveAs("Save Web", $target) _IEQuit($oIE) WriteToLog("info", "RemediateLib::Remediate has succeeded with case " & $ReqtDescription) Return 1
×
×
  • Create New...