mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
Add Navigate Back In The Browser With Capybara as a ruby til
This commit is contained in:
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
For a steady stream of TILs from a variety of rocketeers, checkout
|
||||
[til.hashrocket.com](https://til.hashrocket.com/).
|
||||
|
||||
_581 TILs and counting..._
|
||||
_582 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -444,6 +444,7 @@ _581 TILs and counting..._
|
||||
- [Last Raised Exception In The Call Stack](ruby/last-raised-exception-in-the-call-stack.md)
|
||||
- [Limit Split](ruby/limit-split.md)
|
||||
- [Listing Local Variables](ruby/listing-local-variables.md)
|
||||
- [Navigate Back In The Browser With Capybara](ruby/navigate-back-in-the-browser-with-capybara.md)
|
||||
- [Next And Previous Floats](ruby/next-and-previous-floats.md)
|
||||
- [Or Operator Precedence](ruby/or-operator-precedence.md)
|
||||
- [Override The Initial Sequence Value](ruby/override-the-initial-sequence-value.md)
|
||||
|
||||
15
ruby/navigate-back-in-the-browser-with-capybara.md
Normal file
15
ruby/navigate-back-in-the-browser-with-capybara.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Navigate Back In The Browser With Capybara
|
||||
|
||||
There are two ways to navigate back to a previous page. Capybara is driving
|
||||
the browser and it can be instructed to go back using its built-in command
|
||||
or by executing some JavaScript.
|
||||
|
||||
```ruby
|
||||
page.go_back
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```ruby
|
||||
page.evaluate_script('window.history.back()')
|
||||
```
|
||||
Reference in New Issue
Block a user