1
0
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:
jbranchaud
2017-11-03 10:37:22 -05:00
parent 685d386dfc
commit 856fe03b01
2 changed files with 17 additions and 1 deletions

View File

@@ -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)

View 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()')
```