I am developing a Rest API and testing it with Behat and mink-selenium2-driver (for the first time) . For security purposes, every call needs to contain a apikey in the request header.
My Problem is, i cannot set the header. My test looks like this:
Given I add "X_ApiKey" header equal to "test"
When I send a GET request to "/notice"
Then the response status code should be 200
But I keep getting a 403.
Any solutions?
In selenium it is imposible. Need to test this on other driver, like guzzle
To my knowledge, selenium driver lead chrome, but not how it is working. Proposition to check of use others drivers like guzzle, where you can set headers is a answer, in my opinion.
No i found you could additionally other option. It's recommended you use a proxy to inject additional headers to the requests generated by the browser.
To do this i found * http://wiremock.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With