Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


Elixir library for writing integration tests and browser automation

Subscribe to updates I use hound

Statistics on hound

Number of watchers on Github 935
Number of open issues 62
Average time to close an issue 15 days
Main language Elixir
Average time to merge a PR 9 days
Open pull requests 19+
Closed pull requests 8+
Last commit over 2 years ago
Repo Created over 6 years ago
Repo Last Updated over 2 years ago
Size 446 KB
Homepage http://hexdocs.pm...
Organization / Authorhashnuke
Latest Releasev1.0.0
Page Updated
Do you use hound? Leave a review!
View open issues (62)
View hound activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating hound for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


For browser automation and writing integration tests in Elixir.

Source | Documentation

Build Status


  • Can run multiple browser sessions simultaneously. See example.

  • Supports Selenium (Firefox, Chrome), ChromeDriver and PhantomJs.

  • Supports Javascript-heavy apps. Retries a few times before reporting error.

  • Implements the WebDriver Wire Protocol.

**Internet Explorer may work under Selenium, but hasn't been tested.


ExUnit example
defmodule HoundTest do
  use ExUnit.Case
  use Hound.Helpers


  test "the truth", meta do

    element = find_element(:name, "message")
    fill_field(element, "Happy Birthday ~!")

    assert page_title() == "Thank you"


Here's another simple browser-automation example.


Hound requires Elixir 1.0.4 or higher.

  • Add dependency to your mix project

{:hound, "~> 1.0"}
  • Start Hound in your test/test_helper.exs file before the ExUnit.start() line:

When you run mix test, Hound is automatically started. You'll need a webdriver server running, like Selenium Server or Chrome Driver. If you aren't sure what it is, then read this.

If you're using Phoenix

Ensure the server is started when your tests are run. In config/test.exs change the server option of your endpoint config to true:

config :hello_world_web, HelloWorldWeb.Endpoint,
  http: [port: 4001],
  server: true


To configure Hound, use your config/config.exs file or equivalent.


config :hound, driver: "phantomjs"

More examples here.


Add the following lines to your ExUnit test files.

# Import helpers
use Hound.Helpers

# Start hound session and destroy when tests are run

If you prefer to manually start and end sessions, use Hound.start_session and Hound.end_session in the setup and teardown blocks of your tests.


The documentation pages include examples under each function.

The docs are at http://hexdocs.pm/hound.

More examples? Checkout Hound's own test cases


Can I run multiple browser sessions simultaneously

Oh yeah ~! Here is an example.

If you are running PhantomJs, take a look at the Caveats section below.

Can I run tests async?


The number of tests you can run async at any point in time, depends on the number of sessions that your webdriver can maintain at a time. For Selenium Standalone, there seems to be a default limit of 15 sessions. You can set ExUnit's async option to limit the number of tests to run parallelly.

Will Hound guarantee an isolated session per test?

Yes. A separate session is started for each test process.

PhantomJs caveats

PhantomJs is extremely fast, but there are certain caveats. It uses Ghostdriver for its webdriver server, which currently has unimplemented features or open issues.

Running tests

You need a webdriver in order to run tests. We recommend phantomjs but any can be used by setting the WEBDRIVER environment variable as shown below:

$ phantomjs --wd
$ WEBDRIVER=phantomjs mix test


Customary proclamation...

Copyright © 2013-2015, Akash Manohar J, under the MIT License (basically, do whatever you want)

hound open issues Ask a question     (View All Issues)
  • over 3 years Allow for more relax timeout on on GenServer.call in session_server.ex
  • over 3 years Tests fail randomly on start
  • over 3 years Use headless chrome
  • over 3 years Document the `cannot find ownership process for #PID<>` error
  • over 3 years PDF content helpers
  • almost 4 years Similar function to capybara's save_and_open_page?
  • almost 4 years visible on page issue
  • almost 4 years set_cookie with PhantomJS 2.1.*
  • almost 4 years Possibly useful helpers?
  • almost 4 years send_key inline documentation contains less atoms than key_codes_json can handle
  • almost 4 years How to sideload PhantomJS Polyfills?
  • about 4 years find_element with :link_text does not work with phantomjs
  • about 4 years Cannot Reconnect to Active Webdriver Session
  • about 4 years Find element when there are multiple matching elements
  • over 4 years select option
  • over 4 years Session issue when working with PhantomJS
hound open pull requests (View All Pulls)
  • Added ability to fetch the console log
  • set_cookie accepts Map, not Dict
  • If we don't know what happened, pass the error along
  • Changes to `in_browser_session`
  • Added a note in the docs outlining difference b/w element?/2 and element_displayed?/1
  • Fix Unreliable Hound.Helpers.Session API
  • Execute phantomjs configuration scripts
  • Fix typo.
  • Utilize map_join over mapping and then joining
  • Bump Travis OTP version
  • Set screenshot dir
  • Retry session
  • 301, 302, 303 (only POST), 307 redirections
  • Describe local server launch in README.md
  • Uploading files
  • Allow to define a custom directory for screenshots/pages
  • deep merge options passed to hound_session
  • consider the browser as well as the driver in selecting the responseparser
  • Add outer_html/1 to the Elements helper
hound questions on Stackoverflow (View All Questions)
  • Elixir & hound headless browser
  • How Shazam or Sound Hound works?
hound list of languages used
hound latest release notes
v1.0.0 1.0 release

Breaking changes

  • find_element now returns a Hound.Element instead of a string
  • Driver capabilities cannot longer be passed directly to Hound.start_session and need to be passed in the :driver key: Hound.start_session(driver: %{my: "capability"})

New features

  • Support changing user agent: Hound.start_session(user_agent: :iphone)
  • Support metadata: Hound.start_session(metadata: %{my: :metadata})
  • Add search_element/2 and search_element_within/3, which are non raising version of find_element/2 and find_element_within/2
  • Add fetch_log/0 and fetch_errors/0 to get JS console output.
  • Add Firefox profile


  • Timeouts now return a normal error instead of failing with a MatchError
v0.7.6 0.7.6
  • Remove starting phantomjs automatically
  • @scrogson: Simplify setup instructions
  • Update to use httpoison 0.8 to fix hackney header handling
v0.7.2 Changes to mix.exs for better docs

Docs now link to function's source in the github repo

Other projects in Elixir