i want to add cookies in headers for automatic authorization in test with protractor, but there is no native way to do this, how i understand... How can i add custom headers to browser.get() request ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Selenium (WebDriver) does not support this. One way of solving this is by using a intermediate proxy and manipulating the headers along the line. Keep in mind that this solution works perfectly fine for HTTP, but will will require some additional workarounds if you are using HTTPS (and in most cases isn't viable).