Sign in to follow this  
Followers 0
kyra06

Problem with a Browse popup

2 posts in this topic

Hi all,

I have been using AutoIT for only 3 weeks and I don't know it very well so I hope you will be able to help me.

I have an issue with a Browse popup which doesn't want to be active. I want to send a path to this popup to open a file, but the timeout of the WinWait method doesn't work.

And if I close the popup manually and reopen it, everything works fine and the path is written in the Edit1 field of the popup.

I also tried with these 2 methods which haven't made any difference:

WinSetState("Choose file", "", @SW_ENABLE)

WinSetState("Choose file", "", @SW_SHOW)

Here is my (not entire) code:

#include <IE.au3>
#include <Array.au3>

AutoItSetOption("SendKeyDelay", 50)
AutoItSetOption("WinSearchChildren",1)
AutoItSetOption("WinTitleMatchMode",2)

...

;Click on 'Browse' button and select the file to upload
$oVUBrowseButton             = _IETagNameGetCollection($oIE, "input",2)
_IEAction ($oVUBrowseButton, "click")

$WinTitle                   = "Choose file"

If WinWait($WinTitle, "", 10) = 0 Then
    MsgBox (0, "Error", "Could not find window with title " & $WinTitle)
    Exit
EndIf

If Not WinActive ($WinTitle) Then WinActivate($WinTitle)

If WinWaitActive ($WinTitle, "", 3) = 0 Then
    MsgBox (0, "Error", "Could not activate window with title " & $WinTitle)
    Exit
EndIf

ControlSend("Choose file", "", "Edit1", "\\BABELFISH\SharedDocs\5 - QA\Squish testcases\short.ready.mpg{ENTER}")

$oVUCopyrightButton             = _IETagNameGetCollection($oIE, "input",5)
_IEAction ($oVUCopyrightButton, "click")

$oVUPublishButton               = _IETagNameGetCollection($oIE, "a",9)
_IEAction ($oVUPublishButton, "click")

;Click on Sign out button
_IELinkClickByIndex ($oIE, 1) 
;Close the IE browser
_IEQuit ($oIE)

Any help is welcome! <_<

Thanks

Share this post


Link to post
Share on other sites



Hi all,

I have been using AutoIT for only 3 weeks and I don't know it very well so I hope you will be able to help me.

I have an issue with a Browse popup which doesn't want to be active. I want to send a path to this popup to open a file, but the timeout of the WinWait method doesn't work.

And if I close the popup manually and reopen it, everything works fine and the path is written in the Edit1 field of the popup.

I also tried with these 2 methods which haven't made any difference:

WinSetState("Choose file", "", @SW_ENABLE)

WinSetState("Choose file", "", @SW_SHOW)

Post the window information from the AutoIt Window Info tool (Class/Title/Etc.).

Also, explain what you mean by "...the timeout of the WinWait method doesn't work." Does that mean the window doesn't popup and you never get the proper timeout, or the window does popup and you see a timeout anyway?

<_<


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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