#93 ✓resolved
rbpandey

Mechanize doesn't like url which is passed

Reported by rbpandey | December 16th, 2008 @ 12:08 PM

So with the 0.3.2 version of webrat this used to work, but it seems like the urls passed to the MechanizeSession have changed? See below:

And I press "Google Search" # features/step_definitions/webrat_steps.rb:10

  need absolute URL (RuntimeError)
  /tests/regression_tests/vendor/gems/gems/mechanize-0.8.5/lib/www/mechanize/chain/uri_resolver.rb:48:in `handle'
  /tests/regression_tests/vendor/gems/gems/mechanize-0.8.5/lib/www/mechanize/chain.rb:25:in `handle'
  /tests/regression_tests/vendor/gems/gems/mechanize-0.8.5/lib/www/mechanize.rb:440:in `fetch_page'
  /tests/regression_tests/vendor/gems/gems/mechanize-0.8.5/lib/www/mechanize.rb:228:in `get'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/mechanize.rb:10:in `get'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/core/session.rb:110:in `send'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/core/session.rb:110:in `request_page'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/core/elements/form.rb:20:in `submit'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/core/elements/field.rb:186:in `click'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/core/scope.rb:257:in `click_button'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/core_extensions/deprecate.rb:5:in `__send__'
  /tests/regression_tests/vendor/gems/gems/brynary-webrat-0.3.2.1/lib/webrat/core_extensions/deprecate.rb:5:in `clicks_button'
  ./features/step_definitions/webrat_steps.rb:11:in `And /^I press "(.*)"$/'
  features/webrat.feature:7:in `And I press "Google Search"'

Comments and changes to this ticket

  • rbpandey

    rbpandey December 16th, 2008 @ 12:08 PM

    • Title changed from “Mechanize doesn't like which is passed” to “Mechanize doesn't like url which is passed”
  • rbpandey

    rbpandey December 16th, 2008 @ 02:01 PM

    I found the problem, the mechanize session is now generating a new mechanize object per request. So essentially, there is no session context.

  • rbpandey
  • gaffo

    gaffo January 6th, 2009 @ 02:44 AM

    • Tag set to bug, patch
    • State changed from “new” to “open”

    Brynary: need to verify the patch and the bug at the moment.

    rbpandey: we'd prefer a github branch for this ticket and a pull request. A good name for the branch would be:

    lh_93_mechanize_url_bug

  • rbpandey

    rbpandey January 6th, 2009 @ 11:08 AM

    gaffo, the patch is a one line fix. i think a github branch would be overkill.

  • rbpandey

    rbpandey January 6th, 2009 @ 11:10 AM

    gaffo, the patch is a one line fix. i think a github branch would be overkill.

  • gaffo

    gaffo January 6th, 2009 @ 08:06 PM

    True, but brynary checks those much more often :) And he's the one with commit access.

  • gaffo

    gaffo January 6th, 2009 @ 08:06 PM

    • Tag changed from bug, patch to bug, patch, verify
    • State changed from “open” to “new”
  • gaffo

    gaffo January 7th, 2009 @ 12:07 AM

    • Tag changed from bug, patch, verify to bug, patch
    • State changed from “new” to “invalid”

    rbpandey, I couldn't verify this bug.

    If you could try pulling git://github.com/gaffo/webrat_rails_bugs.git and switching to branch lh_93. I've tried to replicate the issue in there but I'm not sure I have it.

    Send me a patch for the test or a pull request that verifies the bug and we'll reopen this issue.

  • rbpandey

    rbpandey January 7th, 2009 @ 12:10 PM

    The problem still exists, the way to reproduce this is to follow the instructions at

    http://www.nepharious.com/blog/2...

    OR use irb

    
    $ irb 
    irb(main)> path_to_webrat_lib = '/project/webrat/lib'
    irb(main)> require '#{path_to_webrat_lib}/webrat'
    irb(main)> require '#{path_to_webrat_lib}/webrat/mechanize'
    irb(main)> @mech = Webrat::MechanizeSession.new
    irb(main)> @mech.visit('http://www.google.com')
    irb(main)> @mech.click_button('Google Search')
    
  • Bryan Helmkamp

    Bryan Helmkamp January 13th, 2009 @ 11:19 AM

    • State changed from “invalid” to “open”
  • Bryan Helmkamp

    Bryan Helmkamp February 9th, 2009 @ 12:01 AM

    • State changed from “open” to “resolved”

    I followed the IRB instructions in the latest codebase and it worked (as in, it didn't raise an exception).

    I'm going to mark this as resolved, but if it's still an issue, please add a comment and I'll reopen.

    Cheers,

    -Bryan

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

People watching this ticket

Attachments

Tags

Pages