Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite recursion when using #select #63

Closed
iconara opened this issue Apr 1, 2010 · 4 comments
Closed

Infinite recursion when using #select #63

iconara opened this issue Apr 1, 2010 · 4 comments

Comments

@iconara
Copy link

iconara commented Apr 1, 2010

require 'rubygems'
require 'capybara'
require 'capybara/dsl'

include Capybara

Capybara.default_driver = :selenium
Capybara.app_host       = 'http://slask.iconara.net'
Capybara.run_server     = false

visit('/capybara-infinite-recursion.html')

select('No', :from => 'Will this work?')

With Capybara 0.3.6 running the above script yields this error when the last line is run:

/Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/session.rb:84:in `select': stack level too deep (SystemStackError)
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/dsl.rb:55:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/session.rb:85:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/dsl.rb:55:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/session.rb:85:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/dsl.rb:55:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/session.rb:85:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/dsl.rb:55:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/session.rb:85:in `select'
     ... 2176 levels...
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/dsl.rb:55:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/session.rb:85:in `select'
    from /Library/Ruby/Gems/1.8/gems/capybara-0.3.6/lib/capybara/dsl.rb:55:in `select'
    from bug.rb:13
@iconara
Copy link
Author

iconara commented Apr 4, 2010

I should add that you can run the script above as is, the URL exists, and points to a minimal HTML page with more or less only a label and a select tag.

@jnicklas
Copy link
Collaborator

jnicklas commented Apr 9, 2010

don't suggest including Capybara in the global object, closed by 360088a

@jnicklas
Copy link
Collaborator

jnicklas commented Apr 9, 2010

It's generally not a good idea to include things in the global object. I did this in the README as an example, which probably wasn't so smart. The README has been changed.

@iconara
Copy link
Author

iconara commented Apr 9, 2010

That explains it. However, I see nothing wrong with including things in the global scope in a simple script like the one above, especially when using a DSL.

@lock lock bot locked and limited conversation to collaborators Aug 18, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants