[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

jabowen

8/9/2007 3:44:00 PM

I been teaching myself Ruby for three months now and
I've needed very Little help until now. I've been
working with text files using strings, array's, hash's
and CSV all with Little problem

Now I've moved onto using the watir gem with no luck.
Unless I open www.yahoo.com or www.google.com I get
frame errors or the code will not exit. Am I just
missing something basic. Code same below.

#ie = Watir::IE.start("http://www.yahoo....) #works
#ie = Watir::IE.start("http://tv.yahoo....) #no exit
#ie =
Watir::IE.start("http://finance.yahoo....)#frame
error
ie = Watir::IE.start("http://www.nascar....) #no
exit

Jeff



____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/colle...

6 Answers

Kyle Schmitt

8/9/2007 4:08:00 PM

0

Umm, did you require watir first?

Like this...

require 'watir'
$ie=Watir::IE.start("http://www.google...)
$ie.text_field(:index,1).set("watir mailing list")
$ie.button(:value,/Seach/).click

Kyle Schmitt

8/9/2007 4:10:00 PM

0

But it helps if you spell correctly...

mysource.sub!('Seach','Search')

lrlebron@gmail.com

8/9/2007 8:30:00 PM

0

On Aug 9, 10:44 am, Jeffrey Bowen <ja_bo...@yahoo.com> wrote:
> I been teaching myself Ruby for three months now and
> I've needed very Little help until now. I've been
> working with text files using strings, array's, hash's
> and CSV all with Little problem
>
> Now I've moved onto using the watir gem with no luck.
> Unless I openwww.yahoo.comorwww.google.comI get
> frame errors or the code will not exit. Am I just
> missing something basic. Code same below.
>
> #ie = Watir::IE.start("http://www.yahoo....) #works
> #ie = Watir::IE.start("http://tv.yahoo....) #no exit
> #ie =
> Watir::IE.start("http://finance.yahoo....)#frame
> error
> ie = Watir::IE.start("http://www.nascar....) #no
> exit
>
> Jeff
>
> ____________________________________________________________________________________
> Sick sense of humor? Visit Yahoo! TV's
> Comedy with an Edge to see what's on, when.http://tv.yahoo.com/colle...

require 'watir'
include Watir

ie = IE.new
ie.goto('http://finance.yahoo...)


This works for me.
Luis


Kyle Schmitt

8/9/2007 8:58:00 PM

0

Luis,
Out of curiosity, have you found much advantage to including the
"include Watir" line?
Since it pretty much only saves me having to type "Watir::", and I
only type that once, I almost always omit the include.

--Kyle

Matt Berney

8/9/2007 11:49:00 PM

0

When writing portable code, it is extremely helpful to include the full
namespace. I try to avoid using the include statement so that the code
is more portable and readable.
--
Posted via http://www.ruby-....

lrlebron@gmail.com

8/10/2007 1:20:00 AM

0

On Aug 9, 3:58 pm, "Kyle Schmitt" <kyleaschm...@gmail.com> wrote:
> Luis,
> Out of curiosity, have you found much advantage to including the
> "include Watir" line?
> Since it pretty much only saves me having to type "Watir::", and I
> only type that once, I almost always omit the include.
>
> --Kyle

That's the only real advantage. Of course in a script this short it is
not very useful. But in a longer script you may save a little time.

Luis