Re: [wtr-general] get .zip by url

2011-03-13 Thread Jari Bakken
On Sun, Mar 13, 2011 at 2:01 PM, maga  wrote:
>
> So, how can I specify a path to save the archive and how to manage
> saving flow(something like autoit for windows)?
>

First of all, if no JavaScript support is required, you should be able
to download the file with a HTTP library (like Net::HTTP in stdlib) -
you don't need watir-webdriver for this at all.

Otherwise, this isn't currently possible with the HtmlUnit driver +
the remote server. You can do it with a local Firefox like so:

  profile = Selenium::WebDriver::Firefox::Profile.new
  profile['browser.download.dir'] = "/path/to/downloads"
  profile['browser.download.folderList'] = 2
  profile['browser.helperApps.neverAsk.saveToDisk'] = "application/zip"

  browser = Watir::Browser.new(:firefox, :profile => profile)

or with a remote Firefox:

  profile = Selenium::WebDriver::Firefox::Profile.new
  profile['browser.download.dir'] = "/path/to/downloads" # refers to a
path on the machine where the selenium server is running
  profile['browser.download.folderList'] = 2
  profile['browser.helperApps.neverAsk.saveToDisk'] = "application/zip"

  capabilities =
Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile =>
profile)
  browser = Watir::Browser.new(:remote, :desired_capabilities => capabilities)

That's your options at the moment.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] get .zip by url

2011-03-13 Thread maga
HI! Breaking brain 3rd day...
I'm trying to download file( a .zip archive) by url.
How can I do this by htmlunit:
server = Selenium::Server.new(“merlion/selenium-server-
standalone-2.0b2.jar”, :background => true)
server.start
capabilities =
Selenium::WebDriver::Remote::Capabilities.htmlunit(:javascript_enabled
=> true)
browser = Watir::Browser.new(:remote, :url => “http://127.0.0.1:/
wd/hub”, :desired_capabilities\
=> capabilities)

catalog_url = “https://url″
browser.goto(catalog_url)

So, how can I specify a path to save the archive and how to manage
saving flow(something like autoit for windows)?

Please, help!

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com