Module: Async::WebDriver::Scope::Navigation
- Included in:
- Async::WebDriver::Session
- Defined in:
- lib/async/webdriver/scope/navigation.rb
Overview
Helpers for navigating the browser.
Instance Method Summary collapse
-
#current_path ⇒ Object
Get the path component of the current URL.
-
#current_url ⇒ Object
Get the current URL.
-
#navigate_back ⇒ Object
Navigate back in the browser history.
-
#navigate_forward ⇒ Object
Navigate forward in the browser history.
-
#navigate_to(url) ⇒ Object
(also: #visit)
Navigate to the given URL.
-
#refresh ⇒ Object
Refresh the current page.
Instance Method Details
#current_path ⇒ Object
Get the path component of the current URL.
29 30 31 |
# File 'lib/async/webdriver/scope/navigation.rb', line 29 def current_path URI.parse(current_url).path end |
#current_url ⇒ Object
Get the current URL.
23 24 25 |
# File 'lib/async/webdriver/scope/navigation.rb', line 23 def current_url session.get("url") end |
#navigate_back ⇒ Object
Navigate back in the browser history.
34 35 36 |
# File 'lib/async/webdriver/scope/navigation.rb', line 34 def navigate_back session.post("back") end |
#navigate_forward ⇒ Object
Navigate forward in the browser history.
39 40 41 |
# File 'lib/async/webdriver/scope/navigation.rb', line 39 def navigate_forward session.post("forward") end |
#navigate_to(url) ⇒ Object Also known as: visit
Navigate to the given URL.
15 16 17 |
# File 'lib/async/webdriver/scope/navigation.rb', line 15 def navigate_to(url) session.post("url", {url: url}) end |
#refresh ⇒ Object
Refresh the current page.
44 45 46 |
# File 'lib/async/webdriver/scope/navigation.rb', line 44 def refresh session.post("refresh") end |