Qiita Conference 2025

鹿野壮 (@tonkotsuboy_com)

アウトプットは最強の自己投資 〜発信が人生とキャリアを変えた話〜

19
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Selenium(Capybara)でChromeを使う

Last updated at Posted at 2012-12-26

selenium-webdriverでテストする場合に、Chromeをブラウザとして使う。

まず、chromedriverをダウンロード(最新バージョンの自分のプラットフォームのもの)、インストール $ sudo mv ~/Downloads/chromedriver /usr/bin/

spec/support/selenium_chromedriver.rb
Capybara.register_driver :selenium do |app|
  # http://code.google.com/p/chromedriver/downloads/list
  # sudo mv ~/Downloads/chromedriver /usr/bin/
  Capybara::Selenium::Driver.new(app, :browser => :chrome)
end

上記はRSpecの場合。
Inspectorが使いやすいのと慣れているのとでデバッグしやすい。

19
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
19
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?