You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**Note:**`find` will wait for an element to appear on the page, as explained in the Ajax section. If the element does not appear it will raise an error.
**Note:** In XPath the expression `//` means something very specific, and it might not be what you think. Contrary to common belief, `//` means "anywhere in the document" not "anywhere in the current context".
```ruby
within(search_form) do
fill_in 'Name', with:'iOS 7'
click_button 'Search'
end
## Capybara Scoped Finder `within`
defsearch_form
'.search_form'
end
```ruby
within(search_form) do
fill_in 'Name', with:'iOS 7'
click_button 'Search'
end
defsearch_form
'.search_form'
end
within_fieldset("villain_fieldset") do
# ...
end
within_fieldset("villain_fieldset") do
# ...
end
within_table("some_table") do
# ...
end
within_table("some_table") do
# ...
end
# Execute the given block within the given iframe using given frame name or index.
#
within_frame('some_frame') do
end
# Execute the given block within the given iframe using given frame name or index.
#
within_frame('some_frame') do
end
save_page
save_page
# You need to install launchy gem.
save_and_open_page
# You need to install launchy gem.
save_and_open_page
```
## Capybara common
## Capybara Common
```ruby
visit("http:google.com")
page.current_url
# Execute the given script, not returning a result. This is useful for scripts that return
# complex objects, such as jQuery statements. +execute_script+ should be used over
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters