Jump to content

BananaFish

Members
  • Posts

    4
  • Joined

  • Last visited

BananaFish's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. I've encountered this problem although only intermittently and not in a fixed pattern as yours where you can predict it on demand. My solution may help you though. I found out that some of the elements and javascripts on the webpage that I was pointing my IE to can sometimes interfere with the IE window loading properly, specifically the problem was tied to the autoit IE function _IELoadWait. If the user that I was using was logged off for too long, it would log me out, and worse yet, it would only display the logging out message as the new instance of IE was trying to access the page. The script would run periodically, and sometimes the webpage likes to default to something else thus changing up the series of loading screens each with their own scripts on them. Once I deactivated _IELoadWait from the functions that incorporated them like IECreate or IENavigate, as well as replacing them with basic sleep functions, this problem was resolved for me. For your problem, perhaps the first instance of IE is doing something like authentication which the website does by heading off to several other pages, or even a different page but with the same url and id specs, which the second IE window can simply skip allowing it to go ahead with the script and the first one seemingly can't run because some of the things are not there. If removing the _IELoadwaits functions in the script is too much trouble, I would say try detecting whether the script is running at all with some carefully placed echoprints/consolewrites in the script at vital points to see if it running or simply stopped. Going further, if it is indeed trying to run, try to grab some of the text on the page that it is running on to see what's going on.
  2. Hello Kevin, Tried out your code as you've posted it and it also doesn't work for me. I got a hunch that the Text entered into the _IELinkClickByText might have to be complete or perhaps there is a duplicate on the page somewhere and the function isn't resolving to any of them. So I ran this to see what the full text for the link is: $oIE = _IECreate ("http://www.autoitscript.com/forum/index.php?") $sText = _IEBodyReadText ($oIE) ConsoleWrite($sText) And it appeared to be this : "AutoIt General Help and Support" Adding Autoit in front of the text seems to make it work. Here is the working code with the change in it: #include <IE.au3> $delay = 0 $wait = 5000 $sURL = "http://www.autoitscript.com/forum/index.php?" $oIE = _IECreate($sURL, 0, 0, 0) $HWND = _IEPropertyGet($oIE, "hwnd") WinSetState($HWND, "", @SW_MAXIMIZE) _IEAction($oIE, "visible") _IELoadWait($oIE, $delay, $wait) _IELinkClickByText($oIE, "AutoIt General Help and Support") Edit: Fixed spacing
  3. Hello pro2gramer5, Could you type out the line with the executable followed by the parametres behind it? What do you expect the input to the executable to look like? And what are you getting? May we also see the code too ? BananaFish
  4. Hi Ganesh, To clarify what you're saying so we're on the same page. Yes if your application relies on GUI elements, such as sending keys to a visible window (can be hidden as well) then it will not work when the session is entirely in the background. For example, an executable that relies on task manager to execute it when the user is no longer logged on will not work. There are several ways around this that I've found. Make the application not rely on GUI elements, programs usually have some sort of command line console that you can work with, websites and webforms have the invoke web request with powershell which AutoIT has a version of. Leave your session logged in. This may or may not work depending on your application, but leaving your profile logged in in the lock position will allow some GUI dependent executables to run without a problem. As for disconnecting, I have not had any success with it, although I am open to the possibility. Get a virtual machine involved. Also, instead of simply using the send function. I would recommend that you use the ControlSend function. In fact I recommend trying this out first. This is a sample from a working IE script I am using: Local $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($oSubmit, "focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") ControlSend sends the keys directly to the control itself and doesn't rely on an application being in focus so that perhaps might help you in a combination of the above possibilities. If you are intent on using control send, you could always use the AU3Info tool under Tools in SciTE to better scout out the controls.
×
×
  • Create New...