Jump to content

Tiax

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Tiax

  1. Hi, I'm creating a script that is going to navigate through a webpage and record the time it takes to do certain stuff. The problem I'm having is that there is javascript that edits the source code and adds the link I need to click but I can't click the element for some reason. The original source code when the page is loaded: <SPAN style="Z-INDEX: 100; COLOR: black" id=treeDiv class=smallDescription> <DIV style="POSITION: absolute; WIDTH: 150px; TOP: 76px; LEFT: 10px" class=hide>Laddar menyn... </DIV> </SPAN> Ps. "Laddar menyn..." equals "Loading menu..." in Swedish. And when the menu is loaded it's a bunch of divs with onclick attributes. For example: <div style="z-index: 11; padding-left: 0pt; background-position: 120px 3px; background-image: url(/skins/Riksbyggen/images/i1.gif); padding-top: 1px; background-repeat: no-repeat; visibility: visible; top: 228px; left: 8px; background-color: rgb(213, 2, 2); color: white;" onmouseover="nodem8b1f22570b5f41e1a8ec997f4ecbcd50.mouseover()" onmouseout="nodem8b1f22570b5f41e1a8ec997f4ecbcd50.mouseout()" class="menuItem" id="divm8b1f22570b5f41e1a8ec997f4ecbcd50" onclick="nodem8b1f22570b5f41e1a8ec997f4ecbcd50.changeLoc();return false"> <img hspace="4" align="absMiddle" src="/menu/images/extLink.gif" class="extLinkImg"/>Edit menu</div> I can't get the div with: $oDiv = _IEGetObjById ($oIE, "divm8b1f22570b5f41e1a8ec997f4ecbcd50") And I can't execute the onclick with: $oIE.document.parentwindow.execScript('nodem8b1f22570b5f41e1a8ec997f4ecbcd50.changeLoc();return false') I even tried making a exact copy of the div and clicking that element: $sHTML = _IEDocReadHTML($oIE) $sHTML = $sHTML & '<div style="z-index: 11; padding-left: 0pt; background-position: 120px 3px; background-image: url(/skins/Riksbyggen/images/i1.gif); padding-top: 1px; background-repeat: no-repeat; visibility: visible; top: 228px; left: 8px; background-color: rgb(213, 2, 2); color: white;" onmouseover="nodem8b1f22570b5f41e1a8ec997f4ecbcd50.mouseover()" onmouseout="nodem8b1f22570b5f41e1a8ec997f4ecbcd50.mouseout()" class="menuItem" id="divm8b1f22570b5f41e1a8ec997f4ecbcd50" onclick="nodem8b1f22570b5f41e1a8ec997f4ecbcd50.changeLoc();return false"> <img hspace="4" align="absMiddle" src="/menu/images/extLink.gif" class="extLinkImg"/>EleFHant</div>' _IEDocWriteHTML ($oIE, $sHTML) But nothing works. Someone plese help me? Ps. It doesn't help if I wait with Sleep(5000) for the menu to load, it's still the same issue.
  2. It works if I use Run() instead of RunAs. Maybe it's cause _IEAttach can't attach a window the current user doesn't own? Anyone got some nice solution to fix this?
  3. I've tried different kinds, for example: $oIE = _IEAttach("", "instance", 1) Even that one fails. I have IE8, can it be something to do with that?
  4. Hi, Im using: RunAs("username", "domain", "password", 0, "C:\Program Files\Internet Explorer\iexplore.exe http://website.com") WinWaitActive("Windows Internet Explorer","") $oIE = _IEAttach("Microsoft ISA Server 2006") But _IEAttach always returns "No Match" error. Anyone know why?
  5. Worked! Thanks a lot!
  6. Really appreciate the fast answer! Don't follow 100% though, care to explain? The window popping up is a custom window not containing any real controls, the way I solved it now is to wait 5 sec and then input text and then send a enter key. But as you can understand I would like to do it in a more appropriate way. I mean if the computer is busy for some reason and the GUI doesn't appear in 5 sec I'm screwed.
  7. Hi, I have the following window: >>>> Window <<<< Title: Class: HwndWrapper[sewmain.exe;;e407155a-3d68-4e3d-927c-3d298e0968fa] Position: 20, 46 Size: 600, 358 Style: 0x16080000 ExStyle: 0x000C0000 Handle: 0x00070220 >>>> Control <<<< Class: Instance: ClassnameNN: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: 0x000100E0 >>>> Mouse <<<< Position: 242, 185 Cursor ID: 2 Color: 0x000000 >>>> StatusBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<< How come I can't use WinWaitActive("[CLASS:HwndWrapper]", "") when I open it?
  8. Hi everyone! I've written a AutoIt script that starts a GUI application that shows a login form, the script fills the inputs and logs in. While it's waiting to be logged in it records the time it takes. Once the application is logged in the script outputs the time it took and closes the application. Fix 1: I need this script to work on a remote computer and run every 5 min (and I can't have a user logged in all the time). So I want the script to run even though no user is logged in. One of the less fun parts is that the login form GUI is some custom GUI so I can't use ControlSend or even WinWaitActive. Though when the application is logged in it's a regular window so to check that I use WinWaitActive. Fix 2: I have a script on a remote computer that starts a RDP connection to the server with the GUI application on it. And I've put my original script (with the timer and all that) as autostart on a specific user that I login with in the RDP session. But the same problem occurs that I have to start the RDP session every 5 min without having a user logged in 24/7. I reckon that this might be simpler to solve since atleast RDP doesn't use custom windows. Either way both fix 1 and fix 2 would work for me. So if someone knows how I could move on from here, please help me out! PS. It's a Windows Server 2003. DS.
×
×
  • Create New...