Selenium 如何将http头添加到Robot Franework脚本?

Selenium 如何将http头添加到Robot Franework脚本?,selenium,robotframework,httplib,selenium2library,Selenium,Robotframework,Httplib,Selenium2library,我正在编写Robot框架脚本,需要在Robot脚本中设置ADD头和MODIFY头。 我正在使用库httplibrary.http,并在测试用例部分中使用关键字Setup-Request-Header,如下所示 Set Request Header ${HeaderName} ${HeaderValue} Set Request Header ${HeaderName1} ${HeaderValue1} 我问过一个人,他提到我需要定义机器人内部的变量,但不确定如何定义 我在Chro

我正在编写Robot框架脚本,需要在Robot脚本中设置
ADD
头和
MODIFY
头。 我正在使用库
httplibrary.http
,并在测试用例部分中使用关键字
Setup-Request-Header
,如下所示

Set Request Header  ${HeaderName}    ${HeaderValue}
Set Request Header  ${HeaderName1}   ${HeaderValue1}
我问过一个人,他提到我需要定义机器人内部的变量,但不确定如何定义

我在Chrome和Firefox中使用modifyheaders扩展进行了这些设置,如下所示

Add      bypassblockingtbbmicrosite              true
Modify   X-Akamai-Edgescape                      country_code=CA

首先,您需要设置标头,然后创建http上下文,然后根据需要进行get/post调用

例如:

set request header  bypassblockingtbbmicrosite  true
set request header  X-Akamai-Edgescape  country_code=CA
Create Http Context google.com  http
get [url]

首先,您需要设置标头,然后创建http上下文,然后根据需要进行get/post调用

例如:

set request header  bypassblockingtbbmicrosite  true
set request header  X-Akamai-Edgescape  country_code=CA
Create Http Context google.com  http
get [url]