Skip to main content
🏠Documentation|Capybara

Last updated on : 09 Jan 2026

Capybara

Overview

Capybara is a web-based test automation tool that replicates user story scenarios and automates testing of web applications, aligning with behavior-driven software development (BDD). It's coded in the Ruby programming language and integrates seamlessly with Pcloudy for mobile testing.

Key Features:

  • Replicates real user story scenarios for authentic testing
  • Aligns with behavior-driven development (BDD) methodology
  • Written in Ruby for powerful scripting capabilities
  • Automates web and mobile application testing
  • Supports mobile app testing on both iOS and Android platforms via Pcloudy
  • Intuitive syntax for readable and maintainable test code

Prerequisites

Before setting up Capybara for mobile testing, ensure you have:

  1. Ruby - Latest version installed on your system
  2. Bundler - Ruby dependency management tool installed
  3. Pcloudy Account - Active account with valid credentials
  4. API Access Key - Available in your account profile or Quick Actions tab
  5. Mobile App Upload - Your Android (.apk) or iOS (.ipa) application uploaded to Pcloudy via the web interface
  6. Project Files - Access to your test project repository

Setup Instructions

1. Install Dependencies

Navigate to your project directory and run the following command to install required packages from Gemfile:

bundle install

2. Configure Test Environment

Edit the features/support/pcloudy.rb file with your credentials. The sample below shows the basic structure—refer to the Capability Generator page for a complete customized configuration tailored to your needs:

Pcloudy_Username = "your-email@example.com"
Pcloudy_ApiKey = "your-api-access-key"

Configuration Parameters:

  • Pcloudy_Username: Your registered email address
  • Pcloudy_ApiKey: Your API access key (found in account profile or Quick Actions tab)

Running Tests

Single Device Execution

Open the terminal in your project directory and execute:

bundle exec rake singleDevice

This command will launch the Capybara test suite on a single mobile device in the Pcloudy cloud.

Troubleshooting

Common Issues:

  • Authentication failed - Verify your username and API key are correct in the configuration file
  • App not found - Ensure the app is uploaded and filename matches exactly in configuration
  • Device not available - Check device name spelling or try a different device
  • Bundle install failed - Ensure Ruby and Bundler are properly installed
  • Gem dependencies error - Run bundle update to update gem dependencies

Additional Resources

Did this page help you?