Skip to content

Instantly share code, notes, and snippets.

@gongo
Created April 21, 2010 05:32
Show Gist options
  • Save gongo/373462 to your computer and use it in GitHub Desktop.
Save gongo/373462 to your computer and use it in GitHub Desktop.
capybara に frame を移動する(フォーカスを別にあてる)メソッドがないので、それを追加。ついでに selenium driver 用の メソッドを追加
require 'capybara/session'
module Capybara
class Session
Capybara::Session::DSL_METHODS << :switch_frame
def_delegator :driver, :switch_frame
end
end
require 'capybara/driver/selenium_driver'
class Capybara::Driver::Selenium < Capybara::Driver::Base
def switch_frame(id)
browser.switch_to.frame(id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment