hrp convert xxx.har or hrp convert xxx.har --to-jsonhrp convert xxx.har --to-pytesthrp convert xxx.har --to-yamlhrp convert xxx.har --to-gotesthrp convert add_case.har --to-pytest --output-dir ../testcases/project1
(1)替换header和cookie中某个字段的值,用yaml中的内容
hrp convert add_case.har --to-pytest --output-dir ../testcases/project1 --profile ../profile/profile.yaml
profile.yaml中的header信息替换生成的测试用例中整个header# profile.yaml
headers:
token: "this header will be created or updated"
cookies:
Cookie1: "this cookie will be created or updated"
(2)覆盖header和cookie的内容,用yaml中的内容
hrp convert add_case.har --to-pytest --output-dir ../testcases/project1 --profile ../profile/profile_override.yaml
# profile_override.yaml
override: true
headers:
accept-language: "this header will be created or updated"
cookies:
Cookie1: "this cookie will be created or updated"