Jump to content

vcrocca

Active Members
  • Posts

    23
  • Joined

  • Last visited

vcrocca's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I do not see an easy way to do this in the manuals or after searching this forum. I am automating the login to a web site so I can measure the per page load time. This page spawns numerous pages after logging in. These pages are usually frames and subframes. I would like to be able to close all Internet Explorer Windows without having to attach to each window. Any ideas would be appreciated. Thanks
  2. Thanks Dale! I have used IEBuilder and it is a great tool but in this situation when new instances of Internet Explorer were opened as Frames and sub frames IEBuilder does not see the objects in the frame. I found that only DebugBar with it's spy feature would do this. If I missed something on how to use IEBuilder please let me know.
  3. I figured it out at long last. Is there a tutorial somewhere on how to get zero based indexes? Looking in the help file it's not readily apparent how to do this. A quick write up on this with some specific examples will help a lot of newbies IMHO.
  4. I am trying to script a login to a complex web site that has multiple pop up frames. I have gotten through several levels by using IEBuilder and DebugBar but cannot seem to find the link to click on in the web page code below. The link in question below is test company. I used the AutoITcode below from the examples included in the help file to determine that _IELinkGetCollection will find 11 links (Only two included in the web code below for brevity) but I cannot seem to get the link index to return so that I can click the link later in the script. IEBuilder does not work with Frames and Debug Bar does allow me to see the code below using the Spy on other IE Instances function but I do not see how I can get the indexes with these tools. [/code] <FORM name=Form1 method=post><INPUT type=hidden value=2 name=fNum> <INPUT type=hidden value=list name=fMode> <INPUT type=hidden value=0-* name=StateKey> <DIV align=left width="100%"> <CENTER> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TH class=headlbl><IMG id="" src="../images/clients_ico.gif" valign="bottom">&nbsp;My Recent Clients</TH></TR></TBODY></TABLE> <DIV id=mycls> <TABLE cellSpacing=0 cellPadding=2 width="100%" border=0> <TBODY> <TR> <TD noWrap><IMG title="Go to the Client Rolodex" style="TEXT-INDENT: 5%" onclick="LoadPage('NONE')" src="../images/irolodex_bot.gif"> <A title="Go to the Client Rolodex" style="TEXT-INDENT: 5%" onclick="LoadPage('NONE')" href="#top"><I><B>Client Rolodex</B></I></A></TD></TR> <TR> <TD noWrap><A title=TESTCOM style="TEXT-INDENT: 5%" onclick="LoadPage 'key=168191&amp;code=TESTCOM&amp;name=Test+Company&amp;phone=410+675%2D9286+'" href="#top">Test Company</A></TD></TR> <TR> Smalll portion of my test code trying to return the link indexes. I have the DOM object href listed here. It works and returns the frame URL but I need the link index number so I can click it. I have tried several other DOM objects but they return nothing. Any help would be much appreciated. $oInputs = _IELinkGetCollection ($oIE, 0)$iNumFrames = @extendedFor $i = 0 to ($iNumFrames - 1) $oFrame = _IELinkGetCollection ($oIE, $i) MsgBox(0, "Index Info ", $oFrame.href)Next
  5. wow is this such a tough issue that no one has any ideas? Or did I not provide enough information? If anyone has any idea what is wrong I would appreciate some help. If I missed something obvious I apologize.
  6. Been searching help and this forum all day for a solution to this. I am going to a web site and filling in a form. Then using the _IEAction command the form is submitted. This opens a new browser window that has another login form on it. I use _IEAttach to attach to the window and it does so sucessfully but then when I try to collect the forms using _IEFormGetCollection it states there are no forms on the page. If I use IE-Builder and look at the source of this second window by typing in the URL directly I see the form. If I modify the script to open the second Window directly (not being spawned from the first window) it finds the form. So for whatever reason the spawned second window does not report any forms. Any help would be appreciated. Code is below with private information represented by ****** [/code] #AutoIt3Wrapper_Run_Debug_Mode=Y #NoTrayIcon #include <IE.au3> RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\*********.com", "http", "REG_DWORD", "2") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\*********.com", "https", "REG_DWORD", "2") $oIE = _IECreate ("www.**********.com") $oForm = _IEFormGetObjByName ($oIE, "cust_info") $oSubmit = _IEGetObjByName ($oIE, "action") $oQuery = _IEFormElementGetObjByName ($oForm, "cust_nbr") _IEFormElementSetValue ($oQuery, "*****") _IEAction ($oSubmit, "click") _IELoadWait ($oIE) $oIE = _IEAttach ("signon", "WindowTitle") MsgBox(4096,"test", @error) Sleep(3000) $oForms = _IEFormGetCollection ($oIE) $iNumForms = @extended MsgBox(0, "Forms Info", "There are " & $iNumForms & " forms on this page") For $i = 0 to $iNumForms - 1 $oFormi = _IEFormGetCollection ($oIE, $i) MsgBox(0, "Form Info", $oFormi.name) Next [code]
  7. Looking for an easy way to monitor a GUI input field and automatically tab to the next field once the maximum number of characters is reached in that field. I am hoping there is some GUI function that I have not found that does this. Otherwise I will just create the logic using a message loop. Thanks
  8. Thanks everyone! This is what I was afraid of. It's a bit more work but it's a learning experience.
  9. Anyone know if it's possible to change the icon displayed in the top left corner when prompted when using InputBox? I have searched help and this forum and cannot seem to find an answer. Any help is appreciated.
  10. Thank You I understand now. Testing updated script now.
  11. I expected that if the web page did not respond within the 20 seconds specified in IELoadWaitTimout that the script would continue running and not terminate with the following error Warning from function _IELoadWait, $_IEStatus_LoadWaitTimeout If my logic is flawed please let me know but I expected that once the timeout period was exceeded IECreate would stop trying to load the page and continue through the rest of the script without having to use @error. Please advise and thank you!
  12. Sorry about that. I changed it to make the browser window visible and messed up. Here is the code I used for the latest test. [/code] ; ************************************************************************ ; Script will connect to a web site specified in the command line ; Download the html output to a variable and then convert the information ;between the Body Tags to text ; ************************************************************************* $var1 = 0 #AutoIt3Wrapper_run_debug_mode=Y #include <IE.au3>; Internet explrer include #include <file.au3>; File and Directory Operations include #NoTrayIcon; Hide tray icon While $var1 = 0 _IELoadWaitTimeout(20000); Set IE Timeout to load web page within 20 seconds $oIE = _IECreate("www.removed.com", 0, 1, 1); Silently open web page that was provided as command line switch $sText = _IEBodyReadText($oIE); convert web site from HTML to Text _IEQuit($oIE); close IE window $file = FileOpen("c:\temp\ib.txt", 2); Open file to write text to If $file = -1 Then; verify that file opens correctly Exit; exit script if it does not EndIf _FileWriteLog($file, $sText); write text to file specified in command line switch number two FileClose($file); close text file Sleep(120000) WEnd[code] It ran fine for hours but then errored out. Below is what the log showed. 0014: 0-0: _IELoadWaitTimeout(20000); Set IE Timeout to load web page within 20 seconds 0015: 0-0: $oIE = _IECreate("www.removed.com", 0, 1, 1) ; Silently open web page that was provided as command line switch --> IE.au3 V2.3-1 Warning from function _IELoadWait, $_IEStatus_LoadWaitTimeout 0016: 6-0: $sText = _IEBodyReadText($oIE) ; convert web site from HTML to Text C:\Program Files\AutoIt3\Include\IE.au3 (2143) : ==> The requested action with this object has failed.: Return $o_object.document.body.innerText Return $o_object.document^ ERROR ->22:10:26 AutoIT3.exe ended.rc:1 +>22:10:27 AutoIt3Wrapper Finished At the same time the visible browser window displayed the error in the attached screen capture.
  13. Thanks Dale I did as you instructed and was able to reproduce the error. Below is the debug log. !> Starting in DebugMode.. Line: @error-@extended: Line syntax 0006: 0-0: $var1 = 0 0008: 0-0: #AutoIt3Wrapper_run_debug_mode=Y 0010: 0-0: #include <IE.au3> ; Internet explrer include 0011: 0-0: #include <file.au3> ; File and Directory Operations include 0012: 0-0: #NoTrayIcon ; Hide tray icon 0013: 0-0: While $var1 = 0 0014: 0-0: _IELoadWaitTimeout(20000); Set IE Timeout to load web page within 20 seconds 0015: 0-0: $oIE = _IECreate("www.removed.com", 0, 1, 0) ; Silently open web page that was provided as command line switch 0016: 0-0: $sText = _IEBodyReadText($oIE) ; convert web site from HTML to Text C:\Program Files\AutoIt3\Include\IE.au3 (2143) : ==> The requested action with this object has failed.: Return $o_object.document.body.innerText Return $o_object.document^ ERROR ->13:17:31 AutoIT3.exe ended.rc:1 +>13:17:32 AutoIt3Wrapper Finished >Exit code: 1 Time: 1.680 I modified the script a bit to take the cmdline items out. The code used is here [/code] ; ************************************************************************ ; Script will connect to a web site specified in the command line ; Download the html output to a variable and then convert the information ;between the Body Tags to text ; ************************************************************************* $var1 = 0 #AutoIt3Wrapper_run_debug_mode=Y #include <IE.au3>; Internet explrer include #include <file.au3>; File and Directory Operations include #NoTrayIcon; Hide tray icon While $var1 = 0 _IELoadWaitTimeout(20000); Set IE Timeout to load web page within 20 seconds $oIE = _IECreate("www.removed.com", 0, 1, 0); Silently open web page that was provided as command line switch $sText = _IEBodyReadText($oIE); convert web site from HTML to Text _IEQuit($oIE); close IE window $file = FileOpen("c:\temp\ib.txt", 2); Open file to write text to If $file = -1 Then; verify that file opens correctly Exit; exit script if it does not EndIf _FileWriteLog($file, $sText); write text to file specified in command line switch number two FileClose($file); close text file Sleep(120000) WEnd [code] I decided against using the INETGET function because I did not see where I could set a timeout value if the web page did not respond. Thanks again.
×
×
  • Create New...