For browser automation and writing integration tests in Elixir.

Source | Documentation

Build Status


**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

    find_element(:name, "message")
    |> fill_field("Happy Birthday ~!")
    |> submit_element()

    assert page_title() == "Thank you"


Here’s another simple browser-automation example.


Hound requires Erlang R16B02 or higher.

defp applist(:test) do: [:hound | app_list] end defp app_list() do: app_list end defp app_list do: [:jsex, :ibrowse] end ```

When you run mix tests, 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.


To configure Hound, use your config/config.exs file or equivalent (v0.14.0 and above). Examples are 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://akash.im/docs/hound.

More examples? [Checkout Hound's own test cases](https://github.com/HashNuke/hound/tree/master/test/json_driver)


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 gurantee an isolated session per test?

Yes. A seperate session is started for each session.

PhantomJs caveats

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


Copyright © 2013, Akash Manohar J, under the MIT License