From: Ralf Mueller Date: 2012-12-05T16:19:10+09:00 Subject: Re: Unable to run the program. This is a multi-part message in MIME format. --------------030208030009090003040300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/05/2012 07:33 AM, sachin.s32@wipro.com wrote: > > Hey all, > > I am novice into the world of ruby and trying to do a simple search with the below program, but I am unable > to run and no error is thrown. Can somebody help me where I am going wrong? > > require 'watir' > > include Watir > > require 'test/unit' > > class Test_google_Search < Test::Unit::TestCase > > def search > > test_site = 'http://www.google.com' > > $ie = IE.new > > $ie.goto(test_site) > > $ie.text_field(:name, "q").set("pickaxe") > > $ie.button(:name, "btnG").click > > assert($ie.contains_text("Programming Ruby") ) > > end > > end > you just defined a class, no operation is performed here. In this special case, it's a child of Test::Unit, so you could run it with ruby this_file.rb or ruby this_file.rb --name=test_search if you rename search to test_search regards ralf --------------030208030009090003040300 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 12/05/2012 07:33 AM, sachin.s32@wipro.com wrote:

Hey all,

 

I am novice into the world of ruby and trying to do a simple search with the below program, but I am unable to run and no error is thrown. Can somebody help me where I am going wrong?

 

require 'watir'

include Watir

 

require 'test/unit'

 

class Test_google_Search < Test::Unit::TestCase

 

  def search

 

    test_site = 'http://www.google.com'

               

                $ie = IE.new

               

                $ie.goto(test_site)

               

                $ie.text_field(:name, "q").set("pickaxe")

                $ie.button(:name, "btnG").click

               

                assert($ie.contains_text("Programming Ruby") )

               

  end

 

end

 

 

 

you just defined a class, no operation is performed here.
In this special case, it's a child of Test::Unit, so you could run it with

ruby this_file.rb
or
ruby this_file.rb --name=test_search

if you rename search to test_search

regards
ralf
--------------030208030009090003040300--