Re: [Wtr-general] file download

2006-09-28 Thread Luke
ok thnx, what a about bigger files? downloading something that is invoked by the link click?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] file download

2006-09-25 Thread Luke
Can you show me the example of this www:mechanize beacuse i don't know how to do itthnx Luke


___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] file download

2006-09-25 Thread Charley Baker
You can also use Ruby's Net Http standard library if you just want to
do a simple file download:
require 'net/http'

Net::HTTP.start(www.ruby-lang.org) { |http|
  resp = http.get(/images/logo.gif)
  open(rubylogo.gif, wb) { |file|
file.write(resp.body)
   }
}

-Charley

On 9/25/06, Luke [EMAIL PROTECTED] wrote:
 Can you show me the example of this www:mechanize beacuse i don't know how
 to do it

 thnx

 Luke

 
 
 
 
 
 
 
 
  ___
  Wtr-general mailing list
  Wtr-general@rubyforge.org
  http://rubyforge.org/mailman/listinfo/wtr-general
 
 


 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] file download

2006-09-25 Thread Bill Agee
Here's a way to get a binary file and save it locally using net/http, built 
from the example on this site:

http://www.rubynoob.com/articles/2006/08/21/how-to-download-files-with-a-ruby-script


# Save the google logo.gif to the current dir.
require 'net/http'

Net::HTTP.start(www.google.com) do |http|
  resp = http.get(/intl/en/images/logo.gif)
  open(google.gif, wb) { |file|
file.write(resp.body)
  }
end
puts Done!
==

This would of course need changes if you have to deal with authentication or 
HTTPS. :)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4399messageID=12417#12417
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] file download

2006-09-20 Thread Luke
is it possible to download a file from page without invoking window to specify name file, path, dialog with save, cancel buttons, can make it automatically, just specify link to a file and path in code ?Luke
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] file download

2006-09-20 Thread Christian Baumann


Luke schrieb:
 is it possible to download a file from page without invoking window to 
 specify name file, path, dialog with save, cancel buttons, can make it 
 automatically, just specify link to a file and path in code ?
I´ve realized this with a system call and wget (yes, there is a windows 
version, google for unxutils.)

 Luke
Regards,
Christian
 

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] file download

2006-09-20 Thread Chris McMahon
 is it possible to download a file from page without invoking window to specify name file, path, dialog with save, cancel buttons, can make it
 automatically, just specify link to a file and path in code ?I´ve realized this with a system call and wget (yes, there is a windowsversion, google for unxutils.)wget is good, the Ruby version of WWW::Mechanize should do this also. 

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] File Download

2006-07-25 Thread mail
Hi all,

i have a problem with downloading a file. How to handle the File Save - Popup?
I have found this http://jira.openqa.org/browse/WTR-63 when searching the web, 
but it doesnŽt work: Nothing happens, I donŽt even get an error message.

Thanks for advice,
Chriss



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] File Download dialog never gets attached/found

2006-07-19 Thread John Krystynak
I want to get Watir to load a page, press a download file button and
save the file.

This first part works fine - and the File Download dialog comes up
-  PART 1 
require 'Watir'
include Watir

ie = IE.new
ie.goto(http://example.com;)
ie.button(:value,Login).click
ie.link(:id, csv_link).click

-

If I run PART 1 from the command line, it never exits, it just keeps
running while the File Download dialog is up.

However, if I include the autoit code (below) in the same file, it
never clicks the file dialog.

If I kill it the running PART I script, and then run the following:

% ruby autoitFS.rb myfile

where the autoitFS.rb is code like this:
- autoitFS.rb -
require 'win32ole'

autoit = WIN32OLE.new(AutoItX3.Control)
file = ARGV[0]

autoit.WinWait(File Download)
autoit.ControlClick(File Download, Would you like to open the file
or save it to your computer?, Save)
autoit.WinWait(Save As, Save in, 3)
autoit.ControlSetText(Save As, Save in, Edit1, E\:\\Docs\\ +
file + .csv)
autoit.ControlClick(Save As, Save in, Save)

--

It works...

To summarize: it works if I run the scripts separately - and I Ctrl-C
the first script when the dialog comes up.  It doesn't work if I
combine the scripts into one ruby file.

How can I get this to work from within one .rb file so I can loop over
a bunch of URLs?
Also, how can I get the first script to exit by itself?

I tried doing this from at the bottom of PART 1

system( ruby autoitFS.rb myfile )

but nothing happenend.

Thanks,
johnk

-- 
Compare New  Used Networking Equipment
http://routercomp.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] File Download Pop-Ups

2006-06-29 Thread Charley Baker
Take a look at winClicker.rb, clickWindowsButton should work, something like this: require 'watir/winClicker'clicker = WinClicker.newclicker.clickWindowsButton('File Download', 'Save')-Charley
On 6/28/06, Andy Case [EMAIL PROTECTED] wrote:






Hi,

I get the following 
Pop-up from my application.

Is there a WATIR 
command that allows me to select the buttons below.

___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] File Download Pop-Ups

2006-06-29 Thread Cain, Mark








I ended up having to put a sleep 2 in winClicker to get this
to click the button. At approximately line 299 in WinClicker.rbthis
section:



 if d != -1 

 makeWindowActive(hwnd)

   sleep 2

 clickButtonWithHandle(d)

 else



After I added this then it would click the specified button.



Hope this helps,







--Mark















From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Charley Baker
Sent: Thursday, June 29, 2006 8:03
AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] File
Download Pop-Ups





Take a look at winClicker.rb, clickWindowsButton
should work, something like this: 
require 'watir/winClicker'
clicker = WinClicker.new
clicker.clickWindowsButton('File Download', 'Save')

-Charley



On 6/28/06, Andy
Case [EMAIL PROTECTED]
wrote:









Hi,











I get
the following Pop-up from my application.











Is
there a WATIR command that allows me to select the buttons below.















___
Wtr-general mailing list
Wtr-general@rubyforge.org 
http://rubyforge.org/mailman/listinfo/wtr-general













___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] File Download

2006-01-24 Thread carl . l . shaulis




Good afternoon:

I have two areas where I am currently blocked.

The most important concern is dowloading a file.  I use Winclicker
successfully for handling other pop-ups in our application but when if
comes to File Download it does not appear to work.  Searching the archives
I find reference to AutoIt, which I have never been able to get working
successfully on my machine.  I also have not had any luck with WET.

What is the best way to execute a File Download today?

A less important concern is the ability to view the source of a page and
validate the content within the source.

Can this be done using WATIR?

Any tips, tricks and hints would be most appreciated!

Thanks,

Carl
--
NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general