felix
felix

Reputation: 11552

Why should I use capybara, as it is possible to use selenium itself directly?

From what I have read, selenium itself has the commands(and gem) to actually mimic web page interactions, so what is the necessity to use capybara?

Upvotes: 1

Views: 787

Answers (1)

Joe Ferris
Joe Ferris

Reputation: 2732

Using capybara over selenium-webdriver provides the following benefits:

  • It's a higher level API, which means you can use the same API for non-Javascript pages or static HTML, or swap in a different driver, such as capybara-webkit
  • It's designed specifically for testing a web application through the UI, so it has useful methods for asserting that the page is correct
  • It automatically handles many of the sticky synchronization issues you can run into when testing with a real browser
  • It's designed for testing rack applications, so it will boot and manage background servers for you

Upvotes: 3

Related Questions