What happens when you try this in IRB?

When I try it in IRB, my session looks like this:

irb(main):001:0> require 'watir'
=> true
irb(main):002:0> ie = IE.new
NameError: uninitialized constant IE
        from (irb):2
        from :0

So then I use the proper syntax:

irb(main):003:0> ie = Watir::IE.new
=> #<Watir::IE:0x2b2ea38 @typingspeed=0.08, @enable_spinner=false,
@empty_tag_name="DUMMY", @speed=:slow, @ole_object=ni
l, @url_list=[], @defaultSleepTime=0.1, @ie=#<WIN32OLE:0x2b2e960>,
@logger=#<Watir::DefaultLogger:0x2b2e8e8 @datetime_fo
rmat="%d-%b-%Y %H:%M:%S", @progname=nil,
@logdev=#<Logger::LogDevice:0x2b2e888 @shift_age=nil, @filename=nil,
@dev=#<IO:
0x278e7d0>, @shift_size=nil>, @level=2>,
@activeObjectHighLightColor="yellow",
@error_checkers=[#<Proc:[EMAIL PROTECTED]:/rub
y/lib/ruby/site_ruby/1.8/watir.rb:1075>]>

...and my browser appears.

My browser starts maximized.  Interestingly, until I point it to a site,
trying to minimize it returns an error:

irb(main):004:0> ie.minimize
WIN32OLERuntimeError: document
    OLE error code:80004005 in <Unknown>
      <No Description>
    HRESULT error code:0x80020009
      Exception occurred.
        from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1201:in
`method_missing'
        from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1201:in `title'
        from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1274:in
`set_window_state'
        from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1258:in `minimize'
        from (irb):4
        from :0
irb(main):005:0> ie.goto('http://www.google.ca')
=> 0.29
irb(main):006:0> ie.minimize
=> 1
irb(main):007:0> ie.minimize
=> 1
irb(main):008:0> ie.maximize
=> 1
irb(main):009:0>

That feels like a bug to me, but I don't think it's the problem you're
running into, unless your call to test_site is failing--which it will, if
that's literally what you're typing, since you haven't initialized that
variable.  If test_site is just a stand-in for your actual test site,
perhaps the goto() call is failing for some reason.  Are you checking for a
non-zero value on return?

---Michael B.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kiran Kumar..
Sent: February 23, 2006 12:19 AM
To: [email protected]
Subject: Re: [Wtr-general] Save the results..

Hi,
Thanx for the same. But i can write into a file only the output i.e
what and all i specify in puts, but i need the error message also be
written in the file. How to achieve this.

I'm unable to maximize the window.
Here with i'm sneding a piece of code which has the maximize function
in it.Please look into it and correct the same..


require 'watir'   # the watir controller
include Watir
# open the IE browser
ie =IE.new
  
 require 'win32ole'
 excel = WIN32OLE::new('excel.Application')
 workbook = excel.Workbooks.Open('E:\Watir
Examples\Kiran\gX_lgn_td1.xls')
 worksheet = workbook.Worksheets(1) #get hold of the first worksheet

   #variables:
   test_site = worksheet.Range('a1')['Value'] 
   
   # Opens the site.
  ie.goto(test_site)

  #maximizing the browser
    ie.maximize( )
 
Regards
Kiran..


--- Zeljko Filipin <[EMAIL PROTECTED]> wrote:

> 1. go to command prompt2. type
> ruby my_watir_script.rb > my_watir_script_results.txt
> 3. all output will be stored in my_watir_script_results.txt4. you can
> do it even shorter
> my_watir_script > my_watir_script_results.txt
> For more information, visit
>
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-
us/redirection.mspx
> or google for something like "command prompt redirect output to file"
> On 2/22/06, Kiran Kumar.. <[EMAIL PROTECTED]> wrote:> Hi,>> Where
> and how i can save the results got from running the Watir>
> scripts..Please help me out>> Regards> Kiran..>>
> __________________________________________________> Do You Yahoo!?>
> Tired of spam?  Yahoo! Mail has the best spam protection around>
> http://mail.yahoo.com>
> _______________________________________________> Wtr-general mailing
> list> [email protected]>
> http://rubyforge.org/mailman/listinfo/wtr-general>
> 
>
--http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to