Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (33 sloc) 1.39 KB

GoutteDriver

GoutteDriver provides a bridge for the Goutte headless browser. Goutte is a classical pure-php headless browser, written by the creator of the Symfony framework Fabien Potencier.

Note

The GoutteDriver extends the :doc:`/drivers/browserkit` to fix a small edge case in the Goutte implementation of BrowserKit. It is also able to instantiate the Goutte client automatically.

Installation

GoutteDriver is a pure PHP library available through Composer:

$ composer require behat/mink-goutte-driver

Note

GoutteDriver is compatible with both Goutte 1.x which relies on Guzzle 3 and Goutte 2.x which relies on Guzzle 4+ for the underlying HTTP implementation.

Composer will probably select Goutte 2.x by default.

Usage

In order to talk with Goutte, you should instantiate a Behat\Mink\Driver\GoutteDriver:

$driver = new \Behat\Mink\Driver\GoutteDriver();

Also, if you want to configure Goutte more precisely, you could do the full setup by hand:

$client = new \Goutte\Client();
// Do more configuration for the Goutte client

$driver = new \Behat\Mink\Driver\GoutteDriver($client);