It seems to work fine for me:

irb(main):017:0> puts ie.text_field(:id , /h/).value
abc
=> nil
irb(main):018:0> ie.text_field(:id , /h/).set('gg')
WIN32OLERuntimeError: focus
    OLE error code:800A083E in htmlfile
      Can't move focus to the control because it is invisible, not enabled, or 
of a type that does not accept the focus.
    HRESULT error code:0x80020009
      Exception occurred.
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3888:in 
`method_missing'
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3888:in 
`set'
        from (irb):18
irb(main):019:0> ie.text_field(:id , /h/).value='fg'
=> "fg"
irb(main):020:0> puts ie.text_field(:id , /h/).value
fg
=> nil
irb(main):021:0> Watir::IE::VERSION
=> "1.5.1.1145"
irb(main):022:0>

















  ----- Original Message ----- 
  From: Paul Rogers 
  To: [email protected] 
  Sent: Monday, January 29, 2007 8:40 PM
  Subject: Re: [Wtr-general] how to populate hidden text area?


  can you elaborate on that?
    ----- Original Message ----- 
    From: Suman Goel 
    To: [email protected] 
    Sent: Monday, January 29, 2007 5:08 PM
    Subject: Re: [Wtr-general] how to populate hidden text area?


    Yes. I did what you wrote below and it did not work

     

    -Suman

     


----------------------------------------------------------------------------

    From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
    Sent: Sunday, January 28, 2007 3:56 PM
    To: [email protected]
    Subject: Re: [Wtr-general] how to populate hidden text area?

     

    presumably you tried 

     

    @ie.text_field(:name, 'J_LDESC').value='yes'

     

    and that didnt work?

      ----- Original Message ----- 

      From: Suman Goel 

      To: [email protected] 

      Sent: Friday, January 26, 2007 3:54 PM

      Subject: [Wtr-general] how to populate hidden text area?

       

This did not work for me as my webpage has J__LDESC(the textarea in question) 
as the required field and so, on clicking submit button, I get the error 
message to fill in the field. Any other suggestions? Suman      try using the 
value method: @ie.text_field(:name, ..).value='some text' the set method fires 
all appropriate evens, and generally obeys what the web page is doing ( ie not 
letting you enter something that is hidden) but value= will get round that Paul 
       ----- Original Message -----   From: Suman Goel   To: wtr-general at 
rubyforge.org   Sent: Thursday, January 25, 2007 10:17 PM  Subject: 
[Wtr-general] how to populate hidden text area?    My webpage has the following 
code:                   <textarea name="J__LDESC" 
style="visibility:hidden">(NULL)</textarea>       My watir test has the 
following code:                   @ie.text_field(:name, "J__LDESC").set("some 
text")       I am getting the following error:                     1) Error:   
test_MemSlot(TestMemSlot):   WIN32OLERuntimeError: focus       OLE error 
code:800A083E in htmlfile         Can't move focus to the control because it is 
invisible, not enabled, or of a type that does not accept the focus.       
HRESULT error code:0x80020009         Exception occurred.       
C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `method_missing'      
 C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'       
C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'           Could 
someone help me in resolving this issue?       Thanks 


--------------------------------------------------------------------------

      _______________________________________________
      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


------------------------------------------------------------------------------


  _______________________________________________
  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