Sign in to follow this  
Followers 0

Stucks after "File to upload" window

2 posts in this topic

Greeting, so I've been trying to come up with solution, but no luck. Despite I tried to automate upload function, I released that it freezes after "Choose File to Upload" window appears..


#include <IE.au3>
;#include  <_Dbug.au3>
Global $oIE = _IECreate("", 1)
Global $upload2 = _IEGetObjById($oIE, "the_file")
_IEAction($upload2, "click")
$hWnd = WinGetHandle("Choose File to Upload")
MsgBox(0, "", $hWnd)

Have anybody faced this situation?

btw: srry for the advertise:) Besides it's no matter which site I'm trying to do this it's all the same.

Share this post

Link to post
Share on other sites

Your script is waiting for the input in the modal JS-window. Read

and all following from mLipok. With this knowledge you are ready to solve the problem.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Juvigy
      IE automation
      By Juvigy
      Hi Guys,
      I have a very complex IE page with lots of Java and Iframes. I need to be able to look for a change in one <input> field. So what i have done is to identify the field and hook an event listener with ObjEvent($title, "_Evt_")  and then i use :
      Func _Evt_OnChange() Local $o_object = @COM_EventObj ConsoleWrite( "Change" & $o_object.value &@CRLF) _FileWriteLine($MainLog, "Change:" & _NOW()) TitleCheck($o_object.value) EndFunc Which work fine user doesn't interact with some of the other buttons or radios on the page. As soon as the user does some interaction or refreshes the page or navigates - the event listener is 'deleted' somehow and no longer works. Any idea how to counteract that? The easiest this is to detect if there is ANY change on the page - then i can identify the INPUT and check for its value. Any idea how to do that ?
    • Dent
      How do I write to this form in IE?
      By Dent
      This is the page with the form I'm trying to write to Tennis Odds Calculator
      Username : dent
      Password : autoit
      Here's my full code:-
      #include <IE.au3> Local $TOCUsername = "dent" Local $TOCPassword = "autoit" Local $oIE = _IECreate("") If Not IsObj($oIE) Then Exit ConsoleWrite("Error creating instance of IE" & @CRLF) Local $oIE = _IEAttach("TOC") _IELoadWait($oIE) _IENavigate($oIE, "") _IELoadWait($oIE) Local $Page = _IEBodyReadText($oIE) If StringInStr($Page, "Username or Email") Then Local $oUsername = _IEGetObjByName($oIE, "username") _IEFormElementSetValue($oUsername, $TOCUsername) Local $oPassword = _IEGetObjByName($oIE, "password") _IEFormElementSetValue($oPassword, $TOCPassword) Local $oClassReturn = $oIE.document.getElementsByClassName("form-actions") If Not IsObj($oClassReturn) Then Exit ConsoleWrite("Error in $oClassReturn" & @CRLF) Local $oTagReturn = $oClassReturn.Item(0).getElementsByTagName("button") If Not IsObj($oTagReturn) Then Exit ConsoleWrite("Error in $oTagReturn" & @CRLF) $oTagReturn.Item(0).Click() _IELoadWait($oIE) ElseIf StringInStr($Page, "Use the menu at the top") Then _IENavigate($oIE, "") _IELoadWait($oIE) Else MsgBox(0, "Error", "Unknown error") EndIf Sleep(2000) Local $oForm = _IEFormGetObjByName($oIE, "form") Local $sFirstServePc1 = "55.7" Local $sFirstServePc2 = "54.9" Local $sFirstServeWonPc1 = "60.0" Local $sFirstServeWonPc2 = "54.6" Local $sSecondServeWonPc1 = 72.4" Local $sSecondServeWonPc2 = "61.0" Local $sBPSavePc1 = "78.0" Local $sBPSavePc2 = "68.8" Local $oPlayer1FSPC = _IEFormElementGetObjByName($oForm, "fs") $oPlayer1FSPC.Value = $sFirstServePc1 Local $oPlayer2FSPC = _IEFormElementGetObjByName($oForm, "ofs") $oPlayer2FSPC.Value = $sFirstServePc2 Local $oPlayer1FSWPC = _IEFormElementGetObjByName($oForm, "fsw") $oPlayer1FSWPC.Value = $sFirstServeWonPc1 Local $oPlayer2FSWPC = _IEFormElementGetObjByName($oForm, "ofsw") $oPlayer2FSWPC.Value = $sFirstServeWonPc2 Local $oPlayer1SSWPC = _IEFormElementGetObjByName($oForm, "ssw") $oPlayer1SSWPC.Value = $sSecondServeWonPc1 Local $oPlayer2SSWPC = _IEFormElementGetObjByName($oForm, "ossw") $oPlayer2SSWPC.Value = $sSecondServeWonPc2 Local $oPlayer1BPS = _IEFormElementGetObjByName($oForm, "kps") $oPlayer1BPS.Value = $sBPSavePc1 Local $oPlayer2BPS = _IEFormElementGetObjByName($oForm, "kpb") $oPlayer2BPS.Value = $sBPSavePc2  
    • Dent
      [SOLVED] Possibly used before declaration error in IE.au3
      By Dent
      Hi all,
      So I have a script that interacts with IE but for some reason I can't identify I'm getting the 'possibly used before declaration' error even though I've declared and used those variables.
      Local $oPlayer1FSPC = _IEGetObjByName($oIE, "fs") $oPlayer1FSPC.Value = $sFirstServePc1 Local $oPlayer2FSPC = _IEGetObjByName($oIE, "ofs") $oPlayer2FSPC.Value = $sFirstServePc2 Local $oPlayer1FSWPC = _IEGetObjByName($oIE, "fsw") $oPlayer1FSWPC.Value = $sFirstServeWonPc1 Local $oPlayer2FSWPC = _IEGetObjByName($oIE, "ofsw") $oPlayer2FSWPC.Value = $sFirstServeWonPc2 Local $oPlayer1SSWPC = _IEGetObjByName($oIE, "ssw") $oPlayer1SSWPC.Value = $sSecondServeWonPc1 Local $oPlayer2SSWPC = _IEGetObjByName($oIE, "ossw") $oPlayer2SSWPC.Value = $sSecondServeWonPc2 Local $oPlayer1BPS = _IEGetObjByName($oIE, "kps") $oPlayer1BPS.Value = $sBPSavePc1 Local $oPlayer2BPS = _IEGetObjByName($oIE, "kpb") $oPlayer2BPS.Value = $sBPSavePc2 The $s variables have had strings assigned earlier in the script and I've tested that with ConsoleWrite
    • Dent
      How to click THIS Login button
      By Dent
      At this site there is a Login button at the top, how do I click this? I can set the fields for username and password but everything I've tried to click Login does not work.
      I don't really want to have to do a pixelsearch and move the mouse to click the button.
    • harrigme
      Koda Freezes
      By harrigme
      This is probably very basic but I am trying to run Koda FormDesigner and if I click on "Generate Form Code" or "Generate Options" it freezes the program.  Any ideas on how to fix this?