Jump to content

Search the Community

Showing results for tags 'IE.au3'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • Forum
  • AutoIt


  • Community Calendar

Found 53 results

  1. Hello Experts, I am working on modifying table data of a browser currently in IE (soon in FF) My sequence of operations: 1. Activate Browser 2. Get Browser table 3. Modify data in table 4. Suppress any warning/error message from webpage 5. Activate the Webpage again 6. Send {F11} key sequence twice to achieve some update without Updating form ( {F5}) My problem is at Step 5, as it activates the wrong window ( last used application rather than my browser window) My code snippet for it as follows $bFoundWindow = False Local $aList = WinList("[REGEXPTITLE:(?i)(.*Internet Explorer.*)]") Local $hWND = 0 For $i = 1 To $aList[0][0] If False = $bFoundWindow And $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 1) Then WinActivate($aList[$i][1]) ; 1. Activate Browser window WinSetState ( $aList[$i][1], "", @SW_MAXIMIZE) $hWND = $aList[$i][1] $objEditIE = _IEAttach ($aList[$i][1], "hwnd") $oTitles = _IETagNameGetCollection($objEditIE, "TITLE") For $oTitle In $oTitles $sTitle = $oTitle.innerText If $sTitle = $searchString Then MsgBox(0,"APPLICATION Found", "Got Edit List Window", 1) $bFoundWindow = True ExitLoop EndIf Next EndIf Next If False = $bFoundWindow Then MsgBox(0,"Error","Please launch Edit window for updating values in Browser prior to script execution",10) Exit EndIf ; MY CODE HERE TO MODIFY TABLE ; 2. Get Browser table ; 3. Modify data  in table ; Check if message from webpage pop-up window exists if so click ok on it Local $nCounter = 0 Local $nMaxCounter = 5 while 1 If WinExists("Message from webpage","") Then ControlClick("Message from webpage","","Button1","primary",1) ;4. Suppress any warning/error message from webpage Else $nCounter = $nCounter + 1 Sleep(100) ;MsgBox(0,"Counter", $nCounter, 1) If $nCounter = $nMaxCounter Then ExitLoop EndIf WEnd ;5. Activate the Webpage again  WinActivate($hWND) ; have already tried WinActivate($aList[$i][1]) but no success ;6. Send {F11} key sequence twice to achieve some update without Updating form ( {F5}) Send("{F11}") WinActivate($hWND) ;WinActivate($aList[$i][1]) Sleep(100) Send("{F11}") Any support will be highly appreciated
  2. Hello Experts, I am working on custom application details of which I am unable to share. But here is statement of my problem, I have two IE windows one window with Title "Parent " and other with "TableEdit", but for some reason when I get WinList they are shown as 2 processes each. ( see attached image) Since my most important motive is to modify table data in 'TableEdit' I try to access the table in it My code snippet is *********************************************************************************************** $searchString = "TableEdit" Local $aList = WinList("[REGEXPTITLE:(?i)(.*Internet Explorer.*)]") _ArrayDisplay($aList) For $i = 1 To $aList[0][0] If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then ;MsgBox($MB_SYSTEMMODAL, "", "Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1]) If 0 <> StringInStr($aList[$i][0],"TableEdit") Then $objEditIE = _IEAttach ($aList[$i][1]) ExitLoop EndIf EndIf Next WinActivate($objEditIE) $oPageContentListFrame = _IEFrameGetObjByName($objEditIE, "iframe_1") $iNumFrames = @extended MsgBox(0,"Got pagecontent",@error) ; returns 3, indicating invalid data type MsgBox(0,"Number of Frame",$iNumFrames) ; returns 1, expected value is 1 *********************************************************************************************** and If I do code as below the return value is different $searchString = "TableEdit" $objEditIE = _IEAttach ($searchString, "title") WinActivate($objEditIE) $oPageContentListFrame = _IEFrameGetObjByName($objEditIE, "iframe_1") $iNumFrames = @extended MsgBox(0,"Got pagecontent",@error) ; returns 0 MsgBox(0,"Number of Frame",$iNumFrames) ; returns 0. expected value is 1 *********************************************************************************************** What is wrong with my code? Why do I see two process each for IE for each window? WinListImage.bmp
  3. I have a problem trying to use _IEAttach to recover control after a Windows Explorer reset (e.g. on Windows 7), since all the InternetExplorer.Application objects appear to be destroyed by this event. An example of this is when a PC has some kind of fault causing a pop-up error message "Windows Explorer has stopped working". I can simulate this event by using Windows Task Manager to end the Explorer.exe process then to file, new task (run...) Explorer.exe After this event, _IEAttach gives an @error of: 7 ($_IEStatus_NoMatch) - No Match However, using WinList() followed by WinGetText() I can recover the URL for an IE session that has lost its InternetExplorer.Application object which could be used to _IECreate a new session (the $iTryAttach fails) and WinKill() the original session but the result is a if a refresh had been done (any form entries are lost) . Unfortunately form entries do not appear as text or hidden text to Windows so I'm looking for the best way to read the contents of an Internet Explorer screen (even if just text without structure). When there is no InternetExplorer.Application object (because of some Windows fault) but still with an Internet Explorer session running, I tried to read its contents by a "Select All" & "Copy to Clipboard" but its form entries are blanked and combo boxes choices are all displayed with no way of finding out which ones were selected. Local $ClipBoardSave = _ClipBoard_GetData() ;not ClipGet() which is text only ClipPut("") ;Clear User's Clipboard Local $sText = "" Local $hWnd = WinActivate("Window Title", "") If IsHWnd($hWnd) Then Local $bStatusCtrlSend = ControlSend("Window Title", "", "", "^a^c") If $bStatusCtrlSend Then Local $bStatusCtrlClick = ControlClick("Window Title", "", "") If $bStatusCtrlClick Then $sText = ClipGet() _ClipBoard_SetData($ClipBoardSave) ;not ClipPut($ClipBoardSave) which is text only Is there a solution to this please?
  4. I'm having a problem with _IEBodyReadText() which is a function from the IE.au3 UDF include. My problem is that randomly it will crash my script with: Return SetError($_IESTATUS_Success, 0, $oObject.document.body.innerText) Return SetError($_IESTATUS_Success, 0, $oObject.document.body^ ERROR I don't know why the error isn't caught by __IEErrorHandlerRegister but looking at this function, I can see that there is a check done by IsObj($oObject) to ensure that the object "$oObject" exists but no check that it contains the property "innerText" ; #FUNCTION# ==================================================================================================================== ; Author ........: Dale Hohm ; =============================================================================================================================== Func _IEBodyReadText(ByRef $oObject) If Not IsObj($oObject) Then __IEConsoleWriteError("Error", "_IEBodyReadText", "$_IESTATUS_InvalidDataType") Return SetError($_IESTATUS_InvalidDataType, 1, 0) EndIf If Not __IEIsObjType($oObject, "browserdom") Then __IEConsoleWriteError("Error", "_IEBodyReadText", "$_IESTATUS_InvalidObjectType", "Expected document element") Return SetError($_IESTATUS_InvalidObjectType, 1, 0) EndIf ; Return SetError($_IESTATUS_Success, 0, $oObject.document.body.innerText) EndFunc ;==>_IEBodyReadText I'm struggling to find out how to test if "$oObject.document.body.innerText" exists before allowing the following Return statement to reference it with the assumption that it does exist (crashing my script when it doesn't). Any ideas please?
  5. Hello guys, I am trying to create autoit codes in order to determine if IE button was clicked or pressed. I am not sure if it is possible for IE button. Here is my initial code. #include <IE.au3> #include <MsgBoxConstantsau #include <WinAPI.au3> AutoIt $searchTab = "Untitled 1 - Internet Explorer" WinActivate("Untitled 1 - Internet Explorer") Local $oIE = _IEAttach("", "instance", 1) For $i = 0 To 100 Send("^" & $i) Sleep(250) If Not(StringInStr(WinGetTitle("[ACTIVATE]", $searchTab) = 0) Then While 1 If $oGetItem = 1 Then MsgBox($MB_SYSTEMMODAL, "Attention!", "It's working!") EndIf WEnd ExitLoop EndIf Next
  6. Hello, I am currently trying to automatically click the "Yes" button in the ActiveX prompt/popup message after opening the IE (html). At 1st, I encounter the "Allow Blocked Content". I already resolve it just by changing settings in the IE Options. But after resolving the "Allow Blocked Content", there's a popup message appear. I have attached the ActiveX Prompt. Here is the 1st code that I try to use. #include <IE.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> _IECreate("C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\sampleAWD10.html",0,1,0) Local $oIE = _IEAttach("", "instance", 1) _IELoadWait($oIE) AdlibRegister("_ActiveXRun",250) Local $oLastName = _IEGetObjByName($oIE, "Text4") Local $oGetItem = _IEGetObjByName($oIE, "getitem") _IEAction($oGetItem, "click") MsgBox($MB_SYSTEMMODAL, "Form Element Value", _IEFormElementGetValue($oGetItem)) Func _ActiveXRun() $retWin = WinGetHandle("[Class:Button]","") $winTitle = "[HANDLE:" & $retWin &"]" $ctrlHandle = ControlGetHandle($winTitle,"", "[CLASS:Button; INSTANCE:2]") $ctrlTitle = "HANDLE:" & $ctrlHandle &"]" WinWaitActive($ctrlTitle,"[CLASS:Button; INSTANCE:2]",10) $k = ControlGetPos($winTitle, "","[CLASS:Button; INSTANCE:2]") $x = $k[0] $y = $k[1] WinActivate ($winTitle,"An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?") ControlFocus($winTitle,"An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?","[CLASS:Button; INSTANCE:2]") ControlClick($winTitle, "","[CLASS:Button; INSTANCE:2]","primary",1,$x,$y) ControlSend($winTitle, "", "[CLASS:Button; INSTANCE:2]", "{ENTER}", 0) EndFunc Here is the console output. >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3" /UserParams +>12:44:11 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v. Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\april\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\april\AppData\Local\AutoIt v3\SciTE >Running AU3Check ( from:C:\Program Files (x86)\AutoIt3 input:C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3 +>12:44:11 AU3Check ended.rc:0 >Running:(\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.1.au3" (31) : ==> Subscript used on non-accessible variable.: $x = $k[0] $x = $k^ ERROR ->12:44:24 AutoIt3.exe ended.rc:1 +>12:44:24 AutoIt3Wrapper Finished. >Exit code: 1 Time: 13.76 I also tried a simpler code. include <IE.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> _IECreate("C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\sampleAWD10.html",0,1,0) Local $oIE = _IEAttach("", "instance", 1) _IELoadWait($oIE) $k = ControlGetPos("[CLASS:#32770]", "","[CLASS:Button; INSTANCE:2]") $x = $k[0] $y = $k[1] ControlClick("[CLASS:#32770]", "","[CLASS:Button; INSTANCE:2]","primary",1,$x,$y) Local $oLastName = _IEGetObjByName($oIE, "Text4") Local $oGetItem = _IEGetObjByName($oIE, "getitem") _IEAction($oGetItem, "click") MsgBox($MB_SYSTEMMODAL, "Form Element Value", _IEFormElementGetValue($oGetItem)) There's no error in the console output for the 2nd code I have tried. And here is the Window Info for the ActiveX prompt. >>>> Window <<<< Title: Internet Explorer Class: #32770 Position: 580, 338 Size: 376, 146 Style: 0x94C808C4 ExStyle: 0x00010101 Handle: 0x00000000001516FA >>>> Control <<<< Class: Button Instance: 2 ClassnameNN: Button2 Name: Advanced (Class): [CLASS:Button; INSTANCE:2] ID: 1 Text: &Yes Position: 184, 77 Size: 80, 22 ControlClick Coords: 37, 12 Style: 0x50010000 ExStyle: 0x00000004 Handle: 0x00000000001215DE >>>> Mouse <<<< Position: 228, 120 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< &No An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction? &Yes >>>> Hidden Text <<<<
  7. Hello guys, I am new here in our forum. I do have a little knowledge about AutoIt. I hope you could assist me. I am currently working on a project. I want to try to create an automated time tracking tool. This is how I want to function our time tracking tool. Start time when the IE "get" button is clicked. End time when either "Next Step", "Save" or "Cancel" button is clicked. All the values in the available fields will be stored in an Excel I already have codes for the time tracking part, unfortunately, I cannot proceed since I am encountering an error for detecting the buttons in IE. Here is my initial code for detecting the IE button. #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\sampleAWD10.html") Local $oLastName = _IEFormElementGetObjByName($oIE, "Text4") Local $oGetItem = _IEFormElementGetObjByName($oIE, "getitem") _IELoadWait($oIE) _IEAction($oGetItem, "click") MsgBox($MB_SYSTEMMODAL, "Form Element Value", _IEFormElementGetValue($oGetItem)) Here is the console output. >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.au3" /UserParams +>23:22:20 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v. Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\april\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\april\AppData\Local\AutoIt v3\SciTE >Running AU3Check ( from:C:\Program Files (x86)\AutoIt3 input:C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.au3 +>23:22:20 AU3Check ended.rc:0 >Running:(\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\AWD10.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147417848, Browser has been deleted prior to operation.) --> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType --> IE.au3 T3.0-2 Error from function _IEFormElementGetValue, $_IESTATUS_InvalidDataType +>23:22:23 AutoIt3.exe ended.rc:0 +>23:22:23 AutoIt3Wrapper Finished. >Exit code: 0 Time: 3.105 Here are the errors. --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147417848, Browser has been deleted prior to operation.) --> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-2 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType --> IE.au3 T3.0-2 Error from function _IEFormElementGetValue, $_IESTATUS_InvalidDataType And here is my HTML code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Language" content="en-us" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled 1</title> <style type="text/css"> .style1 { text-align: left; } .style3 { font-family: Arial; font-size: 9pt; color: #CC00FF; margin: 0; padding: 0; } .style4 { font-family: Arial; } .style5 { font-size: 9pt; } .style6 { color: #CC00FF; } .style7 { background-color: #FF9999; } .style8 { font-family: Arial; font-size: 7pt; color: #CC00FF; } .style9 { font-size: 7pt; } .style10 { border: 2px solid #CC00FF; } .style11 { text-align: center; } .style12 { border: 1px solid #CC00FF; } .style13{ clear: both; width: 525px; height: 45px; background: url(file:///C:/Users/april/Documents/JRB/AutoIt/AutoBOT/AWD10/lockedby.png) no-repeat; margin: 0; padding: 0; list-style: none; } .style14{ float: right; margin: 0px 0px 0 0; width: 290px; height: 25px; } .style15{ float: left; margin: 0px 0px 0 0; width: 290px; height: 25px; } .style16 { font-family: Arial; font-size: 2.5pt; color: #CC00FF; margin: 0; padding: 0; } .style17 { font-family: Arial; font-size: 7pt; color: #CC00FF; margin: 0; padding: 0; } .style18 { border-color: transparent; border: none; background-color:transparent; font-family: Arial; font-size: 8pt; } </style> </head> <body> <input type="button" name="getitem" value="get" onclick=" document.getElementById('filename').value = 'Life - ' + Random() + ' INVESTTAUTH - Process - Updateable - Assigned To: Jejeje - Create Date/Time: 2017-05-26- - POL: 046054173 - TYPE: POLICY - SLA: 06/05/2017 ADMIN SYS: VP -PLC: 14' document.getElementById('businessarea').value = 'BusinessArea' + Random() document.getElementById('worktype').value = 'Worktype' + Random() "/><br/> <table style="width: 25%" align="center" class="style10"> <tr> <td style="width: 525px"> <img src="C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\openitems.png" width="525px" height="28" /><br /> <div class="style13" style="height: 28px; width: 514px;"> <div class="style14" style="height: 11px; width: 110px;"> <label id="username"><span class="style16">&nbsp;</span><span class="style3"><br /> </span><span class="style17"> <script type="text/javascript"> var WinNetwork = new ActiveXObject("WScript.Network"); document.write(WinNetwork.UserName); </script> </span> </label> </div> <div class="style14" style="height: 11px; width: 52px;"> <label id="Label4"><span class="style16">&nbsp;</span><span class="style3"><br /> </span><span class="style17">Locked by </span> </label> </div> <div class="style15" style="height: 11px; width: 351px;"> <form method="post" id="openfile" class="style15" style="width: 341px"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="file" id="filename" class="style18" type="text" style="width: 200px; height: 10px" /></div> </form> </div> <label id="Label3"><span class="style3"><br/> &nbsp; </span><span class="style8"><strong>&nbsp;LTC Claims Indexing Form</strong></span><span class="style3"><br /> <br/> </span></label> <form method="post" id="formawddata" style="width: 495px"> <fieldset name="Group1" style="width: 495px" class="style12"> <legend class="style8"><strong>AWD Data</strong></legend> <table style="width: 100%"> <tr> <td style="width: 86px" class="style3">&nbsp;&nbsp;&nbsp;&nbsp; <span class="style9">Business Area:</span></td> <td style="width: 144px" class="style8"><input name="Text4" id="businessarea" class="style18" type="text" /></td> <td style="width: 45px" class="style8">Worktype:</td> <td class="style8"><input name="Text5" id="worktype" class="style18" type="text" /></td> </tr> </table> </fieldset><br /> </form> <form method="post" id="doc" style="width: 495px"> <fieldset name="Group1" style="width: 495px; height : 55px;" class="style12"> <legend class="style8"><strong>Document Data</strong></legend> &nbsp;&nbsp;&nbsp; <span class="style8">Document Type</span><br /> &nbsp;&nbsp;&nbsp; <span class="style4"><span class="style9"> <select name="Select1" id="documenttype" style="width: 363px"> <option></option> <option value="Doc1">Doc1</option> <option value="Doc2">Doc2</option> <option value="Doc3">Doc3</option> <option value="Doc4">Doc4</option> <option value="Doc5">Doc5</option> <option value="Doc6">Doc6</option> <option value="Doc7">Doc7</option> <option value="Doc8">Doc8</option> <option value="Doc9">Doc9</option> <option value="Doc10">Doc10</option> <option value="Doc11">Doc11</option> <option value="Doc12">Doc12</option> <option value="Doc13">Doc13</option> <option value="Doc14">Doc14</option> <option value="Doc15">Doc15</option> <option value="Doc16">Doc16</option> <option value="Doc17">Doc17</option> <option value="Doc18">Doc18</option> <option value="Doc19">Doc19</option> <option value="Doc20">Doc20</option> </select></span></span></fieldset><br /> </form> <form method="post" id="myForm"style="width: 495px; height: 103px;"> <fieldset name="Group1" style="width: 495px; height: 95px;" class="style12"> <legend class="style8"><strong>Policy Data</strong></legend> &nbsp;&nbsp;&nbsp; <span class="style8">Claim Number&nbsp;</span><span class="style3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="style8">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Policy Number/LTC ID</span><br /> &nbsp;&nbsp;&nbsp; <input name="Text1" id="claimnumber" type="text" style="width: 153px" class="style7" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="Text2" id="policynumber"type="text" style="width: 152px" class="style7" /><br /> &nbsp;&nbsp;&nbsp; <span class="style8">Company Code</span><br /> &nbsp;&nbsp;&nbsp; <span class="style7"> <span class="style4"><span class="style9"> <select name="Select2" id="companycode" style="width: 157px"> <option></option> <option value="CC00001">CC00001</option> <option value="CC00002">CC00002</option> <option value="CC00003">CC00003</option> <option value="CC00004">CC00004</option> <option value="CC00005">CC00005</option> <option value="CC00006">CC00006</option> <option value="CC00007">CC00007</option> <option value="CC00008">CC00008</option> <option value="CC00009">CC00009</option> <option value="CC000010">CC000011</option> <option value="CC000011">CC000011</option> <option value="CC000012">CC000012</option> <option value="CC000013">CC000013</option> <option value="CC000014">CC000014</option> <option value="CC000015">CC000015</option> <option value="CC000016">CC000016</option> <option value="CC000017">CC000017</option> <option value="CC000018">CC000018</option> <option value="CC000019">CC000019</option> <option value="CC000020">Doc20</option> </select></span></span></span></fieldset></form><table style="width: 95%; height: 114px;"> <tr> <td style="height: 23px; width: 212px;" class="style1"> <form method="post" style="width: 173px" > <fieldset name="Group1" style="width: 175px; height: 64px;" class="style12"> <legend class="style8"><strong>Routing</strong></legend> &nbsp;&nbsp;&nbsp; <span class="style4"><span class="style6"> <span class="style5"><span class="style9"> <input name="Radio1" type="radio" checked="checked" value="1" /></span></span><span class="style9">Indexed<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="style5"><span class="style9"> <input name="Radio1" type="radio" value="2" /> Reroute</span></span></span></span></fieldset></form></td> <td style="height: 23px"> <span class="style8">AWD Comments</span> <form method="post" id="awdcomments" style="width: 278px; height: 47px"> <textarea name="TextArea1" style="width: 273px; height: 59px" cols="20" class="style7"></textarea></form><br /> </td> </tr> </table> <br /> <div class="style11"> <input name="button1" type="button" onclick="myFunction()" value="Next Step"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <input name="button2" type="button" onclick="myFunction()" value="Save" style="width: 91px"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name="button3" type="button" onclick="myFunction()" value="Cancel" style="width: 94px"/> <script> function myFunction() { document.getElementById("doc").reset(); document.getElementById("myForm").reset(); document.getElementById("awdcomments").reset(); document.getElementById("formawddata").reset(); document.getElementById("openfile").reset(); document.getElementById("businessarea").reset(); document.getElementById("worktype").reset(); document.getElementById("documenttype").reset(); document.getElementById("policynumber").reset(); document.getElementById("companycode").reset(); document.getElementById("claimnumber").reset(); document.getElementById("Label4").reset(); } </script> <script type="text/javascript"> function Random() { return Math.floor(Math.random() * 10000000); } </script> <br /> <br /> </div> </td> </tr> </table> <p> &nbsp;</p> &nbsp; </body> </html> I hope you could assist me. Thank you in advance!
  8. Hello all, Here's a cleaned up version of my code: #include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <String.au3> ;#include <ErrorHandler.au3> ; Open Greatsite.com Global $oIE = _IECreate ("http://www.greatsite.com") ; I'm logged in and on the forum page. Now to navigate categories with unknown names. ; Grab all links on page, then only dive into the ones with the text "forum_id=" ; as in ?bview=forum&forum_id=108343 Global $oLinksCategoryPage = _IELinkGetCollection($oIE) Local $iNumLinks = @extended ;Now at the thread level. Navigate into each thread and look at timestamp Global $oLinksOfThreads = _IELinkGetCollection($oIE) For $oLinkThread In $oLinksOfThreads If StringInStr($oLinkThread.href,"thread_id") Then _IENavigate($oIE, $oLinkThread.href) ;Need to find instance of Posted and read text after the href. Local $sBodyText = _IEBodyReadText($oIE) ;Find first instance of the word "Posted" and check the two words to the right of it. Local $aArrayOfBodyText = _StringExplode($sBodyText," ",0) ;_ArrayDisplay($aArrayOfBodyText, "The body text in Array form") ;Local $iIndexOfPosted = _ArraySearch($aArrayOfBodyText,"days") For $iIndex = 0 to ubound($aArrayOfBodyText) - 1 If StringInStr(StringLower($aArrayOfBodyText[$iIndex]), "posted") Then ;The word Posted has been found. Look for "Just A moment ago", "minutes", and "minute" Select Case StringLower($aArrayOfBodyText[$iIndex +1]) = "just" ;"Just a moment ago. Grab this one. Case Stringlower($aArrayOfBodyText[$iIndex +2]) = "minute" ;"1 minute". Grab this one Case Stringlower($aArrayOfBodyText[$iIndex +2]) = "minutes" ;"x minutes. Grab this one EndSelect ;ExitLoop ;Found the first one. I'm done. EndIf ;Need to back out to Threads in Category Next _IEAction($oIE,"back") EndIf Next ;Back out to Category List _IEAction($oIE,"back") EndIf Next _IEQuit($oIE) The script works fine until I hit the Next to go back to the For $oLinkThread In $oLinksOfThreads. Any line that I put after that crashes with an error. It's like the For loop is going one too many iterations and there is no object in the variable. The requested action with this object has failed.: If StringInStr($oLinkThread.href,"thread_id") Then If StringInStr($oLinkThread^ ERROR Thanks, -John
  9. Hi All, Below is an example of my code that will reproduce an issue I am having, all be it an issue that sometimes occurs and sometimes does not. #include <WinAPI.au3> #include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Call ("Project") Func Project() Local $WaitTime = 10000 ; Set the time between checks in miliseconds While 1 $hwnd = WinGetHandle("[active]") If Not @error Then ; Ensure 'WinGetHandle' worked. Local $WinClassName = _WinAPI_GetClassName($hwnd) If $WinClassName = "IEFrame" Then ; If the curent window is an IE exploere instance then... Local $Object = _IEAttach($hwnd, "embedded") If not @error Then Local $url = _IEPropertyGet($Object, 'locationurl') If not @error Then Local $Split = StringSplit($url, "/") If $Split[0] > 2 Then ; This stops an error if the array did not have enought rows e.g no url to display form row 3. If Not $Split[3] = "" Then ; Dont bother if no url e.g blank msgbox(0, "URL is:", $Split) EndIf EndIf EndIf EndIf EndIf EndIf Sleep($WaitTime) WEnd EndFunc The issue is from IE.au3 and the error message is attached. I am able to reproduce it is I run the scrip, load an instance of IE, then navigate to a different page such as google or something. I have looked in the code for IE.au3 and it reference to a function “__IEControlGetObjFromHWND(ByRef $hWin)” however I am not using this function so am a little unsure why or how this error is being called or what I can do to stop it? Any advice / help would be gratefully appreciated. Thank you.
  10. Hi All, I am very new to AutoIt and scripting in general and have a question about IEFormGetObjByName. The help function says: _IEFormGetObjByName ( ByRef $oObject, $sName [, $iIndex = 0] ) But how do I find what to enter for $sName? In the example below, it says that it can be found by viewing the HTML source. So I went to the google home page, clicked Ctrl U to view the source, and cant figure out how they determined that the $sName is 'gbqf'. Can someone explain this process to me? Thanks in advance! ; Get a reference to a specific form by name. In this case, submit a query ; to the Google search engine. Note that the names of the form and form ; elements can be found by viewing the page HTML source #include <IE.au3> Local $oIE = _IECreate("http://www.google.com") Local $oForm = _IEFormGetObjByName($oIE, "gbqf") Local $oQuery = _IEFormElementGetObjByName($oForm, "q") _IEFormElementSetValue($oQuery, "AutoIt IE.au3") _IEFormSubmit($oForm)
  11. Hello I'm trying to translate few text using below code, I found it working previously couple of months ago but Now these days it's not working at all and I'm getting below errors when I run the script and Array display at the end of text also not able to show any translated text instead of value 0 & 1; --> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (gt-res-data) --> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType Here is code, #include <IE.au3> #include <Array.au3> Local $tag="* # * # *" Local $oIE=_IECreate("https://translate.google.com/#auto/es") Local $oForm=_IEFormGetCollection($oIE,0) Local $oQuery=_IEGetObjByName($oForm,"text") _IEFormElementSetValue($oQuery, $tag & @CR & "Hello World" & @CR & "This is a test" & @CR & $tag) _IEFormSubmit($oForm) _IELoadWait($oIE) Local $oText=_IEGetObjById($oIE,"gt-res-data") $lines=StringSplit(_IEPropertyGet($oText,"innerText"),@CRLF,1) _IEQuit($oIE) _ArrayDelete($lines,_ArraySearch($lines,$tag,1,0,0,1,0) & "-" & $lines[0]) _ArrayDelete($lines,"1-" & _ArraySearch($lines,$tag,1,0,0,1,1)) $lines[0]=UBound($lines)-1 _ArrayDisplay($lines)
  12. Hey, i hope someone can point me in the right direction, i have a page with tables, inside i have TD,TR,INPUT tags, the input tags is buttons and i need to click on one of theese buttons but they have the same value and type so the only way that i am going to know that it's the correct button is to find out the name of the innerhtml of the TD before (the parent node) because the input comes after, like this <TABLE> <TR> <TD> Name of the td </TD> <TR> <TD colSpan=3<INPUT> value=my button type=button</INPUT></TD> <TR> <TD> Other name of a td </TD> <TR> <TD colSpan=3<INPUT> value=my button type=button</INPUT></TD> <TR> I know how to find all td's and inputs but not (in a loop) look for the td's and once it has found it click on the corresponding or "closest" input, maybe a nested loop? I made a for loop using _IETagnameGetCollection($ie,"TD") and after it found the TD i tried looking for nextSibling but that might be impossible with INPUT perhaps?
  13. Hello, Let's take a simple example to illustrate my case. I open a webpage with the command _IECreate and I parse all its elements : #include <IE.au3> $oIE = _IECreate("http://www.york.ac.uk/teaching/cws/wws/webpage1.html") $oElements = _IETagNameAllGetCollection($oIE) For $oElement In $oElements ConsoleWrite("Tagname: " & $oElement.tagname & @CRLF & "Id: " & $oElement.id & @CRLF & "InnerText: " & $oElement.innerText & @CRLF & "--------------------------------" & @CRLF) Next Now let's imagine I simulate a click with MouseClick to the link "lesson two" at the bottom of this webpage. A new webpage will open : http://www.york.ac.uk/teaching/cws/wws/webpage2.html I'd like to get the elements (tagname, id, innertext) of this new webpage, just like I got them for the first webpage. But for this, I presume I would have to get a new $oIE2 Object variable of an InternetExplorer.Application, in order to be able to use the _IETagNameAllGetCollection once again. How am I supposed to do this ? Thank you !
  14. Hi, I'm using the IE.au3 library to parse elements in a webpage and get their (x,y) coordinates. Main commands I'm using are : $oIE = _IECreate($myWebPage) $oElements = _IETagNameGetCollection($oIE, "label") $windowleft = $oIE.document.parentwindow.screenLeft $windowtop = $oIE.document.parentwindow.screenTop $oElementPosX = $windowleft + _IEfindPosX($oElement) $oElementPosY = $windowtop + _IEfindPosY($oElement) Now things become a bit tricky when i simulate a scroll in my webpage : $oIE.document.parentwindow.scroll(0, $myScrollY) Because once this is done, the coordinates of the elements are still what they were before the scroll. I can manage this problem by keeping track of the number of pixels I have scrolled, and compute the new "real" ($oElementPosX, $oElementPosY). But I'm pretty sure there's a more efficient / more elegant way to do it. What's more in some situations, when I click some controls in the webpage, the webpage adds new elements and shifts the controls below by a random number of pixel, so my workaround can't be used... So here's my question : Is there a way to "refresh" the calculation of label coordinates ($oElementPosX, $oElementPosY) after a scroll ? Thank you ! EDIT : I forgot to post the _IEfindPosX and _IEfindPosY functions (found somewhere on this forum) : Func _IEfindPosX($o_object) Local $curleft = 0 Local $parent = $o_object If IsObj($parent) Then While IsObj($parent) $curleft += $parent.offsetLeft $parent = $parent.offsetParent WEnd Else Local $objx = $o_object.x If IsObj($objx) Then $curleft += $objx EndIf Return $curleft EndFunc Func _IEfindPosY($o_object) Local $curtop = 0 Local $parent = $o_object If IsObj($parent) Then While IsObj($parent) $curtop += $parent.offsetTop $parent = $parent.offsetParent WEnd Else Local $objy = $o_object.y If IsObj($objy) Then $curtop += $objy EndIf Return $curtop EndFunc
  15. Hello guys, i'm a rookie trying to create a script that logs me in to steam forums. After that it has to refresh every x seconds. But there is a problem, whenever i run the script it says variable not declared. Can somebody please help me out? #include <ie.au3> #include <MsgBoxConstants.au3> Call ("internetexist") Func internetexist() If WinExists("Steam Community - Internet Explorer") Or WinExists("Rocket League Ruilen :: Steam Community - Internet Explorer") Then MsgBox($MB_SYSTEMMODAL, "IE", "Found it.") Call("Logn") Else Global $oIE = _IECreate("https://steamcommunity.com/login/home/?goto=app%2F252950%2Ftradingforum%2F"); i declared $oIE here, but... Call("Logn") EndIf EndFunc Func Logn() ;Global $oIE = _IECreate("https://steamcommunity.com/login/home/?goto=app%2F252950%2Ftradingforum%2F");if i remove this line it gives "Variable used without being declared." why?? Global $oIEA = _IEAttach("", "instance", 1) Global $user = _IEGetObjByName ($oIE, "username") Global $pass = _IEGetObjByName ($oIE, "password") _IEFormElementSetValue ($user, "test") _IEFormElementSetValue ($pass, "****") Global $oSubmit = _IEGetObjById($oIE, "SteamLogin") Global $clicklogin = _IEAction($oSubmit, "Click") Sleep(2000) EndFunc While 1 Sleep(10000) ConsoleWrite("Refreshing") _IEAction($oIE, "refresh") WEnd "C:\Users\X\Desktop\autoit\trading rl BIJNA.au3" (19) : ==> Variable used without being declared.: Global $user = _IEGetObjByName ($oIE, "username") Global $user = _IEGetObjByName (^ ERROR
  16. Hi I'm having some trouble with my script that scrapes out the content of iframes from pages using IE. On certain pages the script always fails , my fist thought was it was a timing issue so i tried adding Sleep(5000) in a few places and that doesn't appear to make any difference and it seems to always be the same pages so im not thinking its about timing. The error in the console reads "C:\Program Files (x86)\AutoIt3\Include\IE.au3" (2308) : ==> The requested action with this object has failed.: $oTemp = $oObject.document.body $oTemp = $oObject^ ERROR My code is as follows #include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <File.au3> #include <String.au3> Local $oIE = _IECreate("about:blank") $OriginalURL = "http://urbanikstreetdance-glasgow.co.uk/contact/3762801" _IENavigate($oIE, $OriginalURL) Local $oFrames = _IEFrameGetCollection($oIE) Local $iNumFrames = @extended If $iNumFrames > 0 Then Sleep(1000) Local $oFrame = 0 For $i = 1 To ($iNumFrames - 1) $oFrame = _IEFrameGetCollection($oIE, $i) ConsoleWrite(@error) $frame_html = _IEPropertyGet($oFrame, "innerhtml") & @CRLF If StringLeft($frame_html, 7) = "<iframe" Then ConsoleWrite(@CRLF & $OriginalURL & "|" & _IEPropertyGet($oIE, "locationurl") & $frame_html) EndIf Next EndIf Does anyone have any ideas on either how to stop it from failing or something i can do to identify that it will fail so i can exclude it from being checked. Any help would be greatly appreciated
  17. Hello everyone. I've a quick question. And yes, I am fairly new to AutoIt (in case you were wondering). I'm writing a program that will open a webpage and inject Javascript code into the address bar. _IENavigate($oie, "javascript:var oArray = document.getElementsByClassName('tab_caption'); for(i = 0; i < oArray.length; i++) { if(oArray.innerHTML == 'Information') oArray.click(); };") The line clicks on the tab listed as "Information", then it doesn't continue. Is there a way I can make AutoIt run this command for a specified amount of time, then move on to the next line of code?
  18. Hi, Version: Autoit v3.3.14.1, IE3 T30-2 released 20140819 Hoping someone can point me in the right direction. I've been struggling over this error the last week and unable to find a solution or work around. Similar issue? Description of issue: I have an AutoIt script that attaches to an IE9 session and parses an iframe containing patient demographics (name, medical record #, etc) that seems to be working for the first few seconds to minutes but eventually errors out with the error below. Always consistently on line 715. When initially run, it will return valid and correct information but it will eventually error out. Initially I thought it was because I was switching from patient to patient (i.e. catching it when there was no data) but when I don't do anything at all (no activity on the IE9 web page), it will still give an error. I have not found any posts about this specific error at line 715. Any guidance to solving this error is grateful. --> COM Error encountered in Patient Demographics on ToolTray.au3 (715) : ----> $IEComErrorNumber            = 0x80020009 (-2147352567) ----> $IEComErrorWinDescription    = Exception occurred. ----> $IEComErrorDescription       = Bad variable type. ----> $IEComErrorSource            =  ----> $IEComErrorHelpFile          = C:\Windows\SysWOW64\mshtml.hlp ----> $IEComErrorHelpContext       = 0 ----> $IEComErrorLastDllError      = 0 ----> $IEComErrorRetcode           = 0x80020008 --> IE.au3 T3.0-2 Error from function _IETableGetCollection, $_IESTATUS_InvalidDataType --> IE.au3 T3.0-2 Error from function _IETableWriteToArray, $_IESTATUS_InvalidDataType --> COM Error encountered in Patient Demographics on ToolTray.au3 (715) : ----> $IEComErrorNumber = 0x80020009 (-2147352567) ----> $IEComErrorWinDescription = Exception occurred. ----> $IEComErrorDescription = Invalid argument. ----> $IEComErrorSource = ----> $IEComErrorHelpFile = C:\Windows\SysWOW64\mshtml.hlp ----> $IEComErrorHelpContext = 0 ----> $IEComErrorLastDllError = 0 ----> $IEComErrorRetcode = 0x80070057 --> IE.au3 T3.0-2 Error from function _IETableGetCollection, $_IESTATUS_InvalidDataType --> IE.au3 T3.0-2 Error from function _IETableWriteToArray, $_IESTATUS_InvalidDataType
  19. i have a simple script that check proxy on ip-score.com(with ie.au3) my code #include <MsgBoxConstants.au3> #include <IE.au3> Local $oIE = _IECreate("http://www.ip-score.com/", 1, 1, 1, 1) Sleep(5000) Local $TimeZone = _IEBodyReadText($oIE) _IEQuit($oIE) problem is that in internet Explorer is a proxy(not automatic/direct connection) ie sometime load the page but sometime not, and i get "The page cannot be displayed" If a make a refresh to page with error its work fine How to resolve this problem without refreshing page each time?
  20. Hello. I'd like to ask some help with IE interaction. Basically, My script opens a webpage, then checks for an expected form named login and passwd: ; Collects info from the opened page $oForms = _IEFormGetCollection($oIE) Local $iNumForms = @extended If $iNumForms = 1 Then $oForm = _IEFormGetCollection($oIE, 0) $oObjs = _IEFormElementGetCollection($oForm) Local $iNumObj = @extended Else ; insert error treatment here Exit EndIf If $iNumObj = 3 Then ; Check if there are 3 objects in the page (login / pass / submit) Sleep(1000) ; Emulating a user typing infos $oObj = _IEFormElementGetObjByName($oForm, "login") _IEFormElementSetValue($oObj, "barackobama") Sleep(1000) ; Emulating the user $oObj = _IEFormElementGetObjByName($oForm, "passwd") _IEFormElementSetValue($oObj, "UncleSam2015") Sleep(1000) ; Emulating the user _IEFormSubmit($oForm) Else ; insert error treatment here Exit EndIfIt goes to a loading screen, it usually takes 2-10 seconds. Then, it goes to a main screen dashboard. The ElementGetObjByName gets this info from the page: <input class="CTXMSAM_ContentFont" type="Password" title="Enter password" name="passwd" size="30" maxlength="127" style="width:100%;">I need to verify if it really logs in (kinda worked around this), and how long it takes to load the main screen (that classic loading spinning ball). I was trying to do it by counting the forms or objects, but it's not possible, since there is no forms on the main screen, and both the loading screen and the main screen has 1 object. The main screen though, has an object already identifier (searchbox), but it also doesn't have a name. The code of the searchbox is as below: <input class="searchbox-textbox lighttext" type="text" autocomplete="off" title="Search"> Is there any way for me to track/identify this page with or without IE.au3? Thanks.
  21. Hi Everyone, due to email system migration, I am trying to automate the email forwarding per account basis on webmail. The action required for each user is: 1. Logging in to webmail for the user 2. Click on the "Options" link 3. On the pop-up box, click on "Mail", then "Forwarding" (Screen shot provided) 4. Followed by keying in the forwarding details. I am stuck on step 3. It appears that the links for "Mail" and "Forwarding" are javascript and not real links. I do not have any programming and development experience and just started with AutoIT 2 weeks back just for this specific task. The source for the page is here, it looks like the part that i should be focusing on is : It seems like the part i should be focusing on is here: options_items.push({ 'id' : 'forward', 'label' : localevar.get('Forwarding'), 'url' : '/cgi-bin/euadmin.cgi/eup/forward.html', 'pName' : 'mail' }); After searching the forum and reading the help file, I have attempted at least the following: 1. _IENavigate - fail as the URL is special for each logged in session 2. _IELinkClickByText - failed as no link is found ( i used _IELinkGetCollection = 0 link found) 3. IETableGetCollection - only found 2 tables and its only for the right hand pane of the page. 4. IEPropertyGet 'innertext' - no errors, but no clicking actions 5. _IETagNameAllGetCollection - Found Tagname: DIV, ID: dijit__TreeNode_10, innertext: * Forwarding but not able to use these information to get autoit to click. 6. _IEImgGetCollection - Found 41 instances of *blank.gif, tried to randomly click an index of gif, but no visible actions being done. My code is here, it is heavily commented out by the past attempts, so it must be hard to read, apologies in advance. The trouble begins at line 82. Any help or advice is greatly appreciated.
  22. #include <IE.au3> #AutoIt3Wrapper_Run_Au3Stripper=y Local $oIE = _IECreate("https://" & "somesite.com", 0, 1, 1)I recently updated to If I build this script I consistently get: -### StripOnly/StripFunc Error: Found ObjEvent() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function. >### current Func: __ieinternalerrorhandlerderegister E:\apps\AutoIt3\include\IE.au3(2570,1) Warning for line:$__g_oIEErrorHandler = ObjEvent("AutoIt.Error", $__g_sIEUserErrorHandler) I reinstalled autoit to make sure that wasn't the issue, but didn't fix the problem. Any ideas?? For now I'll downgrade til a solution is found.
  23. I am attempting to enter the logon ID and password into the form below and submit it. But, I am experiencing an error in IE.au3 whether I use _IEAction to submit a click (which does submit the form) or _IEFormSubmit (which does not submit the form before it errors out). The form seems rather simple: <form method="post" action="logon_submit.php"> <input type="hidden" name="visit" value="sRhvMItOu1hNV_y9t4iB7xhns2UJ0pUIYmpJyy3CivjvGYv0ST1QHY40QP9H5UPTqonadminkin_65dvtXxSIXDPwyFFI6WPVQFmgFtba8vW3OH"> <table width="100%" border="0" cellpadding="0" align="center" cellspacing="0"> <tr> <td valign=top><table width="100%" border="0" cellpadding="4" cellspacing="1"> <tr> <td align="Right"><b>Username: <span class="style1">*</span></b></td> <td width="80%"><input type="TEXT" name="user" style="width: 90%;"> </td> </tr> <tr> <td align="Right"><b>Password: <span class="style1">*</span></b></td> <td><input type="password" name="pass" style="width: 90%;"> </td> </tr> <tr> <td align="Right">&nbsp;</td> <td><input type="submit" name="Submit" value="Submit Form"> </td> </tr> <tr> <td align="Right">&nbsp;</td> <td><a href="resetpw.php?visit=sRhvMItOu1hNV_y9t4iB7xhns2UJ0pUIYmpJyy3CivjvGYv0ST1QHY40QP9H5UPTqonadminkin_65dvtXxSIXDPwyFFI6WPVQFmgFtba8vW3OH" class=white>Forgot your password ?</a></td> </tr> </table> <p>&nbsp;</p> </td> </tr> </table> </form> My function to perform the logon is: Func StartUp() _IELinkClickByText ( $oIE, "Log On" ) Sleep(2000) Local $oForm = _IEFormGetCollection($oIE) Local $iNumberOfForms = @extended For $iForm = 0 To $iNumberOfForms - 1 $oForm = _IEFormGetCollection($oIE, $iForm) Local $oQuery = _IEFormElementGetCollection($oForm) Local $iNumberOfFormElements = @extended For $iElement = 0 to $iNumberOfFormElements - 1 Local $oFormElement = _IEFormElementGetCollection($oForm, $iElement ) If $oFormElement.name = 'user' Then _IEFormElementSetValue ( $oformElement, "xxxxx", 0) elseif $oFormElement.name = "pass" Then _IEFormElementSetValue ( $oFormElement, "yyyyy", 0) ; Sleep for 2 seconds. Sleep(2000) Local $oSubmit = _IEGetObjByName($oIE, "Submit") _IEAction($oSubmit, "click") Sleep(3000) EndIf Next Next EndFunc After the submission of the form completes and goes to the next page I'm getting the following error as a popup from AutoIt: Line 970 (File "D\Program Files (x86)\AutoIt3\Include\IE.au3"): Case $iIndex > -1 And $iIndex < $oObject.elements.length Case $iIndex > -1 And $iIndex < $oObject^ ERROR Error: The requested actions with this object has failed. It's hard to imagine that such a simple form is causing so many problems. Any help would be appreciated.
  24. I sort of get a break from "things I have to do" and can do a bit of "things I want to do" for scripting for a bit One thing that would be infinitely useful that I really need to get under my belt is internet/website automation. I used to use this heavily years ago when working helpdesk before I converted over to AutoIT (was using the "other guys" stuff back then) IE being the easiest to work with I would assume (even though its not a browser I use) I google/search and poke in and out of various threads to learn some of it, but I had to ask do we have like a be all end all thread or resource that really shows how to figure this stuff out? An example would be opening a page and then finding all the links/buttons/forms to interact with. I am currently doing that with a For loop using one of the GetCollection type of functions, but it could be easier to look at the page source or maybe even have a tool like the Autoit Window Info tool that can simply mouse over things but I have not found the information to point to these techniques/tools. Any tips/tricks, links, etc I can get would be a good help to start me in the right direction. Regards,
  25. Hi, I've been tinkering and tinkering and I really hope someone can give me some advice. I've used the IE.au3 UDF successfully with some different scripts, just I'm not even sure I'm going in the right direction on this one. A bunch of text input fields on a secure site are to be updated with data in the script (which the script gets from an excel file), and submitted. Not too hard, right? The input fields html looks like this: (in this case current value is 777.00) <input id="pt1:r1:1:pt1:ghostText:i10:0:lvl2:0:lvl3:0:lvl3PrcHdr:i15:0:lvl3Prc:ot21::content" name="pt1:r1:1:pt1:ghostText:i10:0:lvl2:0:lvl3:0:lvl3PrcHdr:i15:0:lvl3Prc:ot21" class="x25" type="text" value="777.00" title="777.00">I've tried _IEFormElementSetValue($oObj, $sInput, 0) _IEFormElementSetValue($oObj, $sInput, 1) $oObj.setAttribute("value", $sInput) $oObj.setAttribute("title", $sInput) _IEAction($oObj, "focus") $oObj.fireEvent("onfocus")in various combinations and orders, and the trouble is always that some fields are "skipped" or revert back to their previous value a few seconds later. Even though not actually submitting ie. clicking the "Save Changes" button on the page, some kind of processing is already going when anything is changed/focused etc., as far as I can see. What else I have tried: Using ControlSend($g_oIEHandle, "", "[CLASSNN:Internet Explorer_Server8]", $sInput) in combination with a lot of MouseGetCursor() I have a more simple script roughly "working" (doesn't use any IE objects). It works by waiting for a normal mousecursor for the page to be "ready" again in between inputfields... ...and this ends up being very slow and not much faster than human entry, and "only" fails sometimes (which is why there is a checking function as well, though this also adds to the time taken). So what can I do? From some research I've done, I understand there may be some way to cancel events (I know as much as that events have a propery "cancelable"). Maybe we can stop any javascript function from being called while filling all the input fields somehow, so that none of the input gets lost.Could this help? How to do this? One other idea is with POST and GET, so that the data that is usually submitted to the site on "Save Changes" can be sent without interface interaction... would this probably be very difficult to attempt? Where to start? (https...) Please, any thoughts, guidance on the above, or ideas/approaches I haven't thought of?