1
0
mirror of https://github.com/jbranchaud/til synced 2026-03-04 06:58:45 +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

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