[wtr-general] Re: download a file to a specific directory in IE 9

2012-02-14 Thread Jarmo Pertman
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


[wtr-general] Re: how to use one default and one customize attribute syntax

2012-02-14 Thread Abe Heward
If I understand your question correctly, here's the basics of how to do it 
in Watir-webdriver (not 100% about Watir, but it's probably the same)...

*module Watir*
*  class Element*
*def target*
*  @how = :ole_object *
*  return @o.target*
*end*
*  end *
*end*

That code will then allow you to use *div(:target=aaa-ldap)* in your 
Watir code (note, that's different than what you have, which is *@target =* . 

-- 
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] Re: I found what the mistake wasRe: how to use one default and one customize attribute syntax

2012-02-14 Thread Abe Heward
It's helpful not to create a new thread when you are posting a 
reply--especially to your own messages!

-- 
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] Re: Watir-Webdriver Chrome, FF, IE window maximize

2012-02-14 Thread Jarmo Pertman
It's RAutomation::Window#maximize and it would work only under
Windows. Also, i'd use window handle instead of title:
RAutomation::Window.new(:hwnd = hwnd).minimize
RAutomation::Window.new(:hwnd = hwnd).maximize

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

On Feb 10, 12:15 am, Anthony kabl.halle...@gmail.com wrote:
 you could try

 gem install rautomation

 monkey patch:
 class Watir::Browser
   def minimise
     RAutomation::Window.new(:title = /#{self.title}/).minimize
   end
   def maximise
     RAutomation::Window.new(:title = /#{self.title}/).maximise
   end
 end

 On Jan 5, 4:03 am, Super Kevy kpe...@scholarshipamerica.org wrote:







  I'm using webdriver to automate for the big 3 browsers and have the
  snippet below to set the screen size to maximum,  Chrome works perfect
  with the swtiches option, IE and FF are kind of acceptable hacks.

  A) Does anyone have a better way to maximize FF  IE with Webdriver?
  B) In Chrome I always get the inline-popup Do you want google chrome
  to save your password?.  Is there an elegant way to get rid of that?
  Its not a great problem just an annoyance.

  def Method_Login(ie,sURL,sBrowserType,sUserName,sPassword)
    puts ' * Method_Login'
    puts ' - Browser type: ' + sBrowserType.to_s
    puts ' - Login: ' + sUserName.to_s
    case sBrowserType
      when 'firefox'
        ie = Watir::Browser.new(:firefox)
        ie.window.move_to(0,0)
        ie.window.resize_to(1024,700)
      when 'chrome'
        ie = Watir::Browser.new(:chrome, :switches = %w[--start-
  maximized] )
      when 'ie'
        ie = Watir::Browser.new(:ie)
        ie.window.move_to(0,0)
        ie.window.resize_to(1024,700)
      else
        puts ' - FAIL. Browser type not found [ '+sBrowserType+' ]'
        puts ' - Valid browser types: firefox, chrome, ie'
        puts ' - ABORT. '
        stop
    end
    ie.goto(sURL)
    etc...
  end

-- 
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] Re: watir 3.0.rc2 breaks style.color

2012-02-14 Thread Jarmo Pertman
Hmm, weird that the cssText didn't include the color style...

Does that mean there should be some other solution for that?

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

On Feb 10, 7:37 pm, hillary weimar1...@gmail.com wrote:
 that worked. 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


[wtr-general] Re: Watir 3.0 select_list contents

2012-02-14 Thread Jarmo Pertman
You can also use a shorter version:
browser.select_list(:name = model).options.map :text

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

On Feb 7, 4:22 pm, Željko Filipin zeljko.fili...@gmail.com wrote:
 On Tue, Feb 7, 2012 at 8:10 AM, Trevor trevorm1...@gmail.com wrote:
  assert_equal( [none,fixed] , $browser.select_list(:name,
  model).options)

 Now you have to do something like this:

 browser.select_list(:name = model).options.collect {|option| option.text}

 More information:

 http://watir.com/2012/02/01/watir-webdriver-0-5-2/

 Željko
 --
 watir.com/book - author

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


Re: [wtr-general] how to use one default and one customize attribute syntax

2012-02-14 Thread Željko Filipin
On Mon, Feb 13, 2012 at 11:06 AM, Cristina Dumitrescu 
cristina.watir.toro...@gmail.com wrote:
 $browser.div(:class, searchres).div(:class = 'data a' , @target =
'aaa-ldap').span(:class = r, :text = /aaa-ldap/).flash

I do not see where you defined @target variable. Make sure it is symbol,
not string:

http://ruby-doc.org/core-1.9.3/String.html#method-i-to_sym

Željko
--
watir.com/book - author

-- 
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] tests are failing with Errno::E14001

2012-02-14 Thread RJ
what does this mean?
No update on watir/ruby, the only thing that was updated were third
party apps:
  notepad++ and tortoiseSVN.

Now when I run the same tests (which used to work up until the
update), I get the following error message.

Errno::E14001: This application has failed to start because the
application configuration is incorrect. Reinstalling the application
may fix this problem.

Can somebody help.

Thanks,
RJ

-- 
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] Re: tests are failing with Errno::E14001

2012-02-14 Thread RJ
SOLVED:
re-installing a previous version of tortoiseSVN (1.6.16) solved the
above 14001 error

I cant explain why...but I'm glad that my scripts are running again.

Hope this helps anyone running watir-webdriver/ruby-devkit/ruby187
with tortoiseSVN (do not upgrade to 1.7+)

-- 
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] Re: download a file to a specific directory in IE 9

2012-02-14 Thread Anthony Hallett
It may be very simple
try adding a '.' in the file path before CSV

.. The lack of file extension may be causing windows save some
issues  ...

On Feb 14, 4:45 am, 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


[wtr-general] Re: download a file to a specific directory in IE 9

2012-02-14 Thread hillary
I'm not sure what's wrong with the file path. It seems to be correct, but 
windows i just ignoring it. 

It works manually. 

I've started re-testing, and now instead of a popup it's that message at 
the bottom of the screen, is there a way to deal with that with rautomation?

-- 
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] Re: watir 3.0.rc2 breaks style.color

2012-02-14 Thread hillary
it does, I just wasn't sure how to validate with that information that it 
returns. 

browser.text_field(:id, text).style == ?

-- 
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] We are moving away from JIRA: please raise all future issues/bugs at Github

2012-02-14 Thread Alister Scott
Here's the link: https://github.com/watir/watir/issues

Cheers,
Alister

Alister Scott
Brisbane, Australia
Watir Web Master: http://watir.com
Blog: http://watirmelon.com
LinkedIn: http://www.linkedin.com/in/alisterscott

There are two ways to get enough: One is to continue to accumulate more
and more. The other is to desire less. *~ G. K. Chesterton*

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