#358 new
Christian Segura Serrano

HTML button tag without type not been matched by click_button method

Reported by Christian Segura Serrano | February 22nd, 2010 @ 04:18 PM

Hello Webrat team:

Seems that if you have an html button tag with type attribute the webrat click_button function can match it but if you don't have type, then it doesn't (I know is not a good practice to have button without type, but still can happen). Samples:

Webrat code: click_button("Next")

HTML button with type:


<span>Next</span>

HTML button without type:


<span>Next</span>

First sample button is matched by click_button method however latter is not.

I'm running webrat gem version 0.7.0.

I have attached diff for the "fix" that I had to do in order to make webrat to match the second example.

Hope it helps,

Comments and changes to this ticket

  • Christian Segura Serrano

    Christian Segura Serrano February 22nd, 2010 @ 04:19 PM

    Just in case, this is the full path for the file that I had to patch:

    /usr/lib/ruby/gems/1.8/gems/webrat-0.7.0/lib/webrat/selenium/location_strategy_javascript/button.js

  • Christian Segura Serrano

    Christian Segura Serrano February 22nd, 2010 @ 04:29 PM

    Sorry, here goes the real samples for my initial comment:

    
    <button type="submit">
      <span class="some_klass">
        <span>Next</span>
      </span>
    </button>
    
    <button>
      <span class="some_klass">
        <span>Next</span>
      </span>
    </button>
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

Attachments

Pages