I am working in Firefox, via the Behat Mink framework's bridge to the Selenium 2 driver. When I run the test, I get an HTTP proxy authentication popup. My behat.yaml file has a basic authentication username and password but they don't work. Could you please give me an idea to handle this popup authentication?
I also tried with the setBasicAuth() function, but it did not work for me:
$this->getSession()->getDriver()->setBasicAuth('dharmalingam' ,'Welcome123');
My behat.yml contains:
extensions:
Behat\MinkExtension\Extension:
default_session: selenium2
javascript_session: selenium2
goutte: ~
selenium2:
browser: 'firefox'
wd_host: http://dharmainin:6eb372e8-708f-4e07-a33f-b712aab3cd77@ondemand.saucelabs.com:80/wd/hub
capabilities:
version: ~
platform: 'Windows 2008'
features/extensions/SauceIntegration.php:
param1: value1
context:
parameters:
base_url: "http://example.com/"
basic_auth:
username: 'dharmalingam'
password: 'Welcome123'
Are you being prompted for authentication details for an HTTP proxy, or the site itself? If the site itself, you should be able to embed the username and password into the URL itself, using the username:password@domain
standard. The following should work in your behat.yml file:
base_url: http://dharmalingam:Welcome123@xxxx.com/
(Similar to the authentication details embedded into the saucelabs URL in the snippet above.)