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

Instance Method Details

#current_pathObject

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_urlObject

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

#refreshObject

Refresh the current page.



44
45
46
# File 'lib/async/webdriver/scope/navigation.rb', line 44

def refresh
	session.post("refresh")
end