Class: Capybara::Selenium::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/howitzer/web/capybara_methods_proxy.rb

Overview

Remove this monkey patch after fixing the bugs in selenium-webdriver / capybara :nocov:

Instance Method Summary collapse

Instance Method Details

#current_urlObject

Known issue, works differently for real browsers github.com/seleniumhq/selenium/issues/1727



18
19
20
21
22
# File 'lib/howitzer/web/capybara_methods_proxy.rb', line 18

def current_url
  return browser.current_url unless within_frame?

  execute_script('return document.location.href')
end

#titleObject



10
11
12
13
14
# File 'lib/howitzer/web/capybara_methods_proxy.rb', line 10

def title
  return browser.title unless within_frame?

  find_xpath('/html/head/title').map { |n| n[:text] }.first.to_s
end