I am trying to run following file, it does nothing and even does not give any error message.. not sure what is the problem. require "rubygems" require ''watir-webdriver'' require "rspec" describe "ASP TEST Suite" do before(:all) do client = Selenium::WebDriver::Remote::Http::Default.new client.timeout = 230 # seconds ? default is 60 profile = Selenium::WebDriver::Firefox::Profile.new driver = Selenium::WebDriver.for(:ff, {:http_client => client, :profile => profile}) $b = Watir::Browser.new(driver) end it "first" do puts "test" end after(:all) do $b.close end end
On Mon, Mar 19, 2012 at 11:53 PM, Ankita <ankita.gupta at adslot.com> wrote:> I am trying to run following file, it does nothing and even does not > give any error message.. not sure what is the problem.How are you running it?> require "rubygems" > require ''watir-webdriver'' > require "rspec" > > > describe "ASP TEST Suite" do > ?before(:all) do > ? ?client = Selenium::WebDriver::Remote::Http::Default.new > ? ? ? ?client.timeout = 230 # seconds ? default is 60 > ? ? ? ?profile = Selenium::WebDriver::Firefox::Profile.new > ? ? ? ?driver = Selenium::WebDriver.for(:ff, {:http_client => > client, :profile => profile}) > ? ? ? ?$b = Watir::Browser.new(driver) > ?end > it "first" do > ? ? ? ?puts "test" > end > ? after(:all) do > ? ?$b.close > ?end > end > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
I am running by going into specific file folder on command prompt and writing ruby file_name.rb to run it... On Mar 20, 10:01?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Mon, Mar 19, 2012 at 11:53 PM, Ankita <ankita.gu... at adslot.com> wrote: > > I am trying to run following file, it does nothing and even does not > > give any error message.. not sure what is the problem. > > How are you running it? > > > > > > > > > > > require "rubygems" > > require ''watir-webdriver'' > > require "rspec" > > > describe "ASP TEST Suite" do > > ?before(:all) do > > ? ?client = Selenium::WebDriver::Remote::Http::Default.new > > ? ? ? ?client.timeout = 230 # seconds ? default is 60 > > ? ? ? ?profile = Selenium::WebDriver::Firefox::Profile.new > > ? ? ? ?driver = Selenium::WebDriver.for(:ff, {:http_client => > > client, :profile => profile}) > > ? ? ? ?$b = Watir::Browser.new(driver) > > ?end > > it "first" do > > ? ? ? ?puts "test" > > end > > ? after(:all) do > > ? ?$b.close > > ?end > > end > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On Tue, Mar 20, 2012 at 6:45 PM, Ankita <ankita.gupta at adslot.com> wrote:> I am running by going into specific file folder on command prompt and > writing ruby file_name.rb to run it...You''ll see less headache if use the "rspec" command instead of ruby to run your specs: rspec file_name_spec.rb Or, is there a reason why you want to invoke rspec without the rspec command? Zach> > On Mar 20, 10:01?pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Mon, Mar 19, 2012 at 11:53 PM, Ankita <ankita.gu... at adslot.com> wrote: >> > I am trying to run following file, it does nothing and even does not >> > give any error message.. not sure what is the problem. >> >> How are you running it? >> >> >> >> >> >> >> >> >> >> > require "rubygems" >> > require ''watir-webdriver'' >> > require "rspec" >> >> > describe "ASP TEST Suite" do >> > ?before(:all) do >> > ? ?client = Selenium::WebDriver::Remote::Http::Default.new >> > ? ? ? ?client.timeout = 230 # seconds ? default is 60 >> > ? ? ? ?profile = Selenium::WebDriver::Firefox::Profile.new >> > ? ? ? ?driver = Selenium::WebDriver.for(:ff, {:http_client => >> > client, :profile => profile}) >> > ? ? ? ?$b = Watir::Browser.new(driver) >> > ?end >> > it "first" do >> > ? ? ? ?puts "test" >> > end >> > ? after(:all) do >> > ? ?$b.close >> > ?end >> > end >> > _______________________________________________ >> > rspec-users mailing list >> > rspec-us... at rubyforge.org >> >http://rubyforge.org/mailman/listinfo/rspec-users >> >> _______________________________________________ >> rspec-users mailing list >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users-- -- @zachdennis http://www.continuousthinking.com http://www.mutuallyhuman.com
It does work by running with rspec file_name_spec.rb. Thanks for that! There is another issue, I wrote my tests in watir and there is following command which use to run pretty well with Watir but now it gives error of undefined method ''confirm'' $b.confirm(true) do $b.button(:value,"reload").when_present.fire_event''onclick'' # Reset the Database end I used this command to click on a button which use to give some java script pop up and if you click on that pop up use to take a while scrubbing my database. Not sure how I could still use this command. On Mar 21, 11:20?am, Zach Dennis <zach.den... at gmail.com> wrote:> On Tue, Mar 20, 2012 at 6:45 PM, Ankita <ankita.gu... at adslot.com> wrote: > > I am running by going into specific file folder on command prompt and > > writing ruby file_name.rb to run it... > > You''ll see less headache if use the "rspec" command instead of ruby to > run your specs: > > ? ?rspec file_name_spec.rb > > Or, is there a reason why you want to invoke rspec without the rspec command? > > Zach > > > > > > > > > > > > > On Mar 20, 10:01?pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Mon, Mar 19, 2012 at 11:53 PM, Ankita <ankita.gu... at adslot.com> wrote: > >> > I am trying to run following file, it does nothing and even does not > >> > give any error message.. not sure what is the problem. > > >> How are you running it? > > >> > require "rubygems" > >> > require ''watir-webdriver'' > >> > require "rspec" > > >> > describe "ASP TEST Suite" do > >> > ?before(:all) do > >> > ? ?client = Selenium::WebDriver::Remote::Http::Default.new > >> > ? ? ? ?client.timeout = 230 # seconds ? default is 60 > >> > ? ? ? ?profile = Selenium::WebDriver::Firefox::Profile.new > >> > ? ? ? ?driver = Selenium::WebDriver.for(:ff, {:http_client => > >> > client, :profile => profile}) > >> > ? ? ? ?$b = Watir::Browser.new(driver) > >> > ?end > >> > it "first" do > >> > ? ? ? ?puts "test" > >> > end > >> > ? after(:all) do > >> > ? ?$b.close > >> > ?end > >> > end > >> > _______________________________________________ > >> > rspec-users mailing list > >> > rspec-us... at rubyforge.org > >> >http://rubyforge.org/mailman/listinfo/rspec-users > > >> _______________________________________________ > >> rspec-users mailing list > >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > -- > > -- > @zachdennishttp://www.continuousthinking.comhttp://www.mutuallyhuman.com > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
the error I got when I run the script using rspec file_name_spec.rb .... when I used to run using ruby file_name_spec.rb it was fine On Mar 21, 11:58?am, Ankita <ankita.gu... at adslot.com> wrote:> It does work ?by running with ?rspec file_name_spec.rb. Thanks for > that! > > There is another issue, I wrote my tests in watir and there is > following command which use to run pretty well with Watir but now it > gives error of undefined method ''confirm'' > > $b.confirm(true) do > ? ? ? $b.button(:value,"reload").when_present.fire_event''onclick'' # > Reset the Database > ? ? end > > I used this command to click on a button which use to give some java > script pop up and if you click on that pop up use to take a while > scrubbing my database. > Not sure how I could still use this command. > > On Mar 21, 11:20?am, Zach Dennis <zach.den... at gmail.com> wrote: > > > > > > > > > On Tue, Mar 20, 2012 at 6:45 PM, Ankita <ankita.gu... at adslot.com> wrote: > > > I am running by going into specific file folder on command prompt and > > > writing ruby file_name.rb to run it... > > > You''ll see less headache if use the "rspec" command instead of ruby to > > run your specs: > > > ? ?rspec file_name_spec.rb > > > Or, is there a reason why you want to invoke rspec without the rspec command? > > > Zach > > > > On Mar 20, 10:01?pm, David Chelimsky <dchelim... at gmail.com> wrote: > > >> On Mon, Mar 19, 2012 at 11:53 PM, Ankita <ankita.gu... at adslot.com> wrote: > > >> > I am trying to run following file, it does nothing and even does not > > >> > give any error message.. not sure what is the problem. > > > >> How are you running it? > > > >> > require "rubygems" > > >> > require ''watir-webdriver'' > > >> > require "rspec" > > > >> > describe "ASP TEST Suite" do > > >> > ?before(:all) do > > >> > ? ?client = Selenium::WebDriver::Remote::Http::Default.new > > >> > ? ? ? ?client.timeout = 230 # seconds ? default is 60 > > >> > ? ? ? ?profile = Selenium::WebDriver::Firefox::Profile.new > > >> > ? ? ? ?driver = Selenium::WebDriver.for(:ff, {:http_client => > > >> > client, :profile => profile}) > > >> > ? ? ? ?$b = Watir::Browser.new(driver) > > >> > ?end > > >> > it "first" do > > >> > ? ? ? ?puts "test" > > >> > end > > >> > ? after(:all) do > > >> > ? ?$b.close > > >> > ?end > > >> > end > > >> > _______________________________________________ > > >> > rspec-users mailing list > > >> > rspec-us... at rubyforge.org > > >> >http://rubyforge.org/mailman/listinfo/rspec-users > > > >> _______________________________________________ > > >> rspec-users mailing list > > >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-us... at rubyforge.org > > >http://rubyforge.org/mailman/listinfo/rspec-users > > > -- > > > -- > > @zachdennishttp://www.continuousthinking.comhttp://www.mutuallyhuman.com > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users