changed.. But getting this error: Bro.rb:17:in `setdefaultbrowser':
undefined method `default' for Watir::Browser:Class (NoMethodError)

And Also i want to pass the browser as a parameter and at run i can
verify for IE,Firefox and safari. So i planned. I worked on this
earlier but now the solution is specific to fire fox. if you change ie
in that you still see the firefox opening rather ie. So i need this.
help me in this as well.

On Jul 7, 6:28 pm, Amit Bobade <amit.sr...@gmail.com> wrote:
> Hi,
>
> Check your code properly, mate.
>
> def setdefaultbrowser()
> require 'watir'   should be - require 'watir-webdriver'
>
> Thanks,
> -Amit.
>
>
>
> On Thu, Jul 7, 2011 at 6:50 PM, V <vaditya2...@gmail.com> wrote:
> > My code Looks like this. Let me know what to do. As getting the below
> > error:
> > C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.9.1/lib/watir/
> > version.rb:3: warning: already initialized constant VERSION
> > C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.9.1/lib/watir/
> > exceptions.rb:12: superclass mismatch for class UnknownObjectException
> > (TypeError)
> >        from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> > 36:in `gem_original_require'
> >        from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> > 36:in `require'
> >         from C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.9.1/lib/watir/
> > waiter.rb:6
> >        from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> > 36:in `gem_original_require'
> >        from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> > 36:in `require'
> >        from
> > C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.9.1/lib/watir.rb:
> > 7
> >        from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> > 59:in `gem_original_require'
> >        from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> > 59:in `require'
> >        from Bro.rb:7:in `defaultbrowser'
>
> > CODE:
>
> > require "rubygems"
> > require "Watir-webdriver"
> > require "test/unit"
> > require "win32ole"
>
> > def defaultbrowser(br)
> > require 'watir'
> >  Watir::Browser.default=br
> > puts "Default Browser:" +Watir::Browser.default
> > end
>
> > def setdefaultbrowser()
> > require 'watir'
> > #~ $br=Watir::Browser.new
> > $br=Watir::Browser.new :ff
> > #~ Watir::Browser.default=br
> > #~ puts "Default Browser:" +Watir::Browser.default
> > if ($br)
> >  $br.close($br) # Not working need to do
> >  else
> >   $br=Watir::Browser.new
> >  end
>
> > end
>
> > br= 'firefox' #'safari', 'firefox', or 'ie'
> >  #URL=
> >  defaultbrowser(br)
> >  setdefaultbrowser()
>
> > On Jul 7, 6:12 pm, Željko Filipin <zeljko.fili...@wa-research.ch>
> > wrote:
> > > On Thu, Jul 7, 2011 at 3:00 PM, V <vaditya2...@gmail.com> wrote:
> > > > Ruby187/lib/ruby/gems/1.8/gems/firewatir-1.9.1/lib/firewatir/
> > > > jssh_socket.rb:19:in `js_eval':  this.docShell is null
> > > > (JsshSocket::JSTypeError)
>
> > > You have installed watir-webdriver, but you are still using firewatir gem
> > in
> > > your scripts, as the error message says.
>
> > > Replace require "firewatir" with require "watir-webdriver" in your
> > scripts.
>
> > > Željko
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com
>
> --
> Thanks and Regards,
> Amit

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to