I did a gem cleanup because I had multiple versions of watir-webdriver,
added the require for watir-webdriver and added your suggested change
(browser.h2s.size).
When I ran my test I got an error...(NextTest.rb is my test script)
my list of require statements:
require 'rubygems'
require 'watir'
#require 'watir/ie'
require 'watir-webdriver'
#require 'test/unit'
require 'test/unit/testresult'
#require 'win32ole'
error:
C:\RubyScripts\MY_BrowserTests>ruby NextTest.rb
C:/Ruby/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.2.4/lib/watir-webdriver/version.rb:2:
warning: already initialized constant VERSION
C:/Ruby/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.2.4/lib/watir-webdriver/exception.rb:8:
superclass mismatch for class UnknownObjectException (TypeError)
from
C:/Ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from
C:/Ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require'
from
C:/Ruby/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.2.4/lib/watir-webdriver.rb:7
from
C:/Ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:58:in
`gem_original_require'
from
C:/Ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:58:in
`require'
from ./MY_ContactUsPage.rb:4
from
C:/Ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from
C:/Ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require'
from NextTest.rb:3
On Tue, Jun 28, 2011 at 4:50 AM, Željko Filipin <
[email protected]> wrote:
> On Mon, Jun 27, 2011 at 7:33 PM, Anne <[email protected]> wrote:
> > I need to be able to get a count of the number of h2 headers on a
> > page.
>
> Using watir-webdriver gem, you can do this:
>
> browser.h2s.size
> # => 5
>
> Željko
> --
> watir.com - community manager
> watir.com/book - author
> watirpodcast.com - host
>
>
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
>
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]