Reputation: 51
I'm using protractor to test app that requires custom headers. I am using for this 'modify headers' extension in chrome. How can I set them in protractor?
Upvotes: 4
Views: 3045
Reputation: 41
Actually is not possibly to add custom headers because of a limitation of Webdriver. There is an issue raised Protractor and Selenium, please refer to this thread: https://github.com/angular/protractor/issues/740:
Protractor (and webdriver, which it is built on top of) are intended to test your application like a user interacting with your page, so the meaning of browser.get is something like 'do what would happen if a user opened up a new tab and entered this URL'. So, there's no way to interact with under the hood things like setting headers, except for in the way that it would normally get done for your user.
Hope it helps.
Upvotes: 4