mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
16 lines
319 B
Markdown
16 lines
319 B
Markdown
# 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()')
|
|
```
|