Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

我用charles把报文导出为har文件,使用命令行转换文件报错 #3

Closed
shichaowei opened this issue Nov 18, 2017 · 1 comment

Comments

@shichaowei
Copy link

shichaowei commented Nov 18, 2017

E:>har2case 360fengdai.har
Traceback (most recent call last):
File "C:\Python27\Scripts\har2case-script.py", line 11, in
load_entry_point('har2case==0.1.1', 'console_scripts', 'har2case')()
File "C:\Python27\lib\site-packages\har2case-0.1.1-py2.7.egg\har2case\cli.py", line 60, in main
har_parser = HarParser(har_source_file, args.filter, args.exclude)
File "C:\Python27\lib\site-packages\har2case-0.1.1-py2.7.egg\har2case\core.py", line 36, in init
self.testset = self.make_testset()
File "C:\Python27\lib\site-packages\har2case-0.1.1-py2.7.egg\har2case\core.py", line 302, in make_testset
testset = self.make_testcases()
File "C:\Python27\lib\site-packages\har2case-0.1.1-py2.7.egg\har2case\core.py", line 281, in make_testcases
{"test": self.make_testcase(entry_json)}
File "C:\Python27\lib\site-packages\har2case-0.1.1-py2.7.egg\har2case\core.py", line 264, in make_testcase
self._make_validate(testcase_dict, entry_json)
File "C:\Python27\lib\site-packages\har2case-0.1.1-py2.7.egg\har2case\core.py", line 229, in _make_validate
for key, value in resp_content_json.items():
AttributeError: 'list' object has no attribute 'items'

360fengdai.zip

@debugtalk
Copy link
Member

debugtalk commented Nov 29, 2017

看了下你提供的数据:

"content": {
    "size": 25359,
    "compression": 22175,
    "mimeType": "application/json",
    "text": "W3siaWQiOiI2MENFNjlCN0U0Mjk0NkI0QjRCMzhCQjk1Mjc3RTND......",
    "encoding": "base64"
}

mimeTypeapplication/json,但是text经过base64解码后格式为:

[
    {},
    {},
    {}
]

这个问题之前没有考虑到,我兼容处理下。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants