Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding headers in browser.get() requests in protractor

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 ?

like image 350
Foker Avatar asked Jun 30 '26 02:06

Foker


1 Answers

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).

like image 159
Paul Avatar answered Jul 02 '26 16:07

Paul