I try to get the http response code and also the http header to make checks. I use gherkin in my tests.
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
host: 127.0.0.1
port: 8910
url: 'https://localhost'
browser: phantomjs
I can not use PHPBrowser and WebDriver together.
Initialize PHPBrowser or Guzzle in a helper method make the call and save the result temporary. To check with additional methods.
In behat you can use multiple driver and switch between them.
$mink = $this->getMink();
$goutteSession = $mink->getSession('http');
$goutteSession->visit($this->getMinkParameter('base_url') . $url);
$mink->setDefaultSessionName('http');
Do you have another/better idea?
You can achieve that with REST module.
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
host: 127.0.0.1
port: 8910
url: 'https://localhost'
browser: phantomjs
- REST:
depends: PhpBrowser
url: 'http://...'
This way PhpBrowser is only used by REST and does not conflict with PhpBrowser and you get all HTTP helper methods provided by REST.
thanks exacly i was looking for.
Published to PHPTestClub http://phptest.club/t/make-http-request-with-webdriver/1365
Most helpful comment
You can achieve that with REST module.
This way PhpBrowser is only used by REST and does not conflict with PhpBrowser and you get all HTTP helper methods provided by REST.