Transaction Adding Query Headers

I use protractor to test an application that requires custom headers. I use "heading modifiers" in chrome for this extension. How can I install them in the protractor?

+4
source share
1 answer

It is actually not possible to add custom headers due to the restriction of Webdriver. There is a problem raised by Transporter and Selenium, please refer to this topic: https://github.com/angular/protractor/issues/740 :

The transcavator (and the webdriver that it is built on top of) is designed to test your application as a user interacting with your page, so the value of browser.get is something like "do what happens if the user opens a new tab and enter this URL" . Thus, there is no way to interact with the hood, for example, with the setting of headers, except that this is usually done for your user.

Hope this helps.

+3
source

Source: https://habr.com/ru/post/1660916/


All Articles