gpt4 book ai didi

angularjs - Protractor 添加请求 header

转载 作者:行者123 更新时间:2023-12-02 14:16:52 24 4
gpt4 key购买 nike

我正在使用 Protractor 来测试需要自定义 header 的应用程序。我在 Chrome 中使用这个“修改标题”扩展。如何在 Protractor 中设置它们?

最佳答案

由于 Webdriver 的限制,实际上不可能添加自定义 header 。 Protractor 和 Selenium 出现了一个问题,请引用这个帖子: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.

希望有帮助。

关于angularjs - Protractor 添加请求 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40628350/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com