Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Unable to handle File Open dialog (using Pamie)

Reply
Thread Tools

Unable to handle File Open dialog (using Pamie)

 
 
Oltmans
Guest
Posts: n/a
 
      03-12-2008
Hi all,

I'm new to Python and am automating few tasks using Pamie. Everything
worked well until I had to handle the File Open Dialog. I mean I'm
trying to automate the file upload process using Pamie. Basically I
just want to automate the process of file upload. I want to
automatically hit the Browse button and then enter 'C:\image1.jpg' in
the File Name text field and then hit the Open button (all using
Pamie, winguiauto or whatever would give me the solution

Here is my html ( file is stored in my PC at C:\\Test\Test.html )
<html>
<body>

<input type='file' id='upload'/>
</body>
</html>

and here is my source

ie.navigate("C:\Test\Test.html")
ie.buttonClick('upload')
handle = winGuiAuto.findTopWindow(wantedText="Choose file")
print 'handle ='+ str(handle)

p=handlePopup('ChooseFile','&Open')
p.enterTextAndClickControl(handle,('C:\image1.jpg' ,'&Open'))
p.run()

now when I run the above program the Browse button gets clicked and
File Open dialog pops up but 'c:\image1.jpg' (without quotes) is not
entered in the File Name field and neither the Open button gets
clicked. Also I get this error in the console
--
Traceback (most recent call last):
File "firsttest.py", line 26, in <module>
p.enterTextAndClickControl(handle,('C:\image1.jpg' ,'&Open'))
File "C:\Python25\lib\site-packages\cModalPopUp.py", line 113, in
enterTextAn
ClickControl
wantedClass="Edit")
File "C:\Python25\lib\site-packages\winGuiAuto.py", line 167, in
findControl
selectionFunction=selectionFunction)
File "C:\Python25\lib\site-packages\winGuiAuto.py", line 235, in
findControls
return searchChildWindows(topHwnd)
File "C:\Python25\lib\site-packages\winGuiAuto.py", line 213, in
searchChildW
ndows
childWindows)
TypeError: an integer is required

--
I've searched Internet, searched usenet, scratched my head but nothing
worked. Also, I tried joining the Pamie User group but I couldn't. So
I will really appreciate your help/insights/ideas/hints/anythiing that
can help me fix the problem.

Thanks,
Rolf
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open file dialog in Ruby, and get open FileName? :-( iMelody Ooo Ruby 5 10-21-2010 04:02 PM
On Clicking on Open button in asp download dialog it open two copy ofexcell file?? chandan ASP .Net Web Controls 0 11-17-2008 08:46 AM
On Clicking on Open button in asp download dialog it open two copy ofexcell file?? chandan ASP .Net 0 11-17-2008 08:44 AM
Force Open .OFT file in Outlook do not show File Download Dialog Kele ASP .Net 0 07-14-2005 06:27 AM
File Handle Reading Blues: Rereading a File Handle for Input Dietrich Perl 1 07-22-2004 10:02 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57