This is what I did in IRB:
irb(main):001:0> require 'watir'
=> true
irb(main):002:0> ie = Watir::IE.new
=> #<Watir::IE:0x2b49f48 @defaultSleepTime=0.1, @activeObjectHighLightColor="yel
low", @enable_spinner=false, @url_list=[], @logger=#<Watir::DefaultLogger:0x2b49
438 @progname=nil, @logdev=#<Logger::LogDevice:0x2b48640 @filename=nil, @dev=#<I
O:0x2a7e7d0>, @shift_size=nil, @shift_age=nil>, @level=2, @datetime_format="%d-%
b-%Y %H:%M:%S">, @typingspeed=0.08, @form=nil, @ie=#<WIN32OLE:0x2b49dc8>, @error
_checkers=[#<Proc:[EMAIL 
PROTECTED]:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1135>]>
irb(main):003:0> ie.goto("http://instant.search.yahoo.com/";)
=> 0.109
irb(main):004:0> ie.text_field(:index, 1).set("testing")
=> true
#at this point, the search bubble appears
irb(main):005:0> ie.contains_text(/Testing Foundations/)
=> #<MatchData:0x2e22c38>
irb(main):006:0> ie.link(:text, /Testing Foundations/).click

Does this do what you need?

-Jonathan



Quoting Sean Gallagher <[EMAIL PROTECTED]>:

> No, that does not answer my question.
> 
> I am looking to test updates to the page from the Ajax engine. In the case
> of instant search, I need to be able to test that when I type "ruby" into
> the form field, the browser is updated and shows the link for "Ruby Home
> Page" without clicking the button and submitting the form. (try typing that
> manually in the browser and you will see what I mean)
> 
> I do not think that Watir can "see" this type of change...(?)
> 
> -sean
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood
> Sent: Monday, September 26, 2005 4:33 PM
> To: [email protected]
> Subject: Re: [Wtr-general] Watir and Ajax
> 
> What specifically are you looking for?
> 
> I was able to use WATiR to load the page ... enter a criteria...
> validate the result ... follow the link ... and on from there ...
> 
> ie = IE.new
> ie.goto "instant.search.yahoo.com"
> ie.text_field( :name, "p" ).set "boston weather"
> ie.link( :text, /Extended/ ).click if ie.contains_text "Currently"
> 
> ... hope that's enough.
> 
> Realize that all you are doing with WATiR is directing IE and looking
> at the page it has loaded and the current content of that page...
> 
> So, if the underlying system is changing the content ... it doesn't care.
> 
> That's what is so nice about WATiR vs other tools like HTTPUnit that
> would have to emulate all of the functionality that IE takes care of
> for us...
> 
> ... I hope that helps answer your question.
> 
> j.
> 
> 
> On 9/26/05, Sean Gallagher <[EMAIL PROTECTED]> wrote:
> > Has anyone tried using Watir to test a website that uses Ajax?
> >
> > As a test, I am looking at the new Yahoo Instant Search.
> >
> > http://instant.search.yahoo.com/
> >
> > Here is the form HTML:
> >
> > <form name=w
> >
> action="http://rds.yahoo.com/;_ylt=AsI0.1halgK5ggoEYqqRJtOSA8oF;_ylu=X3oDMTB
> >
> hNjRqazhxBHNlYwNzZWFyY2g-/SIG=11ia1q7e9/EXP=1127856681/*-http%3A//search.yah
> > oo.com/search"><input type=hidden name=ei value="UTF-8"><input type=hidden
> > name=fr value="sfp-inst"><fieldset>
> > <legend><label for=yschsp><i>Instant Search</i></label></legend>
> > <div id=yschinput>
> > <input name=p id=yschsp size=54 maxlength=100 value="" autocomplete=off
> > onkeydown="instant_key(event);return true;">
> > <input class=ygbt type=submit name="y" value="Search the Web">
> > <input name=iscqry id=iscqry type=hidden>
> > </div>
> > </fieldset></div></form>
> >
> > I don't know how to handle the input that includes the onkeydown event
> using
> > Watir.
> >
> > Does anyone have any suggestions and/or advice?
> >
> > Thanks.
> >
> > -sean
> > _______________________________________________
> > Wtr-general mailing list
> > [email protected]
> > http://rubyforge.org/mailman/listinfo/wtr-general
> >
> 
> 
> --
> "http://ruby-lang.org -- do you ruby?"
> 
> Jeff Wood
> 
> _______________________________________________
> 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