Jump to content

Capel

Active Members
  • Posts

    56
  • Joined

  • Last visited

Capel's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Ok, JohnOne, I'll try it out.
  2. Z-order is an ordering of overlapping two-dimensional objects, such as windows in a graphical user interface (GUI). In my case, the IE window I need to interact with may not be the currently active window (there could be a windows forms app on top), but I want to interact with the IE browser that is on top of all the other IE browser windows.
  3. How do I get the Z order property of an IE window? I need the one on top.
  4. If I have multiple IE browser windows with similar titles, how do I determine which one is on top? I'm trying to iterate over all the open browser windows, but the code below shows 2 instances of each browser. They have different handles. This is strange... $lstViewers = WinList($sTitle) For $i = 1 to $lstViewers[0][0] ConsoleWrite("Title=" & $lstViewers[$i][0] & " Handle=" & $lstViewers[$i][1] & @CRLF) Next
  5. Psalty, This did not work. The nature of the modal form is that the $oTbox is an object in the DOM all the time, it is just not visible/accessible all the time. So I still need some way to test if $oTbox is accessible without causing a COM error.
  6. Thanks Psalty. I deleted the ExitLoop when I cleaned up the code to post in this thread, but good eye! Thanks again and I'll give this a shot.
  7. Is "tag not loaded" a method of the DOM?
  8. I'm automating an IE page and need to wait for the page to load before populating a textbox. One problem is the way IIS names the DOM objects dynamically. I have to search the DOM looking for a certain string. When I find it, I know I have the right object. $oForm = _IEFormGetObjByName ($oIE, "form1") $oElems = _IEFormElementGetCollection ($oForm) For $oElem in $oElems if StringInStr($oElem.id,"tblEditFilterstxtValue") > 0 Then $oTbox = $oElem EndIf Next _IEFormElementSetValue($oTbox, $sName) The way the page is designed, a modal popup appears, but if the popup has not loaded I get: _IEFormElementSetValue($oTbox, "") _IEFormElementSetValue(^ ERROR So I added _IEErrorHandlerRegister () to the top of my script. (But the custom error handler works sometimes and not others. Odd.) When it does work I get the following output: @@ Debug(704) : $ErrorOutput = --> COM Error Encountered in di.au3 ----> $ErrorScriptline = 2439 ----> $ErrorNumberHex = 80020009 ----> $ErrorNumber = -2147352567 ----> $ErrorWinDescription = ----> $ErrorDescription = Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. ----> $ErrorSource = htmlfile ----> $ErrorHelpFile = C:\WINDOWS\system32\mshtml.hlp ----> $ErrorHelpContext = 0 ----> $ErrorLastDllError = 0 If I put a sleep() in the code, it will usually work, but depending on the connection it could fail. So with a fast internet connection (LAN) the sleep interval can be small, but across the web, it needs to be large. I end up with a sluggish app on the LAN in order to get the script to work over the web. So what I would like to do is put in a loop that checks for the object, but the script keeps crashing because the object is not visible/enabled or can't accept the focus. $iTimer = TimerInit() ; Timeout timer While 1 $o_Form = _IEGetObjByID($oIE, $oTbox.id) If Not @error And IsObj($o_Form) Then ExitLoop If TimerDiff($iTimer) >= 30000 Then MsgBox(16, "Error", "Timeout.") Exit EndIf Sleep(100) WEnd _IEFormElementSetValue($oTbox, $sName) This crashes at _IEGetObjByID($oIE, $oTbox.id) because $oTbox is not accessable. So how do I test to see if this object is accessable without having to sleep() and making my app sluggish? The second issue is the funky behavior of _IEErrorHandlerRegister (). I did find some reference to this behavior in the forum, but not much.
  9. In case others are asking the same question, here is what the page HTML looks like: <script type="text/javascript"> //<![CDATA[ var id='ctl11_id_id'; var name='ctl11_name_name'; var location='ctl11_location_location'; var order_dateTime='ctl11_order_dateTime_order_dateTime'; //]]> </script> And here is the AutoIT code to grab the variable: $oTboxID = _IEGetObjById ($oIE,$oIE.document.parentwindow.eval("id")) Thanks again Dsalty.
  10. Thanks Psalty, You are the man!
  11. A page I'm automating has a bunch of js variables that I would like to access using AutoIT. Can this be done and if so how?
  12. Psalty, what version are you running. I'm using 3.3.6.
  13. Using Psalty's method: For $oTable In $oTables $oTable.style.backgroundColor = 0xFFFF00 ; Yellow Next will set all of the table backgrounds on the page to yellow. However, when I find just the tables I want, it does not work. For $oTable In $oTables If String($oTable.className) = "controlContainer" Then $oTable.style.backgroundColor = 0xFFFF00 ; Yellow EndIf Next What am I missing here? [Edit to add] The filter on "controlContainer" does work and find the 3 tables I'm looking for.
  14. I hear you. Yes I know how to loop thru them, but I did not know the prop name. "Class" did not work. Where are the properties documented? Thanks for your help!
  15. Psalty, this is great! How do I search for just the 3 tables I want? Just the ones whose class = controlContainer There are 80 tables on the page!
×
×
  • Create New...