And what exactly is wrong with that file path so that it default to
downloads directory? What if you insert that path manually without any
use use of Watir or RAutomation? Does it work then?

Jarmo Pertman
-----
IT does really matter - http://itreallymatters.net


On Feb 13, 7:45 pm, hillary <weimar1...@gmail.com> wrote:
> In IE I'm trying to set the directory to download an exported file. I'm
> using TAZA.  The directory is generated at the beginning of the rake task
> below. I would like to set the path to download to the export_output folder
> created for the artifacts. For all of the windows i'm using rautomation.
>
> RSpec::Core::RakeTask.new(:report) do |t|
>   time = Time.now
>   $test_time = time.strftime("%y%m%d_%H%M")
>   file_hole = "artifacts/#{$test_time}"
>   FileUtils.mkdir_p "#{file_hole}/export_output"
>   t.rspec_opts = ["--require taza",
>                  "--format html --out #{file_hole}/index.html",
>                  "--format p", #changed this to nested for presentation
>                  "--color",
>                  "--pattern {__FILE__)/spec/isolation/insight/**/*_spec.rb",
>                  "--format FailingExamplesFormatter --out
> #{file_hole}/failing_examples.txt",
>                  "--tag report",
>                  "--tag ~ignore"]
> end
>
> The issue that i'm running into is that it doesn't seem to be setting the
> directory correctly so it's just saving to my downloads folder.
>
> This is my file path code:
>
>       $file_type = "CSV"
>       $report =  "rec_demand_report"
>       parent_folder =
> File.expand_path(File.dirname(File.dirname(File.dirname(__FILE__))))
>       puts parent_folder
>       folder = parent_folder.gsub("/", "\\")
>       puts folder
>       $file_path = folder + "\\artifacts\\" + $test_time +
> "\\export_output\\" + $report + $file_type
>
> This code is finding the correct directory to save to, it's just that the
> string i'm entering in the save as file name field isn't working correctly.
> It's setting the path in that text field as
> "C:\Users\user\Documents\Workspace\artifacts\120213_0919\export_output\rec_ 
> demand_reportCSV"
> and windows can't seem to intepret that correctly so it's just defaulting
> to the downloads folder.
>
> So I have two questions:
> 1. Is it possible to set the directory another way? Like setting it in the
> address bar in the save as window?
> 2. How do i need to manipulate the path before i set the edit field to get
> it to work correctly?
>
> Stystem Information:
> Ruby 1.9.2
> Watir 3.0.0.rc2
> rautomation (0.6.3)
>
> Windows 7
>
> Thanks.

-- 
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

Reply via email to